<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="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."
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103614">103614</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>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.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>cairo
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>png functions
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>cworth@cworth.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stef_sport_2002@yahoo.it
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>cairo-bugs@cairographics.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=135294" name="attach_135294" title="small C program showing the bug, look at tag 'bug #3' in the source for details.">attachment 135294</a> <a href="attachment.cgi?id=135294&action=edit" title="small C program showing the bug, look at tag 'bug #3' in the source for details.">[details]</a></span>
small C program showing the bug, look at tag '<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Should provide empty local.conf file"
   href="show_bug.cgi?id=3">bug #3</a>' 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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>