summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-04-10 19:38:56 +0900
committerChris Michael <cp.michael@samsung.com>2017-04-11 11:51:50 -0400
commitd449f779f11ca52b87df3d796d00e9030d11578b (patch)
treedf3661990573e4dc58b6409ad8eb06f804014a7a
parent60e2a77e9e696a4ff11a6af00ee6a531ae2f7eef (diff)
evas map: Fix test case "Flip Page"
Since 9b7ac51943ba0d6391b75cf evas map tries to avoid recalculating stuff when the map parameters have not changed. Unfortunately the code in elementary_test -to "Flip Page" was badly written. It was modifying a constant's internal value (after ugly cast). So the memcmp() and all other checks would return successfully, as the exact same pointer was being compared to itself. So, I've fixed the comparison by adding some forgotten parameters (perspective) but most importantly I fixed the map API usage in the test case.
-rw-r--r--src/bin/elementary/test_flip_page.c4
-rw-r--r--src/lib/evas/canvas/evas_map.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/src/bin/elementary/test_flip_page.c b/src/bin/elementary/test_flip_page.c
index 2aebf175b2..4dc27341c7 100644
--- a/src/bin/elementary/test_flip_page.c
+++ b/src/bin/elementary/test_flip_page.c
@@ -130,7 +130,7 @@ _slice_apply(State *st, Slice *sl,
130static void 130static void
131_slice_3d(State *st EINA_UNUSED, Slice *sl, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) 131_slice_3d(State *st EINA_UNUSED, Slice *sl, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
132{ 132{
133 Evas_Map *m = (Evas_Map *)evas_object_map_get(sl->obj); 133 Evas_Map *m = evas_map_dup(evas_object_map_get(sl->obj));
134 int i; 134 int i;
135 135
136 if (!m) return; 136 if (!m) return;
@@ -145,6 +145,7 @@ _slice_3d(State *st EINA_UNUSED, Slice *sl, Evas_Coord x, Evas_Coord y, Evas_Coo
145 if (evas_map_util_clockwise_get(m)) evas_object_show(sl->obj); 145 if (evas_map_util_clockwise_get(m)) evas_object_show(sl->obj);
146 else evas_object_hide(sl->obj); 146 else evas_object_hide(sl->obj);
147 evas_object_map_set(sl->obj, m); 147 evas_object_map_set(sl->obj, m);
148 evas_map_free(m);
148} 149}
149 150
150static void 151static void
@@ -663,7 +664,6 @@ _state_update(State *st)
663 num++; 664 num++;
664 } 665 }
665 } 666 }
666
667 num = 0; 667 num = 0;
668 for (i = 0; i < st->slices_w; i++) 668 for (i = 0; i < st->slices_w; i++)
669 { 669 {
diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c
index b3207e995a..7f8e794a45 100644
--- a/src/lib/evas/canvas/evas_map.c
+++ b/src/lib/evas/canvas/evas_map.c
@@ -556,22 +556,25 @@ evas_object_map_set(Evas_Object *eo_obj, const Evas_Map *map)
556{ 556{
557 Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj); 557 Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
558 558
559 evas_object_async_block(obj);
560
559 // check if the new map and current map attributes are same 561 // check if the new map and current map attributes are same
560 if (map && obj->map->cur.map && 562 if (map && obj->map->cur.map &&
561 (obj->map->cur.map->alpha == map->alpha) && 563 (obj->map->cur.map->alpha == map->alpha) &&
562 (obj->map->cur.map->smooth == map->smooth) && 564 (obj->map->cur.map->smooth == map->smooth) &&
563 (obj->map->cur.map->move_sync.enabled == map->move_sync.enabled) && 565 (obj->map->cur.map->move_sync.enabled == map->move_sync.enabled) &&
566 (obj->map->cur.map->move_sync.diff_x == map->move_sync.diff_x) &&
567 (obj->map->cur.map->move_sync.diff_y == map->move_sync.diff_y) &&
564 (obj->map->cur.map->count == map->count)) 568 (obj->map->cur.map->count == map->count))
565 { 569 {
566 const Evas_Map_Point *p1, *p2; 570 const Evas_Map_Point *p1, *p2;
567 p1 = obj->map->cur.map->points; 571 p1 = obj->map->cur.map->points;
568 p2 = map->points; 572 p2 = map->points;
569 if (memcmp(p1, p2, sizeof(Evas_Map_Point) * 573 if (!memcmp(p1, p2, sizeof(Evas_Map_Point) * map->count) &&
570 map->count) == 0) 574 !memcmp(&map->persp, &obj->map->cur.map->persp, sizeof(map->persp)))
571 return; 575 return;
572 } 576 }
573 577
574 evas_object_async_block(obj);
575 if ((!map) || (map->count < 4)) 578 if ((!map) || (map->count < 4))
576 { 579 {
577 if (obj->map->surface) 580 if (obj->map->surface)