summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-08 18:53:25 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-08 21:34:22 +0100
commitbb8770158c08394c2de79e0ca1c1b3112e17dd23 (patch)
tree40cf2613fd64f6b1519587cb32ffc0be182d16f9 /src
parent8dd14855d75240501aa2d089bcdfa46e7badbf18 (diff)
sna: Apply the clear color when resizing the front buffer
If the existing front buffer is clear, just apply the clear color to then new buffer rather than copy the old one across. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_display.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 2d8b0f36..12a6bac8 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2159,17 +2159,28 @@ static void copy_front(struct sna *sna, PixmapPtr old, PixmapPtr new)
DBG(("%s: copying box (%dx%d) from (%d, %d) to (%d, %d)\n",
__FUNCTION__, box.x2, box.y2, sx, sy, dx, dy));
- if (box.x2 != new->drawable.width || box.y2 != new->drawable.height) {
- (void)sna->render.fill_one(sna, new, new_priv->gpu_bo, 0,
+ if (old_priv->clear) {
+ (void)sna->render.fill_one(sna, new, new_priv->gpu_bo,
+ old_priv->clear_color,
0, 0,
new->drawable.width,
new->drawable.height,
- GXclear);
+ GXcopy);
+ new_priv->clear = true;
+ new_priv->clear_color = old_priv->clear_color;
+ } else {
+ if (box.x2 != new->drawable.width || box.y2 != new->drawable.height) {
+ (void)sna->render.fill_one(sna, new, new_priv->gpu_bo, 0,
+ 0, 0,
+ new->drawable.width,
+ new->drawable.height,
+ GXclear);
+ }
+ (void)sna->render.copy_boxes(sna, GXcopy,
+ old, old_priv->gpu_bo, sx, sy,
+ new, new_priv->gpu_bo, dx, dy,
+ &box, 1, 0);
}
- (void)sna->render.copy_boxes(sna, GXcopy,
- old, old_priv->gpu_bo, sx, sy,
- new, new_priv->gpu_bo, dx, dy,
- &box, 1, 0);
if (!DAMAGE_IS_ALL(new_priv->gpu_damage))
sna_damage_all(&new_priv->gpu_damage,