If view is set to be entirely transparent,
there is no need to accumulate its damage.

This is an important optimization for
using view transparency. Because otherwise
transparent views are rendered like an
opaque view, and their pixel values
are set to 0 in fragment shader.

Signed-off-by: Emre Ucan <eu...@de.adit-jv.com>
---
 libweston/compositor.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libweston/compositor.c b/libweston/compositor.c
index a9de4ac..4bcf120 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -2122,7 +2122,10 @@ compositor_accumulate_damage(struct weston_compositor 
*ec)
                pixman_region32_init(&opaque);
 
                wl_list_for_each(ev, &ec->view_list, link) {
-                       if (ev->plane != plane)
+                       /* If view is set to be entirely transparent,
+                        * there is no need to accumulate its damage.
+                        */
+                       if (ev->plane != plane || ev->alpha == 0.0f)
                                continue;
 
                        view_accumulate_damage(ev, &opaque);
-- 
2.7.4

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to