summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-27 10:55:02 -0700
committerAdam Jackson <ajax@redhat.com>2016-07-06 13:21:27 -0400
commitf5b224a0e20f1d44d4ab1aeeddbb4e2d40dec998 (patch)
tree1d7dad583541aa4132291f0e671086529bb01eaa
parentfad7cab684199b7a0e721e59bb25b1eb6f1a9aa8 (diff)
glamor: Adjust for drawable x/y in composite's copy optimization
Patch b64108fa305e956e4edaae9d53071ff0abee268e added a short cut that identifies composite operations that can be performed with a simple copy instead. glamor_copy works in absolute coordinates, so the dx and dy values passed in need to be converted from drawable-relative to absolute by adding the drawable x/y values. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 8b9b4387e8473810f6174519ee76818fcaae725d)
-rw-r--r--glamor/glamor_render.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 21062f0cc..91e299954 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1434,6 +1434,10 @@ glamor_composite_clipped_region(CARD8 op,
|| (op == PictOpOver
&& source->format == dest->format
&& !PICT_FORMAT_A(source->format)))))) {
+ x_source += source->pDrawable->x;
+ y_source += source->pDrawable->y;
+ x_dest += dest->pDrawable->x;
+ y_dest += dest->pDrawable->y;
glamor_copy(source->pDrawable, dest->pDrawable, NULL,
box, nbox, x_source - x_dest,
y_source - y_dest, FALSE, FALSE, 0, NULL);