On Mar 6, 2008, at 6:52 PM, Doug Hunt wrote:

> Hi Hazen, all:  I think I was able to get the memcairo driver  
> working. Attached is a patch to plplot-5.9.0:drivers/cairo.c.
>
> The immediate problem was that the X and Y dimensions of the plot  
> were not correct in plD_eop_memcairo.  The PLstream record values  
> pls->phyxma and pls->phyyma were updated during plotting (made  
> larger) so that when the cairo drawing surface memory was copied  
> back out to the user-supplied memory area, a SEGFAULT occurred.
>
> I replaced pls->phyxma and pls->phyyma in the loop with pls- 
> >xlength and pls->ylength (these were set up for this purpose in  
> plD_init_memcairo) and that seemed to do the trick.
>
> The other changes I made were more basic.  It seems that the  
> memcairo driver as it stands was designed to overwrite the user- 
> input memory area, initializing it to all black.  This behavior is  
> not useful, as the purpose of the 'mem' drivers (as I understand  
> it) is to be able to add decoration to a user-supplied image (see  
> the attachment).
>
> In order to get this behavior, I had to initialize the cairo  
> drawing surface with the user-input memory area, using
>
> 'cairo_image_surface_create_for_data'
>
> instead of
>
> 'cairo_image_surface_create'.
>
> I also added an empty subroutine plD_bop_memcairo which is used  
> instead of plD_bop_cairo.  This is done because plD_bop_cairo  
> zeroes out the image, which is not what is desired.
>
> Please take a look at this patch and consider including it in  
> plplot.  It has no effect on any driver other than memcairo.

Hi Doug,

It looks good. I applied it and now the memcairo driver works as  
expected (v8261). Thanks for your work to make this driver functional.

best,
-Hazen


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to