[cairo] basic question?

Charles سمير Doutriaux doutriaux1 at llnl.gov
Tue Aug 18 14:41:34 PDT 2009


Thanks Carl,

You're right I was the one saying for "speed reason".
The "other" reason was that I have the code setup for Qt with a image  
surface. And that recently for no reason my code that used to work  
with the cairo_X11_surface keeps failing with "bad visual". No idea  
why something must have changed on my system...
Anyhow I'll try the Pixmap idea that should get me around the visual  
problem.

thanks,

C.

On Aug 18, 2009, at 2:25 PM, Carl Worth wrote:

> Excerpts from Charles سمير Doutriaux's message of Tue Aug 18  
> 14:09:43 -0700 2009:
>> On Aug 18, 2009, at 1:54 PM, David Björkevik wrote:
>>> Charles سمير Doutriaux wrote:
>>>> For speed reason I'm thinking it would be better to draw "in  
>>>> memory"
>>>> on a cairo_image surface and then whenever I need to update copy  
>>>> the
>>>> image back to my X11 window.
>>>
>>> This is not correct. When drawing through X, cairo uses XRENDER
>>> which is
>>> hardware accelerated (if your X driver supports it).
>>
>> Actually, speed is not the only issue, the way our software is
>> designed there's a LOT of polygons to fill and it is more pleasant to
>> the user to see the image pop up finished instead of looking at it
>> being drawn.
>
> OK, Charles, but you're the one who said "for speed reasons". :-)
>
> As for not making the user look at the thing being drawn, you can also
> do that with cairo-xlib by simply creating a Pixmap, directing cairo
> at that, and finally copying the Pixmap to the Window when complete.
>
> Of course, using a cairo_image_surface_t should work identically too.
>
> The only result *should* be that the image surface is strictly slower
> than the xlib surface, (though sometimes driver bugs do get in the way
> and make xlib drawing slower than image).
>
> -Carl



More information about the cairo mailing list