summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-11-13 14:39:08 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-11-13 14:39:08 -0800
commit5017f06a728cbfb33f911acd867ff9b4bf81515f (patch)
treee7af01e353ead17ee08f84724a5162e57de7b0e0 /src
parent6bbcb3cc15297dcd543fefa8789ec6c302edefbf (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/render2/evas_render2.c3
-rw-r--r--src/lib/evas/include/evas_inline.x4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/render2/evas_render2.c b/src/lib/evas/canvas/render2/evas_render2.c
index b7dc2652ab..7f670d591a 100644
--- a/src/lib/evas/canvas/render2/evas_render2.c
+++ b/src/lib/evas/canvas/render2/evas_render2.c
@@ -4,6 +4,8 @@
4 4
5#include "region.c" 5#include "region.c"
6 6
7Eina_Bool evas_render2_use = EINA_FALSE;
8
7#ifndef _WIN32 9#ifndef _WIN32
8static inline double 10static inline double
9get_time(void) 11get_time(void)
@@ -69,6 +71,7 @@ _evas_render2(Eo *eo_e, Evas_Public_Data *e)
69 if (e->rendering) return EINA_FALSE; 71 if (e->rendering) return EINA_FALSE;
70 // mark this canvas as a render2 canvas - not normal render 72 // mark this canvas as a render2 canvas - not normal render
71 e->render2 = EINA_TRUE; 73 e->render2 = EINA_TRUE;
74 evas_render2_use = EINA_TRUE;
72 // check viewport size is same as output - not allowed to differ 75 // check viewport size is same as output - not allowed to differ
73 if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h)) 76 if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
74 ERR("viewport size != output size!"); 77 ERR("viewport size != output size!");
diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x
index 7886a0fa03..69ea105c1a 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -302,9 +302,12 @@ evas_object_clip_dirty(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Da
302 evas_object_clip_dirty_do(obj); 302 evas_object_clip_dirty_do(obj);
303} 303}
304 304
305extern Eina_Bool evas_render2_use;
306
305static inline void 307static inline void
306evas_object_async_block(Evas_Object_Protected_Data *obj) 308evas_object_async_block(Evas_Object_Protected_Data *obj)
307{ 309{
310 if (!evas_render2_use) return ;
308 if (EVAS_OBJECT_DATA_VALID(obj)) 311 if (EVAS_OBJECT_DATA_VALID(obj))
309 { 312 {
310 eina_lock_take(&(obj->layer->evas->lock_objects)); 313 eina_lock_take(&(obj->layer->evas->lock_objects));
@@ -315,6 +318,7 @@ evas_object_async_block(Evas_Object_Protected_Data *obj)
315static inline void 318static inline void
316evas_canvas_async_block(Evas_Public_Data *e) 319evas_canvas_async_block(Evas_Public_Data *e)
317{ 320{
321 if (!evas_render2_use) return ;
318 if (e) 322 if (e)
319 { 323 {
320 eina_lock_take(&(e->lock_objects)); 324 eina_lock_take(&(e->lock_objects));