[cairo] 32k limit with image surface?
Chris Wilson
chris at chris-wilson.co.uk
Wed Jul 29 15:13:36 PDT 2009
On Wed, 2009-07-29 at 17:50 -0400, James Cloos wrote:
> I see the same thing here from your test app.
Help me... Can't resist.... WORKSFORME™.
So all you have to do then is run my experimental tessellator branch,
that also includes stroke-using-spans.
The issue you have run across here is the 16-bit (16.16 fixed point)
coordinate limitation with using pixman to rasterise trapezoids. Hence
why by performing the rastiseration ourselves using the span polygon
rasteriser we avoid this particular bug, but only on this occasion.
16-bit coordinates are also a fundamental limitation of the X protocol.
> I can confirm that the bug is not in _cairo_fixed_from_double().
>
> But I didn't see any likely 16 bit choke point stepping through it.
>
> OTOH, if I convert the test to use a pdf surface and use gs to render
> that pdf to a png, it works correctly at sizes beyond 32.
>
> So the bug is surface-specific, affecting at least the image surface.
Cairo uses 24.8 fixed point coordinates internally (having changed over
from 16.16 for the 1.6 release), so will itself suffer range errors with
surfaces greater than ~8 million device units.
The suggested workaround for this, similar to handling the limited
texture sizes in OpenGL, is for the application to do its own tiling in
a layer above a cairo surface. Not perfect, but it may actually improve
your application's performance... (Positive spin).
Hope this helps,
-ickle
More information about the cairo
mailing list