summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-18 15:49:02 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-18 15:49:02 +0100
commit10f334872e9dd190e18c768219e60815acabe4d3 (patch)
treec4d2bdd269115ae2b0ae29fff556a79313653487
parent5ff6198c9346d84717bac28980329b048f4406e8 (diff)
sna: Add damage for the whole unaligned trapezoid not per component
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_trapezoids.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index e63981fe..a1141f1d 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -2739,18 +2739,14 @@ composite_unaligned_box(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
- if (REGION_NUM_RECTS(&region)) {
+ if (REGION_NUM_RECTS(&region))
tmp->boxes(sna, tmp,
REGION_RECTS(&region),
REGION_NUM_RECTS(&region),
opacity);
- apply_damage(&tmp->base, &region);
- }
pixman_region_fini(&region);
- } else {
+ } else
tmp->box(sna, tmp, box, opacity);
- apply_damage_box(&tmp->base, box);
- }
}
static void
@@ -2869,6 +2865,26 @@ composite_unaligned_trap(struct sna *sna,
grid_coverage(SAMPLES_Y, trap->bottom),
clip);
}
+
+ if (tmp->base.damage) {
+ BoxRec box;
+
+ box.x1 = dx + pixman_fixed_to_int(trap->left.p1.x);
+ box.x2 = dx + pixman_fixed_to_int(trap->right.p1.x);
+ box.y1 = y1;
+ box.y2 = y2 + (pixman_fixed_frac(trap->bottom) != 0);
+
+ if (clip) {
+ pixman_region16_t region;
+
+ pixman_region_init_rects(&region, &box, 1);
+ RegionIntersect(&region, &region, clip);
+ if (REGION_NUM_RECTS(&region))
+ apply_damage(&tmp->base, &region);
+ RegionUninit(&region);
+ } else
+ apply_damage_box(&tmp->base, &box);
+ }
}
inline static void