mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 04:18:05 +02:00
compositor: set transform.opaque for surfaces without alpha channel
If surface->is_opaque is set then we can assume that the whole surface is opaque. In the trivial case (no transformation or translation only) this means that transform.boundingbox is exactly the view area and is fully opaque. So it can be used for transform.opaque. This is important because damage calculation uses transform.opaque. Without this, anything underneath a surface without an explicit opaque region but a pixel format without alpha channel is drawn unnecessarily. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
parent
dfceb60274
commit
e2426960d4
1 changed files with 28 additions and 18 deletions
|
|
@ -1513,15 +1513,20 @@ weston_view_update_transform_disable(struct weston_view *view)
|
|||
view->geometry.x, view->geometry.y);
|
||||
|
||||
if (view->alpha == 1.0) {
|
||||
pixman_region32_copy(&view->transform.opaque,
|
||||
&view->surface->opaque);
|
||||
if (view->geometry.scissor_enabled)
|
||||
pixman_region32_intersect(&view->transform.opaque,
|
||||
&view->transform.opaque,
|
||||
&view->geometry.scissor);
|
||||
pixman_region32_translate(&view->transform.opaque,
|
||||
view->geometry.x,
|
||||
view->geometry.y);
|
||||
if (view->surface->is_opaque) {
|
||||
pixman_region32_copy(&view->transform.opaque,
|
||||
&view->transform.boundingbox);
|
||||
} else {
|
||||
pixman_region32_copy(&view->transform.opaque,
|
||||
&view->surface->opaque);
|
||||
if (view->geometry.scissor_enabled)
|
||||
pixman_region32_intersect(&view->transform.opaque,
|
||||
&view->transform.opaque,
|
||||
&view->geometry.scissor);
|
||||
pixman_region32_translate(&view->transform.opaque,
|
||||
view->geometry.x,
|
||||
view->geometry.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1568,15 +1573,20 @@ weston_view_update_transform_enable(struct weston_view *view)
|
|||
|
||||
if (view->alpha == 1.0 &&
|
||||
matrix->type == WESTON_MATRIX_TRANSFORM_TRANSLATE) {
|
||||
pixman_region32_copy(&view->transform.opaque,
|
||||
&view->surface->opaque);
|
||||
if (view->geometry.scissor_enabled)
|
||||
pixman_region32_intersect(&view->transform.opaque,
|
||||
&view->transform.opaque,
|
||||
&view->geometry.scissor);
|
||||
pixman_region32_translate(&view->transform.opaque,
|
||||
matrix->d[12],
|
||||
matrix->d[13]);
|
||||
if (view->surface->is_opaque) {
|
||||
pixman_region32_copy(&view->transform.opaque,
|
||||
&view->transform.boundingbox);
|
||||
} else {
|
||||
pixman_region32_copy(&view->transform.opaque,
|
||||
&view->surface->opaque);
|
||||
if (view->geometry.scissor_enabled)
|
||||
pixman_region32_intersect(&view->transform.opaque,
|
||||
&view->transform.opaque,
|
||||
&view->geometry.scissor);
|
||||
pixman_region32_translate(&view->transform.opaque,
|
||||
matrix->d[12],
|
||||
matrix->d[13]);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue