summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-07-11 16:43:33 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-07-13 18:07:42 -0500
commitb86e6611f32e7e4d76a50ab79cb0c5d0c1921d3e (patch)
tree71b0039a38e0e375841635023d4f74ec7d9f07a7 /src/lib/ecore_evas
parente53b0c262ad27118c3f3b8aa57d02a47a50f5aa8 (diff)
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.
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/ecore_evas.c15
1 files changed, 15 insertions, 0 deletions
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)
2646{ 2646{
2647 ECORE_EVAS_CHECK(ee); 2647 ECORE_EVAS_CHECK(ee);
2648 ee->manual_render = manual_render; 2648 ee->manual_render = manual_render;
2649 if (!ee->anim_count) return;
2650 if (!ee->engine.func->fn_animator_register) return;
2651 if (!ee->engine.func->fn_animator_unregister) return;
2652
2653 if (manual_render)
2654 ee->engine.func->fn_animator_unregister(ee);
2655 else
2656 ee->engine.func->fn_animator_register(ee);
2649} 2657}
2650 2658
2651EAPI Eina_Bool 2659EAPI Eina_Bool
@@ -3085,6 +3093,11 @@ _ecore_evas_custom_tick_begin(void *data)
3085 3093
3086 if (ee->anim_count++ > 0) return; 3094 if (ee->anim_count++ > 0) return;
3087 3095
3096 if (ee->manual_render)
3097 {
3098 DBG("Attempt to schedule tick for manually rendered canvas.");
3099 return;
3100 }
3088 ee->engine.func->fn_animator_register(ee); 3101 ee->engine.func->fn_animator_register(ee);
3089} 3102}
3090 3103
@@ -3095,6 +3108,8 @@ _ecore_evas_custom_tick_end(void *data)
3095 3108
3096 if ((--ee->anim_count) > 0) return; 3109 if ((--ee->anim_count) > 0) return;
3097 3110
3111 if (ee->manual_render) return;
3112
3098 ee->engine.func->fn_animator_unregister(ee); 3113 ee->engine.func->fn_animator_unregister(ee);
3099} 3114}
3100 3115