summaryrefslogtreecommitdiff
path: root/test/surface-source.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-05-09 10:10:14 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-05-15 21:31:02 +0100
commitc25992479aca481d326f72665ebdcf0904273eac (patch)
tree9fb3d449a81781f939f76c6a51a8d89e0e5871af /test/surface-source.c
parent0238fe2cafea2e1ed19bb222117bd73ee6898d4d (diff)
downloadcairo-c25992479aca481d326f72665ebdcf0904273eac.tar.gz
[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 'test/surface-source.c')
-rw-r--r--test/surface-source.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/surface-source.c b/test/surface-source.c
index 09069246e..5d978f233 100644
--- a/test/surface-source.c
+++ b/test/surface-source.c
@@ -102,6 +102,7 @@ draw (cairo_t *cr, int width, int height)
(height - INTER_SIZE)/2);
cairo_destroy (cr2);
cairo_rectangle (cr, 15, 15, 60, 60);
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_fill (cr);
/* destroy the surface last, as this triggers XCloseDisplay */