summaryrefslogtreecommitdiff
path: root/src/cairo-surface-fallback.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 /src/cairo-surface-fallback.c
parent0238fe2cafea2e1ed19bb222117bd73ee6898d4d (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-surface-fallback.c')
-rw-r--r--src/cairo-surface-fallback.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index 90191023..469e9b3e 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -1336,6 +1336,7 @@ _cairo_surface_fallback_composite_trapezoids (cairo_operator_t op,
cairo_status_t
_cairo_surface_fallback_clone_similar (cairo_surface_t *surface,
cairo_surface_t *src,
+ cairo_content_t content,
int src_x,
int src_y,
int width,
@@ -1349,7 +1350,7 @@ _cairo_surface_fallback_clone_similar (cairo_surface_t *surface,
cairo_status_t status;
new_surface = _cairo_surface_create_similar_scratch (surface,
- src->content,
+ src->content & content,
width, height);
if (new_surface->status)
return new_surface->status;