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 <cedric@osg.samsung.com>
This commit is contained in:
Youngbok Shin 2018-03-06 17:01:02 -08:00 committed by Cedric Bail
parent c96f3d5ba5
commit 255e9c788a
2 changed files with 24 additions and 3 deletions

View File

@ -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;
@ -49,6 +52,18 @@ _angle_changed_cb(void *data, const Efl_Event *event)
efl_ui_textpath_circle_set(txtpath, CX, CY, CR, angle, dir);
}
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)
{
@ -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);

View File

@ -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);
}
}