[PATCH weston 1/2] compositor: set the opaque region for some views with transform
Giulio Camuffo
giuliocamuffo at gmail.com
Sun Sep 4 15:50:46 UTC 2016
If the transform on a view is only a translation we can trivially
set the opaque region for it so to optimize the rendering.
---
libweston/compositor.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 47907bb..8c3872d 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -1192,6 +1192,15 @@ 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);
if (view->geometry.scissor_enabled)
--
2.9.3
More information about the wayland-devel
mailing list