tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=409f45478be1143d843f5f9efe8bacb537677ed3

commit 409f45478be1143d843f5f9efe8bacb537677ed3
Author: Daniel Hirt <daniel.h...@samsung.com>
Date:   Sun Feb 28 17:49:20 2016 +0200

    Evas textblock: add a stringshare fastpath to markup_set
    
    This optimization makes use of already stringshare'd text and avoids
    unnecessary stringshare_add calls in markup_set. It improves the
    performance of edje_calc when reapplying text to the textblock part.
---
 src/lib/evas/canvas/evas_object_textblock.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 158c84b..006bdac 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -6849,6 +6849,12 @@ _evas_textblock_text_markup_set(Eo *eo_obj EINA_UNUSED, 
Evas_Textblock_Data *o,
    Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, 
EVAS_OBJECT_CLASS);
    evas_object_async_block(obj);
 
+   if (text == o->markup_text)
+     {
+        /* Text is the same and already stringshared, do nothing */
+        return;
+     }
+   else
      {
         text = eina_stringshare_add(text);
         if (text == o->markup_text)

-- 


Reply via email to