cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=255e9c788acdd5b64ddd18ad44aae24b3e77cbaa

commit 255e9c788acdd5b64ddd18ad44aae24b3e77cbaa
Author: Youngbok Shin <youngb.s...@samsung.com>
Date:   Tue Mar 6 17:01:02 2018 -0800

    evas: increase offset by 4 to do work for next map points
    
    Summary:
    Increasing offset as 2 for next map points is wrong.
    If evas tries to draw for wrong combination of map points,
    it can cause wrong results. Actually, every drawing code for
    map points use and increase offset as 4.
    
    @fix
    
    Test Plan:
    A test case for textpach is modified for testing this issue.
    1. Run elementary_test with sync render mode.
       ex) ECORE_EVAS_FORCE_SYNC_RENDER=1 elementary_test
    2. Open textpath test.
    3. Set a short text by clicking newly added check box.
    4. (It will show another issues... So,) change slice number to update 
textpath properly.
    5. See some noises at top-left side of text.
       It is drawn from the two of end map points to the two of empty(not used) 
map points.
    
    Reviewers: raster, cedric, jpeg, jypark
    
    Differential Revision: https://phab.enlightenment.org/D5833
    
    Signed-off-by: Cedric Bail <ced...@osg.samsung.com>
---
 src/bin/elementary/test_ui_textpath.c              | 23 +++++++++++++++++++++-
 .../evas/engines/software_generic/evas_engine.c    |  4 ++--
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/src/bin/elementary/test_ui_textpath.c 
b/src/bin/elementary/test_ui_textpath.c
index 9b27cdb7ac..094c7970fb 100644
--- a/src/bin/elementary/test_ui_textpath.c
+++ b/src/bin/elementary/test_ui_textpath.c
@@ -9,6 +9,9 @@
 #define CY 150
 #define CR 100
 
+#define TEST_UI_TEXTPATH_LONG_TEXT "This text follows the path which you 
defined. This is a &lt;long&gt; text designed to make it ellipsis."
+#define TEST_UI_TEXTPATH_SHORT_TEXT "This text is short."
+
 static Evas_Object *angle_sld, *slice_sld, *dir_chk;
 static int path_type;
 
@@ -50,6 +53,18 @@ _angle_changed_cb(void *data, const Efl_Event *event)
 }
 
 static void
+_short_text_changed_cb(void *data, const Efl_Event *event)
+{
+   Evas_Object *txtpath = data;
+   Eina_Bool val = elm_check_selected_get(event->object);
+
+   if (val)
+     efl_text_set(txtpath, TEST_UI_TEXTPATH_SHORT_TEXT);
+   else
+     efl_text_set(txtpath, TEST_UI_TEXTPATH_LONG_TEXT);
+}
+
+static void
 _change_shape_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info 
EINA_UNUSED)
 {
    Evas_Object *txtpath = data;
@@ -99,7 +114,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *eve
    elm_box_pack_end(box, txtpath);
    efl_ui_textpath_autofit_set(txtpath, EINA_TRUE);
 
-   efl_text_set(txtpath, "This text follows the path which you defined. This 
is a &lt;long&gt; text designed to make it ellipsis.");
+   efl_text_set(txtpath, TEST_UI_TEXTPATH_LONG_TEXT);
 
    efl_ui_textpath_circle_set(txtpath, CX, CY, CR, 0, 
EFL_UI_TEXTPATH_DIRECTION_CCW);
    efl_gfx_visible_set(txtpath, EINA_TRUE);
@@ -133,6 +148,12 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *eve
    efl_gfx_visible_set(chk, EINA_TRUE);
    dir_chk = chk;
 
+   chk = elm_check_add(win);
+   elm_object_text_set(chk, "Short text");
+   efl_event_callback_add(chk, EFL_UI_CHECK_EVENT_CHANGED, 
_short_text_changed_cb, txtpath);
+   elm_box_pack_end(hbox, chk);
+   efl_gfx_visible_set(chk, EINA_TRUE);
+
    hbox = elm_box_add(win);
    elm_box_horizontal_set(hbox, EINA_TRUE);
    efl_gfx_size_hint_weight_set(hbox, EFL_GFX_SIZE_HINT_EXPAND, 
EFL_GFX_SIZE_HINT_EXPAND);
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c 
b/src/modules/evas/engines/software_generic/evas_engine.c
index a265c42d9c..46b6764081 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -2773,7 +2773,7 @@ _map_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, 
RGBA_Draw_Context *dc, RG
 static void
 evas_software_image_map_draw(void *engine EINA_UNUSED, void *data, void 
*context, RGBA_Image *surface, RGBA_Image *im, RGBA_Map *m, int smooth, int 
level, int offset)
 {
-   if (m->count - offset < 3) return;
+   if (m->count - offset < 4) return;
 
    if ((m->pts[0 + offset].x == m->pts[3 + offset].x) &&
        (m->pts[1 + offset].x == m->pts[2 + offset].x) &&
@@ -2834,7 +2834,7 @@ evas_software_image_map_draw(void *engine EINA_UNUSED, 
void *data, void *context
 
    if (m->count > 4)
      {
-        evas_software_image_map_draw(engine, data, context, surface, im, m, 
smooth, level, offset + 2);
+        evas_software_image_map_draw(engine, data, context, surface, im, m, 
smooth, level, offset + 4);
      }
 }
 

-- 


Reply via email to