Commit d37329cb authored by Michel Dänzer's avatar Michel Dänzer Committed by Adam Jackson

glamor: Check for composite operations which are equivalent to copies

Increases x11perf -compwinwin500 numbers by a factor of 10 for me with

Conditions copied from exaComposite().
Signed-off-by: Michel Dänzer's avatarMichel Dänzer <>
Reviewed-by: default avatarAlex Deucher <>
(cherry picked from commit b64108fa)
parent 009304ef
......@@ -1404,6 +1404,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),
|| (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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment