diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-05-09 10:10:14 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-05-15 21:31:02 +0100 |
commit | c25992479aca481d326f72665ebdcf0904273eac (patch) | |
tree | 9fb3d449a81781f939f76c6a51a8d89e0e5871af /src/cairo-clip.c | |
parent | 0238fe2cafea2e1ed19bb222117bd73ee6898d4d (diff) |
[xlib] Use minimal depth for similar clones.
Damian Frank noted
[http://lists.cairographics.org/archives/cairo/2009-May/017095.html]
a performance problem with an older XServer with an
unaccelerated composite - similar problems will be seen with non-XRender
servers which will trigger extraneous fallbacks. The problem he found was
that painting an ARGB32 image onto an RGB24 destination window (using
SOURCE) was going via the RENDER protocol and not core. He was able to
demonstrate that this could be worked around by declaring the pixel data as
an RGB24 image. The issue is that the image is uploaded into a temporary
pixmap of matching depth (i.e. 32 bit for ARGB32 and 24 bit for RGB23
data), however the core protocol can only blit between Drawables of
matching depth - so without the work-around the Drawables are mismatched
and we either need to use RENDER or fallback.
This patch adds a content mask to _cairo_surface_clone_similar() to
provide the extra bit of information to the backends for when it is
possible for them to drop channels from the clone. This is used by the
xlib backend to only create a 24 bit source when blitting to a Window.
Diffstat (limited to 'src/cairo-clip.c')
-rw-r--r-- | src/cairo-clip.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cairo-clip.c b/src/cairo-clip.c index 7066b932..bb04a9e2 100644 --- a/src/cairo-clip.c +++ b/src/cairo-clip.c @@ -772,6 +772,7 @@ _cairo_clip_init_deep_copy (cairo_clip_t *clip, if (other->surface) { int dx, dy; status = _cairo_surface_clone_similar (target, other->surface, + CAIRO_CONTENT_ALPHA, 0, 0, other->surface_rect.width, |