mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-04-03 06:50:45 +02:00
compositor: clip the opaque region with the scissor area
The opaque region is used to determine where the views underneath the current view must be drawn. If the opaque is not clipped, then the area that is part of the opaque region but not part of the scissor area is not drawn at all. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
parent
cb04f9894f
commit
0e4f097d08
1 changed files with 15 additions and 9 deletions
|
|
@ -1467,6 +1467,9 @@ weston_view_update_transform_disable(struct weston_view *view)
|
|||
if (view->alpha == 1.0) {
|
||||
pixman_region32_copy(&view->transform.opaque,
|
||||
&view->surface->opaque);
|
||||
pixman_region32_intersect(&view->transform.opaque,
|
||||
&view->transform.opaque,
|
||||
&view->geometry.scissor);
|
||||
pixman_region32_translate(&view->transform.opaque,
|
||||
view->geometry.x,
|
||||
view->geometry.y);
|
||||
|
|
@ -1504,15 +1507,6 @@ weston_view_update_transform_enable(struct weston_view *view)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (view->alpha == 1.0 &&
|
||||
matrix->type == WESTON_MATRIX_TRANSFORM_TRANSLATE) {
|
||||
pixman_region32_copy(&view->transform.opaque,
|
||||
&view->surface->opaque);
|
||||
pixman_region32_translate(&view->transform.opaque,
|
||||
matrix->d[12],
|
||||
matrix->d[13]);
|
||||
}
|
||||
|
||||
pixman_region32_init_rect(&surfregion, 0, 0,
|
||||
view->surface->width, view->surface->height);
|
||||
|
||||
|
|
@ -1523,6 +1517,18 @@ weston_view_update_transform_enable(struct weston_view *view)
|
|||
view_compute_bbox(view, surfbox, &view->transform.boundingbox);
|
||||
pixman_region32_fini(&surfregion);
|
||||
|
||||
if (view->alpha == 1.0 &&
|
||||
matrix->type == WESTON_MATRIX_TRANSFORM_TRANSLATE) {
|
||||
pixman_region32_copy(&view->transform.opaque,
|
||||
&view->surface->opaque);
|
||||
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