[cairo] strange bug(?) in cairo2 1.12.16-0ubuntu2

Bryce W. Harrington b.harrington at samsung.com
Tue Mar 4 12:39:55 PST 2014


On Sun, Feb 16, 2014 at 03:19:56PM +0100, Patrik Nilsson wrote:
> Hi All,
> 
> I'm rendering to an A1 surface. First I fill the surface (with
> cairo_fill_preserv) and then make a frame (cairo_stroke). It is later
> going to be used as a mask.
> 
> The stroke is always drawn regardless of the shape, but cairo_fill (or
> cairo_fill_preserv) only fills the surface if it is non-rectangular.
> 
> This doesn't work in package "cairo2 1.12.16-0ubuntu2", but it worked in
> previous versions of cairo. The package in Debian 7 works cairo_fill. 
> Is there a bug introduced?

Here's the changelog entry for 1.12.16-0ubuntu2:

cairo (1.12.16-0ubuntu2) saucy; urgency=low

  * debian/patches/pdf-output-avoid-transparency.patch: PDF output:
    Avoid making groups a transparency group if not required (LP:
    #668800, LP: #968785, LP: #980616, LP: #1159452, upstream bug
    #48260).
  * debian/patches/pdf-output-mime-data-embedding.patch: PDF output: Fix
    embedding of mime data, improves printing performance especially on
    PDF output with embedded JPEG (Upstream bug #48260, comment #10).

 -- Till Kamppeter <till.kamppeter at gmail.com>  Mon, 16 Sep 2012 10:28:27 +0200

These two patches affect the following files:

$ diffstat debian/patches/pdf-output-*
 cairo-pdf-surface-private.h       |    2 
 cairo-pdf-surface.c               |  148 ++++++++++++++++++++++++++------------
 cairo-recording-surface-private.h |    8 ++
 cairo-recording-surface.c         |  116 +++++++++++++++++++++++++++++
 4 files changed, 230 insertions(+), 44 deletions(-)

So, offhand, I would guess that unless you're using the PDF backend,
it isn't this particular package version causing your trouble.

What might help is if you could narrow down which versions you've seen
it in.  Ideal would be doing git bisect on the upstream cairo tree to
isolate the specific change.

Or if you can provide a compilable demo I could give it a shot.

Bryce

>     //Points to be drawn is in a list called areascreen.
> 
>     //These lines are just for a workaround if the shape is rectangular
>     GdkPoint *first = areascreen.GetHead ();
>     if ( first != NULL )
>     {
>         GdkPoint point;
>         memcpy ( &point, first, sizeof ( GdkPoint ) );
>         point.x ++; //some strange bug in cairo
>         point.y ++; //some strange bug in cairo
> 
>         areascreen.AddTail ( &point );
>     }
> 
>     /////
> 
>     cairo_set_operator ( cr, op );
> 
>     /////
> 
>     cairo_new_path ( cr );
> 
>     GdkPoint *p = areascreen.GetHead ();
>     while ( p != 0 )
>     {
>         if ( p == areascreen.GetHead () )
>         {
>             cairo_move_to ( cr, p->x, p->y );
>         }
>         else
>         {
>             cairo_line_to ( cr, p->x, p->y );
>         }
> 
>         p = areascreen.GetNext ( p );
>     }
> 
>     cairo_close_path ( cr );
> 
>     cairo_set_source_rgba ( cr, rfill, gfill, bfill, afill );
>     cairo_fill_preserve ( cr );
> 
>     ////
> 
>     cairo_set_line_width ( cr, 1 );
> 
>     cairo_set_source_rgba ( cr, rframe, gframe, bframe, aframe );
>     cairo_stroke ( cr );
> 
> Any help is welcome!
> 
> Best regards,
> Patrik
> 
> -- 
> PGP-key fingerprint: 1B30 7F61 AF9E 538A FCD6  2BE7 CED7 B0E4 3BF9 8D6C
> 
> -- 
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list