cairo_xlib_surface_create_similar: Pass the original drawable to XCreatePixmap

Previously we were passing the root window of the same screen.
Letting the X server know the actual Drawable for which we're
trying to be similar allows the X server to be more efficient.
This commit is contained in:
Carl Worth 2008-01-31 16:13:44 +11:00
parent cb9f9086a1
commit ac743e25fa

View file

@ -168,7 +168,7 @@ _cairo_xlib_surface_create_similar_with_format (void *abstract_src,
return NULL;
}
pix = XCreatePixmap (dpy, RootWindowOfScreen (src->screen),
pix = XCreatePixmap (dpy, src->drawable,
width <= 0 ? 1 : width, height <= 0 ? 1 : height,
depth);
@ -246,7 +246,7 @@ _cairo_xlib_surface_create_similar (void *abstract_src,
/* We've got a compatible XRenderFormat now, which means the
* similar surface will match the existing surface as closely in
* visual/depth etc. as possible. */
pix = XCreatePixmap (src->dpy, RootWindowOfScreen (src->screen),
pix = XCreatePixmap (src->dpy, src->drawable,
width <= 0 ? 1 : width, height <= 0 ? 1 : height,
xrender_format->depth);