sna: Tidy marking pixmap->clear for CompositeRectangles
Reduce the two unsightly checks into one. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
8b21659ef2
commit
2ae3cd36ae
|
|
@ -781,45 +781,29 @@ sna_composite_rectangles(CARD8 op,
|
|||
/* 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);
|
||||
priv->undamaged = false;
|
||||
if (op <= PictOpSrc) {
|
||||
priv->clear = true;
|
||||
priv->clear_color = 0;
|
||||
if (op == PictOpSrc)
|
||||
sna_get_pixel_from_rgba(&priv->clear_color,
|
||||
color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
color->alpha,
|
||||
dst->format);
|
||||
DBG(("%s: marking clear [%08x]\n",
|
||||
__FUNCTION__, priv->clear_color));
|
||||
}
|
||||
}
|
||||
if (!DAMAGE_IS_ALL(priv->gpu_damage)) {
|
||||
assert_pixmap_contains_box(pixmap, RegionExtents(®ion));
|
||||
|
||||
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);
|
||||
priv->undamaged = false;
|
||||
if (op <= PictOpSrc) {
|
||||
priv->clear = true;
|
||||
priv->clear_color = 0;
|
||||
if (op == PictOpSrc)
|
||||
sna_get_pixel_from_rgba(&priv->clear_color,
|
||||
color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
color->alpha,
|
||||
dst->format);
|
||||
DBG(("%s: marking clear [%08x]\n",
|
||||
__FUNCTION__, priv->clear_color));
|
||||
}
|
||||
} else
|
||||
sna_damage_add(&priv->gpu_damage, ®ion);
|
||||
} else if (op <= PictOpSrc &&
|
||||
region.data == NULL &&
|
||||
region.extents.x2 - region.extents.x1 == pixmap->drawable.width &&
|
||||
region.extents.y2 - region.extents.y1 == pixmap->drawable.height) {
|
||||
priv->clear = true;
|
||||
priv->clear_color = 0;
|
||||
if (op == PictOpSrc)
|
||||
sna_get_pixel_from_rgba(&priv->clear_color,
|
||||
color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
color->alpha,
|
||||
dst->format);
|
||||
DBG(("%s: marking clear [%08x]\n",
|
||||
__FUNCTION__, priv->clear_color));
|
||||
sna_damage_add(&priv->gpu_damage, ®ion);
|
||||
}
|
||||
|
||||
goto done;
|
||||
|
|
|
|||
Loading…
Reference in New Issue