[cairo-bugs] [Bug 103614] New: painting an xlib surface with source set to another surface created with cairo_image_surface_create_from_png fails if xlib surface is set to the exact size of the png image.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Nov 8 00:32:28 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=103614

            Bug ID: 103614
           Summary: painting an xlib surface with source set to another
                    surface created with
                    cairo_image_surface_create_from_png fails if xlib
                    surface is set to the exact size of the png image.
           Product: cairo
           Version: unspecified
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: png functions
          Assignee: cworth at cworth.org
          Reporter: stef_sport_2002 at yahoo.it
        QA Contact: cairo-bugs at cairographics.org

Created attachment 135294
  --> https://bugs.freedesktop.org/attachment.cgi?id=135294&action=edit
small C program showing the bug, look at tag 'bug #3' in the source for
details.

I created a surface: 

   image = cairo_image_surface_create_from_png(argv[1]);
   x = cairo_image_surface_get_width (image);
   y = cairo_image_surface_get_height (image);

then i created an xlib surface and set the png surface as source for painting:

   sfc = cairo_xlib_surface_create(display, window, visual, x, y);
   cairo_xlib_surface_set_size(sfc, x, y);
   ctx = cairo_create(sfc);
   cairo_set_source_surface(ctx, image, 0., 0.); 

Painting the xlib: 

   cairo_paint(ctx);

fails (get only background of xlib window) unless i add one pixel to the
xlib surface:

cairo_xlib_surface_set_size(sfc, x+1, y);

This behavior happens on all debian linux machines i have access to,
but does NOT happen on a very old rhel5 server with a (much)older cairo
revision.
Test program attached. I hope i am not doing something wrong, i checked the
test case line by line and to me it seems correct.
Stefan

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo-bugs/attachments/20171108/fecfd52c/attachment.html>


More information about the cairo-bugs mailing list