summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-10-19 22:45:15 +0100
committerCarl Worth <cworth@cworth.org>2007-11-26 21:24:49 -0800
commitb7af909c8247642d2ec4dd0b96f20348be6e971a (patch)
treefda7db68b2bbf5e86f00905bb06ea384ab3a630d
parenta81ff21d53caa436732a479c2b91c4f3dfe35c93 (diff)
downloadcairo-b7af909c8247642d2ec4dd0b96f20348be6e971a.tar.gz
[cairo-xlib] Check source for XRender support.
Do not rely on the assumption that if the destination has render support then the source has it as well - breaks when the boilerplate disables render support for a surface. Similarly do not set the XRender attributes on the source surface unless it actually has a xrender_format. (cherry picked from commit 3211d810d31a6607c8d78a50f577a8ca8eb705e6)
-rw-r--r--src/cairo-xlib-surface.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 399417c97..05d4dcaf5 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1263,10 +1263,8 @@ _recategorize_composite_operation (cairo_xlib_surface_t *dst,
return DO_XCOPYAREA;
}
- if (!dst->buggy_repeat)
- return DO_RENDER;
-
- if (is_integer_translation &&
+ if (dst->buggy_repeat &&
+ is_integer_translation &&
src_attr->extend == CAIRO_EXTEND_REPEAT &&
(src->width != 1 || src->height != 1))
{
@@ -1280,6 +1278,9 @@ _recategorize_composite_operation (cairo_xlib_surface_t *dst,
return DO_UNSUPPORTED;
}
+ if (!CAIRO_SURFACE_RENDER_HAS_COMPOSITE (src))
+ return DO_UNSUPPORTED;
+
return DO_RENDER;
}
@@ -1384,13 +1385,13 @@ _cairo_xlib_surface_composite (cairo_operator_t op,
goto BAIL;
}
- status = _cairo_xlib_surface_set_attributes (src, &src_attr);
- if (status)
- goto BAIL;
-
switch (operation)
{
case DO_RENDER:
+ status = _cairo_xlib_surface_set_attributes (src, &src_attr);
+ if (status)
+ goto BAIL;
+
_cairo_xlib_surface_ensure_dst_picture (dst);
if (mask) {
status = _cairo_xlib_surface_set_attributes (mask, &mask_attr);