diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-18 15:49:02 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-18 15:49:02 +0100 |
commit | 10f334872e9dd190e18c768219e60815acabe4d3 (patch) | |
tree | c4d2bdd269115ae2b0ae29fff556a79313653487 | |
parent | 5ff6198c9346d84717bac28980329b048f4406e8 (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.c | 28 |
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(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - if (REGION_NUM_RECTS(®ion)) { + if (REGION_NUM_RECTS(®ion)) tmp->boxes(sna, tmp, REGION_RECTS(®ion), REGION_NUM_RECTS(®ion), opacity); - apply_damage(&tmp->base, ®ion); - } pixman_region_fini(®ion); - } 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(®ion, &box, 1); + RegionIntersect(®ion, ®ion, clip); + if (REGION_NUM_RECTS(®ion)) + apply_damage(&tmp->base, ®ion); + RegionUninit(®ion); + } else + apply_damage_box(&tmp->base, &box); + } } inline static void |