[cairo] invalid size error, nth ping

Behdad Esfahbod behdad at behdad.org
Mon Jan 12 13:56:02 PST 2009


Paolo Bonzini wrote:
>>> However, first question
>>> is, can or can't we do that automatically?
>>> Cairo should just work.
>> Yes, we can.  I'm not sure it would not cause useless resource waste.
>> Maybe we can define a default policy (more than 1500 pixels => enable
>> caching; shamelessly stolen from Chris's xshm patch).
> 
> Blah, I'm rusty on my own code.  Sorry.
> 
> We cannot, because if you modify the image data of a cacheable surface
>  "from the outside" (touching the pixels directly), you need to call
> cairo_surface_flush.

1) For image surfaces we know if the user has direct access to the data.
2) Technically users are supposed to call cairo_surface_mark_dirty if they
modify it.  No one does now of course because that call's pretty much a nop.

So, really, think about heuristics and implementation, not throwing the
problem on the user...

behdad


> Paolo
> 


More information about the cairo mailing list