From: Derek Foreman Date: Tue, 11 Jul 2017 21:43:33 +0000 (-0500) Subject: ecore_evas: Don't start custom tickers for manually rendered canvases X-Git-Tag: upstream/1.20.0~249 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b86e6611f32e7e4d76a50ab79cb0c5d0c1921d3e;p=platform%2Fupstream%2Fefl.git 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. --- diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index ffc4e6f..5997628 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); }