[cairo] 32k limit with image surface?

Ian Britten britten at caris.com
Wed Jul 29 09:41:04 PDT 2009


Ian Britten wrote:
> Is there a 32k limit to the number of pixels (in a scanline) that
> an image surface may contain (ie: Its width)?
> 
> I'm pursuing a problem where my rendered image doesn't seem to
> contain any data after pixel 32767, and I'm wondering if it's due
> to something within the Cairo stack?

I'm still looking into this, and have encountered a weird result
that may be related to my problem.  I'm hoping someone can shed
some light on this, so I can get to the root of my problem.

In the attached example, I simply create a (large) image surface,
paint it red, draw one 2-point diagonal black line, and save it
to a PNG.  I'm using the default transformations.

- If the X point of the line is less than 32767, the line draws as
   expected.
- If the X point of the line is 32768 (or greater), I get an image
   that is red in the upper-right, but the entire lower-left
   diagonal half is black.  The image no longer looks like a black
   line on a red background, but looks like a black+red pair of
   triangles (When viewed in Gimp).
- Strangely, a horizontal line seems to work ok, and draws fine
   irregardless of how big of an X value I use.

Can anyone explain what I'm seeing?  It is me, or Cairo?
Many thanks for any info!
Ian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 1003 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20090729/43f55467/attachment.c 


More information about the cairo mailing list