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.
This commit is contained in:
Derek Foreman 2017-07-11 16:43:33 -05:00
parent e53b0c262a
commit b86e6611f3
1 changed files with 15 additions and 0 deletions

View File

@ -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);
}