summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-05-25 19:09:23 +0900
committerAdam Jackson <ajax@redhat.com>2016-05-25 11:10:14 -0400
commitb64108fa305e956e4edaae9d53071ff0abee268e (patch)
treea31a0c08690619628d76d4b64af9981c42b1b7d2
parent4711ebc174206b5a50e6ae8a7f974cd835e4ebd3 (diff)
glamor: Check for composite operations which are equivalent to copies
Increases x11perf -compwinwin500 numbers by a factor of 10 for me with radeonsi. Conditions copied from exaComposite(). Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--glamor/glamor_render.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index cc03136d5..88781d9b8 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1406,6 +1406,29 @@ glamor_composite_clipped_region(CARD8 op,
DEBUGF("clipped (%d %d) (%d %d) (%d %d) width %d height %d \n",
x_source, y_source, x_mask, y_mask, x_dest, y_dest, width, height);
+ /* Is the composite operation equivalent to a copy? */
+ if (!mask && !source->alphaMap && !dest->alphaMap
+ && source->pDrawable && !source->transform
+ && ((op == PictOpSrc
+ && ((source->format == dest->format
+ || (PICT_FORMAT_COLOR(dest->format)
+ && PICT_FORMAT_COLOR(source->format)
+ && dest->format == PICT_FORMAT(PICT_FORMAT_BPP(source->format),
+ PICT_FORMAT_TYPE(source->format),
+ 0,
+ PICT_FORMAT_R(source->format),
+ PICT_FORMAT_G(source->format),
+ PICT_FORMAT_B(source->format))))
+ || (op == PictOpOver
+ && source->format == dest->format
+ && !PICT_FORMAT_A(source->format)))))) {
+ glamor_copy(source->pDrawable, dest->pDrawable, NULL,
+ box, nbox, x_source - x_dest,
+ y_source - y_dest, FALSE, FALSE, 0, NULL);
+ ok = TRUE;
+ goto out;
+ }
+
/* XXX is it possible source mask have non-zero drawable.x/y? */
if (source
&& ((!source->pDrawable