sna: Propagate clears when using the BLT composite routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
810a0ce2f8
commit
d89b2647dc
|
|
@ -1200,12 +1200,12 @@ prepare_blt_clear(struct sna *sna,
|
|||
static bool
|
||||
prepare_blt_fill(struct sna *sna,
|
||||
struct sna_composite_op *op,
|
||||
PicturePtr source)
|
||||
uint32_t pixel)
|
||||
{
|
||||
DBG(("%s\n", __FUNCTION__));
|
||||
|
||||
if (op->dst.bo == NULL) {
|
||||
op->u.blt.pixel = get_solid_color(source, op->dst.format);
|
||||
op->u.blt.pixel = pixel;
|
||||
op->blt = blt_composite_fill__cpu;
|
||||
op->box = blt_composite_fill_box__cpu;
|
||||
op->boxes = blt_composite_fill_boxes__cpu;
|
||||
|
|
@ -1228,8 +1228,7 @@ prepare_blt_fill(struct sna *sna,
|
|||
|
||||
if (!sna_blt_fill_init(sna, &op->u.blt, op->dst.bo,
|
||||
op->dst.pixmap->drawable.bitsPerPixel,
|
||||
GXcopy,
|
||||
get_solid_color(source, op->dst.format)))
|
||||
GXcopy, pixel))
|
||||
return false;
|
||||
|
||||
return begin_blt(sna, op);
|
||||
|
|
@ -1975,6 +1974,13 @@ static bool source_is_gpu(PixmapPtr pixmap, const BoxRec *box)
|
|||
PICT_FORMAT_G(format), \
|
||||
PICT_FORMAT_B(format))
|
||||
|
||||
static bool
|
||||
is_clear(PixmapPtr pixmap)
|
||||
{
|
||||
struct sna_pixmap *priv = sna_pixmap(pixmap);
|
||||
return priv && priv->clear;
|
||||
}
|
||||
|
||||
bool
|
||||
sna_blt_composite(struct sna *sna,
|
||||
uint32_t op,
|
||||
|
|
@ -2083,7 +2089,7 @@ clear:
|
|||
return false;
|
||||
}
|
||||
|
||||
return prepare_blt_fill(sna, tmp, src);
|
||||
return prepare_blt_fill(sna, tmp, get_solid_color(src, tmp->dst.format));
|
||||
}
|
||||
|
||||
if (!src->pDrawable) {
|
||||
|
|
@ -2125,6 +2131,13 @@ clear:
|
|||
goto clear;
|
||||
}
|
||||
|
||||
src_pixmap = get_drawable_pixmap(src->pDrawable);
|
||||
if (is_clear(src_pixmap)) {
|
||||
return prepare_blt_fill(sna, tmp,
|
||||
color_convert(sna_pixmap(src_pixmap)->clear_color,
|
||||
src->format, tmp->dst.format));
|
||||
}
|
||||
|
||||
alpha_fixup = 0;
|
||||
if (!(dst->format == src_format ||
|
||||
dst->format == alphaless(src_format) ||
|
||||
|
|
@ -2158,7 +2171,6 @@ clear:
|
|||
return false;
|
||||
}
|
||||
|
||||
src_pixmap = get_drawable_pixmap(src->pDrawable);
|
||||
get_drawable_deltas(src->pDrawable, src_pixmap, &tx, &ty);
|
||||
x += tx + src->pDrawable->x;
|
||||
y += ty + src->pDrawable->y;
|
||||
|
|
|
|||
Loading…
Reference in New Issue