derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1f709470c5d6d6754e0cf600dac5d4fa2a9e467d

commit 1f709470c5d6d6754e0cf600dac5d4fa2a9e467d
Author: Derek Foreman <[email protected]>
Date:   Thu Nov 8 14:42:38 2018 -0600

    ee_wayland: Set opaque region for alphaless surfaces
    
    Theoretically this shouldn't be necessary, but it may be possible for
    a backend to give us a visual with translucency even if we didn't ask
    for one.
    
    also better comments.
    
    Differential Revision: https://phab.enlightenment.org/D7248
    
    Signed-off-by: Derek Foreman <[email protected]>
---
 .../engines/wayland/ecore_evas_wayland_common.c         | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c 
b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index 91c7495244..65a07862c8 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -265,12 +265,29 @@ _ecore_evas_wayland_window_update(Ecore_Evas *ee, 
Ecore_Evas_Engine_Wl_Data *wda
    fullw = w + fw - shw;
    fullh = h + fh - shh;
 
+   /* shadow but no window alpha means we have a translucent visual but the
+    * window contents are always opaque - we can set the opaque region
+    * hint so the compositor can render more efficiently
+    */
    if (has_shadow && !ee->alpha)
      {
         ecore_wl2_window_opaque_region_set(wdata->win,
                                            ee->shadow.l, ee->shadow.t,
                                            fullw, fullh);
      }
+   /* No alpha, no shadows - this should really not be a visual capable
+    * of translucent behaviour, but just in case things are sketchy in
+    * the back-end, let the compositor know we're fully opaque.
+    */
+   else if (!ee->alpha)
+     {
+        ecore_wl2_window_opaque_region_set(wdata->win,
+                                           0, 0,
+                                           fullw, fullh);
+     }
+   /* alpha is set and we might use it, so we'd better clear the
+    * opaque region, let the compositor blend it all.
+    */
    else
      {
         ecore_wl2_window_opaque_region_set(wdata->win, 0, 0, 0, 0);

-- 


Reply via email to