summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-09-20 12:24:38 +0100
committerEric Anholt <eric@anholt.net>2016-09-26 10:15:58 -0700
commit905c877f094eb6cfe905d64e34fdd01a72dd8103 (patch)
tree3eeee248b173c49ec77b16d6d92f4c0ec2b41d93 /glamor
parentb87a07567421af05622197eec91a71e4fca4f79e (diff)
glamor: Require that pixmap depths match for Render copies.
The copy optimization in d37329cba42fa8e72fe4be8a7be18e512268b5bd replicated a bug from last time we did a copy optimization: CopyArea is only defined for matching depths. This is only a problem at 15 vs 16 depth right now (24 vs 32 would also have matching Render formats, but they should work) but be strict in case we store other depths differently in the future. Fixes rendercheck -t blend -o src -f x4r4g4b4,x3r4g4b4 v2: Drop excessive src->depth == dst->depth check that snuck in. v3: Switch back to src->depth == dst->depth v4: Touch up commit message (s/bpp/depth). Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor_render.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index a06868e3f..d4d69a695 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1423,6 +1423,8 @@ glamor_composite_clipped_region(CARD8 op,
/* Is the composite operation equivalent to a copy? */
if (!mask && !source->alphaMap && !dest->alphaMap
&& source->pDrawable && !source->transform
+ /* CopyArea is only defined with matching depths. */
+ && dest->pDrawable->depth == source->pDrawable->depth
&& ((op == PictOpSrc
&& (source->format == dest->format
|| (PICT_FORMAT_COLOR(dest->format)