sna: Reduce damage after complete solid fills
RenderFillRectangles is often used to initially clear a pixmap after creation by flooding it with a solid colour, as is PolyRect. We can reduce further damage operations by checking for this condition. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
7a6a2c5d4c
commit
1f2cd536bc
|
|
@ -6283,7 +6283,13 @@ sna_poly_fill_rect_blt(DrawablePtr drawable,
|
|||
gc->alu)) {
|
||||
if (damage) {
|
||||
assert_pixmap_contains_box(pixmap, &r);
|
||||
sna_damage_add_box(damage, &r);
|
||||
if (r.x2 - r.x1 == pixmap->drawable.width &&
|
||||
r.y2 - r.y1 == pixmap->drawable.height)
|
||||
sna_damage_all(damage,
|
||||
pixmap->drawable.width,
|
||||
pixmap->drawable.height);
|
||||
else
|
||||
sna_damage_add_box(damage, &r);
|
||||
}
|
||||
} else
|
||||
success = false;
|
||||
|
|
|
|||
|
|
@ -742,7 +742,17 @@ sna_composite_rectangles(CARD8 op,
|
|||
}
|
||||
|
||||
assert_pixmap_contains_box(pixmap, RegionExtents(®ion));
|
||||
sna_damage_add(&priv->gpu_damage, ®ion);
|
||||
|
||||
/* Clearing a pixmap after creation is a common operation, so take
|
||||
* advantage and reduce further damage operations.
|
||||
*/
|
||||
if (region.data == NULL &&
|
||||
region.extents.x2 - region.extents.x1 == pixmap->drawable.width &&
|
||||
region.extents.y2 - region.extents.y1 == pixmap->drawable.height)
|
||||
sna_damage_all(&priv->gpu_damage,
|
||||
pixmap->drawable.width, pixmap->drawable.height);
|
||||
else
|
||||
sna_damage_add(&priv->gpu_damage, ®ion);
|
||||
|
||||
goto done;
|
||||
|
||||
|
|
@ -759,7 +769,7 @@ fallback:
|
|||
!sna_drawable_move_to_cpu(dst->alphaMap->pDrawable, error))
|
||||
goto done;
|
||||
|
||||
if (op == PictOpSrc || op == PictOpClear) {
|
||||
if (op <= PictOpSrc) {
|
||||
int nbox = REGION_NUM_RECTS(®ion);
|
||||
BoxPtr box = REGION_RECTS(®ion);
|
||||
uint32_t pixel;
|
||||
|
|
|
|||
Loading…
Reference in New Issue