[cairo] [bug] painting surface on surface with device offset set results in incomplete paint

Owen Taylor otaylor at redhat.com
Fri Jun 10 13:58:44 PDT 2005

On Fri, 2005-06-10 at 13:32 -0700, Radek Doulík wrote:
> Hi all,
> I am painting a surface which I use as a back buffer on another surface
> (xlib surface created on X window). The window surface has the device
> offset set to nonzero values. When I paint my back buffer surface to it,
> it is not painted completely. Looks like a bug to me. I tried to debug
> the problem, but got lost pretty soon.
> Any idea what might be wrong?
> I modified the canvas-demo.c from canvas-demo/X11/ as a simple example
> of the problem. I am using the CVS/HEAD of cairo.

The program draws exactly what I'd expect.

You create the back buffer at 300x300 and set a device offset of 50, 50.
You then draw a rectangle on the back buffer at 0, 0 of size 300, 300.
So, we effectively draw a square on it at 50, 50 of size 250, 250. (the
rest is off the surface)

Then we draw the back buffer onto the front buffer at 0, 0.

So, as expected, the final result of the drawing on the back buffer
is a 250,250 rectangle at 50,50 on the front buffer.

I'm not sure what exactly you were expecting ... to double
buffer a portion x,y,width,height of a drawable, you'd generally
use a device offset of the -x,-y and then paint the back buffer onto
the front buffer at coordinates x, y. 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050610/f0860913/attachment.pgp

More information about the cairo mailing list