tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=593c7eac0202a95589cfac87cce35d1f8f113301

commit 593c7eac0202a95589cfac87cce35d1f8f113301
Author: Subodh Kumar <s7158.ku...@samsung.com>
Date:   Tue Jan 5 14:30:20 2016 +0000

    Edje entry: Do not update cursor for non editable entry.
    
    Summary:
    Do not update cursor for non editable entry.
    
    If entry is not editable there must not be any need to query tb cursor
    geometry and run other codes related to it. This may improve some
    performance of non-editable entry.
    
    Test Plan: NA
    
    Reviewers: tasn, herdsman, thiepha
    
    Subscribers: shilpasingh, cedric, jpeg
    
    Projects: #efl
    
    Differential Revision: https://phab.enlightenment.org/D3532
---
 src/lib/edje/edje_entry.c | 76 ++++++++++++++++++++++++-----------------------
 1 file changed, 39 insertions(+), 37 deletions(-)

diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 9b9d194..54fd3a8 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -2719,50 +2719,52 @@ _edje_entry_real_part_configure(Edje *ed, 
Edje_Real_Part *rp)
        (!rp->typedata.text)) return;
    en = rp->typedata.text->entry_data;
    if (!en) return;
-   switch (rp->part->cursor_mode)
-     {
-      case EDJE_ENTRY_CURSOR_MODE_BEFORE:
-        cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE;
-        break;
-
-      case EDJE_ENTRY_CURSOR_MODE_UNDER:
-      /* no break for a reason */
-      default:
-        cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER;
-     }
 
    _sel_update(ed, en->cursor, rp->object, en);
    _anchors_update_check(ed, rp);
-   x = y = w = h = -1;
-   xx = yy = ww = hh = -1;
-   evas_object_geometry_get(rp->object, &x, &y, &w, &h);
-   bidi_cursor = evas_textblock_cursor_geometry_bidi_get(en->cursor, &xx, &yy, 
&ww, &hh, &xx2, &yy2, NULL, NULL, cur_type);
-   if (ww < 1) ww = 1;
-   if (hh < 1) hh = 1;
-   if (en->cursor_bg)
-     {
-        evas_object_move(en->cursor_bg, x + xx, y + yy);
-        evas_object_resize(en->cursor_bg, ww, hh);
-     }
-   if (en->cursor_fg)
-     {
-        evas_object_move(en->cursor_fg, x + xx, y + yy);
-        evas_object_resize(en->cursor_fg, ww, hh);
-     }
-   if (en->cursor_fg2)
+   if (rp->part->entry_mode >= EDJE_ENTRY_EDIT_MODE_EDITABLE)
      {
-        if (bidi_cursor)
+        switch (rp->part->cursor_mode)
+         {
+           case EDJE_ENTRY_CURSOR_MODE_BEFORE:
+              cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE;
+            break;
+
+           case EDJE_ENTRY_CURSOR_MODE_UNDER:
+          /* no break for a reason */
+           default:
+             cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER;
+         }
+        x = y = w = h = -1;
+        xx = yy = ww = hh = -1;
+        evas_object_geometry_get(rp->object, &x, &y, &w, &h);
+        bidi_cursor = evas_textblock_cursor_geometry_bidi_get(en->cursor, &xx, 
&yy, &ww, &hh, &xx2, &yy2, NULL, NULL, cur_type);
+        if (ww < 1) ww = 1;
+        if (hh < 1) hh = 1;
+        if (en->cursor_bg)
           {
-             evas_object_image_fill_set(en->cursor_fg2, 0, 0, ww, hh / 2);
-             evas_object_move(en->cursor_fg2, x + xx2, y + yy2 + (hh / 2));
-             evas_object_resize(en->cursor_fg, ww, hh / 2);
-             evas_object_resize(en->cursor_fg2, ww, hh / 2);
-
-             evas_object_show(en->cursor_fg2);
+             evas_object_move(en->cursor_bg, x + xx, y + yy);
+             evas_object_resize(en->cursor_bg, ww, hh);
           }
-        else
+        if (en->cursor_fg)
           {
-             evas_object_hide(en->cursor_fg2);
+             evas_object_move(en->cursor_fg, x + xx, y + yy);
+             evas_object_resize(en->cursor_fg, ww, hh);
+          }
+        if (en->cursor_fg2)
+          {
+             if (bidi_cursor)
+               {
+                  evas_object_image_fill_set(en->cursor_fg2, 0, 0, ww, hh / 2);
+                  evas_object_move(en->cursor_fg2, x + xx2, y + yy2 + (hh / 
2));
+                  evas_object_resize(en->cursor_fg, ww, hh / 2);
+                  evas_object_resize(en->cursor_fg2, ww, hh / 2);
+                  evas_object_show(en->cursor_fg2);
+               }
+             else
+               {
+                  evas_object_hide(en->cursor_fg2);
+               }
           }
      }
 }

-- 


Reply via email to