derekf pushed a commit to branch master.

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

commit b86e6611f32e7e4d76a50ab79cb0c5d0c1921d3e
Author: Derek Foreman <[email protected]>
Date:   Tue Jul 11 16:43:33 2017 -0500

    ecore_evas: Don't start custom tickers for manually rendered canvases
    
    When a canvas is manually rendered the ticker is just a waste of cpu, and
    worse - it can wake the drm back-end from dpms sleep, as the display needs
    to be awake to generate vblanks.
    
    We fire a DBG message when attempting to start an animator in this state
    because it's frequently a bug that wastes battery life - (like E doing idle
    cursor animations or clock updates while the display is off)
    
    However, dpms off is not the only potential usage of manual render, so
    another commit will follow shortly to fix the bug this commit introduces -
    when using a backend with a custom ticker and doing manual render with
    the display on, calling ecore_evas_manual_render() will not draw with
    updated animator state.
    
    Fix T5462
    Again.
    Really.
---
 src/lib/ecore_evas/ecore_evas.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index ffc4e6f75d..59976282d8 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -2646,6 +2646,14 @@ ecore_evas_manual_render_set(Ecore_Evas *ee, Eina_Bool 
manual_render)
 {
    ECORE_EVAS_CHECK(ee);
    ee->manual_render = manual_render;
+   if (!ee->anim_count) return;
+   if (!ee->engine.func->fn_animator_register) return;
+   if (!ee->engine.func->fn_animator_unregister) return;
+
+   if (manual_render)
+     ee->engine.func->fn_animator_unregister(ee);
+   else
+     ee->engine.func->fn_animator_register(ee);
 }
 
 EAPI Eina_Bool
@@ -3085,6 +3093,11 @@ _ecore_evas_custom_tick_begin(void *data)
 
    if (ee->anim_count++ > 0) return;
 
+   if (ee->manual_render)
+     {
+       DBG("Attempt to schedule tick for manually rendered canvas.");
+       return;
+     }
    ee->engine.func->fn_animator_register(ee);
 }
 
@@ -3095,6 +3108,8 @@ _ecore_evas_custom_tick_end(void *data)
 
    if ((--ee->anim_count) > 0) return;
 
+   if (ee->manual_render) return;
+
    ee->engine.func->fn_animator_unregister(ee);
 }
 

-- 


Reply via email to