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. 14
      libweston/compositor.c

@ -1522,9 +1522,10 @@ 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);
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);
@ -1576,9 +1577,10 @@ weston_view_update_transform_enable(struct weston_view *view)
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);
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]);

Loading…
Cancel
Save