summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2009-08-26 21:22:07 +0200
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-10-16 18:24:59 +0300
commitc4cc2247813f26db79fc2c6aa789856569497613 (patch)
treefbdb9f420015e6284c05c0dc817d12b1892809cc
parent06c2a4d2341dcfbed514bc6e21f051b4f41b3c59 (diff)
[xlib] DO_XCOPYAREA and DO_XTILE optimizations break with Window source
Cairo should include the contents of subwindows when using a Window as a source but will clip to subwindows when using a Window as a destination. This can be set using the GC's subwindow_mode. XCopyArea and XFillRectangle can however only use one GC for both source and destination. Cairo's mode is set to (the default) ClipByChildren. This means that copying from a Window is broken, so we only allow the optimization when we know that the source is a Pixmap. The performance impact of this change has not been tested. It should be small, as the code will use XRender otherwise. If it turns out to be a bigger impact, the optimizations could be improved by doing a two-step copy process: 1) Copy to an intermediate Pixmap with IncludeInferiors 2) Copy to the destination with ClipByChildren (potentially omitting one one of the steps if source or destination are known to be Pixmaps). references: commit 0c5d28a4e5ce5e4dd72c0f416ce5e960e92b808b https://bugs.freedesktop.org/show_bug.cgi?id=12996
-rw-r--r--src/cairo-xlib-surface.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index ba38f5d8b..bd8080cad 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1609,6 +1609,7 @@ _recategorize_composite_operation (cairo_xlib_surface_t *dst,
is_integer_translation &&
src_attr->extend == CAIRO_EXTEND_NONE &&
! needs_alpha_composite &&
+ src->owns_pixmap &&
_surfaces_compatible (src, dst))
{
return DO_XCOPYAREA;
@@ -1621,6 +1622,7 @@ _recategorize_composite_operation (cairo_xlib_surface_t *dst,
{
if (! have_mask &&
! needs_alpha_composite &&
+ src->owns_pixmap &&
_surfaces_compatible (dst, src))
{
return DO_XTILE;