summaryrefslogtreecommitdiff
path: root/src/sna/gen6_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-04-04 10:46:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-04-04 11:45:53 +0100
commit31a4c7bc13c5f4560482b450b9ee4788a58930cd (patch)
treea9f5d8aa9aae4547ff2615ed1ff2865bde3ba479 /src/sna/gen6_render.c
parentf0565852b668832d4988e875bc12e23abb6e1829 (diff)
sna/gen2+: Replace composite sources with solids where possible
If the composite reads entirely from within a large pixmap which is a clear color, just replace the source with a solid. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen6_render.c')
-rw-r--r--src/sna/gen6_render.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index f1f79463..867108b3 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -1773,6 +1773,18 @@ gen6_composite_picture(struct sna *sna,
y += dy;
channel->transform = NULL;
channel->filter = PictFilterNearest;
+
+ if (channel->repeat &&
+ (x >= 0 &&
+ y >= 0 &&
+ x + w < pixmap->drawable.width &&
+ y + h < pixmap->drawable.height)) {
+ struct sna_pixmap *priv = sna_pixmap(pixmap);
+ if (priv->clear) {
+ DBG(("%s: converting large pixmap source into solid [%08x]\n", __FUNCTION__, priv->clear_color));
+ return gen4_channel_init_solid(sna, channel, priv->clear_color);
+ }
+ }
} else
channel->transform = picture->transform;