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

Owen Taylor otaylor at redhat.com
Mon Jun 13 08:16:44 PDT 2005


On Mon, 2005-06-13 at 01:52 -0700, Radek Doulík wrote:
> Hi Owen,
> 
> thanks for your reply.
> 
> On Fri, 2005-06-10 at 16:58 -0400, Owen Taylor wrote:
> > 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)
> 
> What I expect is that setting device offset means shifting the whole
> surface to the offset. If it works as you describe, than it just sets
> transition of surface coordinates by the offset, but position and size
> of the surface in device coordinates is not changed.

For output, I don't think there is a difference between the two
descriptions. For using the surface as a source, I agree that it would
be more logical if the device offset affected coordinates there, but it
would be a pain to implement, and I don't know of any real use
cases.

> > 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. 
> 
> Yes, I need to back buffer a rectangle x,y,width,height on X window
> where x > 0 || y > 0. Using device offset -x, -y and painting on x, y
> doesn't work for me.

Well, it works for me, and for GDK. I'd suggest you try again. :-)

Regards,
						Owen

-------------- 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/20050613/85007688/attachment.pgp


More information about the cairo mailing list