evas: disable unecessary lock when not using evas_render2

Calling this lock for no good reason result in a 2% slow down. Easy
enough to disable as we do not use evas_render2 at all. Might be
something to consider if we ever develop evas_render2 further.
This commit is contained in:
Cedric BAIL 2017-11-13 14:39:08 -08:00
parent 6bbcb3cc15
commit 5017f06a72
2 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,8 @@
#include "region.c"
Eina_Bool evas_render2_use = EINA_FALSE;
#ifndef _WIN32
static inline double
get_time(void)
@ -69,6 +71,7 @@ _evas_render2(Eo *eo_e, Evas_Public_Data *e)
if (e->rendering) return EINA_FALSE;
// mark this canvas as a render2 canvas - not normal render
e->render2 = EINA_TRUE;
evas_render2_use = EINA_TRUE;
// check viewport size is same as output - not allowed to differ
if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
ERR("viewport size != output size!");

View File

@ -302,9 +302,12 @@ evas_object_clip_dirty(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Da
evas_object_clip_dirty_do(obj);
}
extern Eina_Bool evas_render2_use;
static inline void
evas_object_async_block(Evas_Object_Protected_Data *obj)
{
if (!evas_render2_use) return ;
if (EVAS_OBJECT_DATA_VALID(obj))
{
eina_lock_take(&(obj->layer->evas->lock_objects));
@ -315,6 +318,7 @@ evas_object_async_block(Evas_Object_Protected_Data *obj)
static inline void
evas_canvas_async_block(Evas_Public_Data *e)
{
if (!evas_render2_use) return ;
if (e)
{
eina_lock_take(&(e->lock_objects));