compositor: Fix opaque regions

Commit 0e4f097d broke opaque regions, and since then weston will waste
time rendering occluded areas.

I think this is because we're taking the intersection of the opaque
and scissor regions even when the scissor region isn't enabled.

An easy test is to turn on triangle fan debugging with the gl renderer,
then run weston-simple-damage and move another opaque application such as
weston-terminal over it.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
dev
Derek Foreman 3 years ago committed by Daniel Stone
parent 349252788f
commit 713f02327d
  1. 2
      libweston/compositor.c

@ -1522,6 +1522,7 @@ weston_view_update_transform_disable(struct weston_view *view)
if (view->alpha == 1.0) { if (view->alpha == 1.0) {
pixman_region32_copy(&view->transform.opaque, pixman_region32_copy(&view->transform.opaque,
&view->surface->opaque); &view->surface->opaque);
if (view->geometry.scissor_enabled)
pixman_region32_intersect(&view->transform.opaque, pixman_region32_intersect(&view->transform.opaque,
&view->transform.opaque, &view->transform.opaque,
&view->geometry.scissor); &view->geometry.scissor);
@ -1576,6 +1577,7 @@ weston_view_update_transform_enable(struct weston_view *view)
matrix->type == WESTON_MATRIX_TRANSFORM_TRANSLATE) { matrix->type == WESTON_MATRIX_TRANSFORM_TRANSLATE) {
pixman_region32_copy(&view->transform.opaque, pixman_region32_copy(&view->transform.opaque,
&view->surface->opaque); &view->surface->opaque);
if (view->geometry.scissor_enabled)
pixman_region32_intersect(&view->transform.opaque, pixman_region32_intersect(&view->transform.opaque,
&view->transform.opaque, &view->transform.opaque,
&view->geometry.scissor); &view->geometry.scissor);

Loading…
Cancel
Save