From 6e96d75c7654fa43a20ffe681d6e02cb9c5b32bc Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Mon, 2 Nov 2015 16:03:48 +0900 Subject: [PATCH] Evas: Remove dead code (cached surfaces) While cached surfaces is a topic we're discussing recently, this code is dead right now, and we will have to redesign the buffer caching better to handle proxies, maps, smart objects, etc... --- src/lib/evas/canvas/evas_object_main.c | 2 +- src/lib/evas/canvas/evas_object_smart.c | 72 ------------------------- src/lib/evas/canvas/evas_render.c | 8 --- src/lib/evas/include/evas_private.h | 3 -- 4 files changed, 1 insertion(+), 84 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 7ff20b89da..3517bcd79c 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -30,7 +30,7 @@ static const Evas_Object_Protected_State default_state = { NULL, { 0, 0, 0, 0 }, { { 0, 0, 0, 0, 0, 0, 0, 0, EINA_FALSE, EINA_FALSE } }, { 255, 255, 255, 255 }, - 1.0, 0, EVAS_RENDER_BLEND, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE + 1.0, 0, EVAS_RENDER_BLEND, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE }; static const Evas_Object_Filter_Data default_filter = { NULL, NULL, NULL, NULL, NULL, NULL, { { "default", 0.0 }, { "default", 0.0 }, 0.0 }, EINA_FALSE, EINA_FALSE, EINA_TRUE diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 1529f75f1b..451c073b14 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c @@ -1419,78 +1419,6 @@ evas_object_smart_render_pre(Evas_Object *eo_obj, void *type_private_data EINA_UNUSED) { if (obj->pre_render_done) return; - if (!obj->child_has_map && !obj->cur->cached_surface) - { -#if 0 - // REDO to handle smart move - Evas_Smart_Data *o; - - fprintf(stderr, ""); - o = type_private_data; - if (/* o->member_count > 1 && */ - o->cur.bounding_box.w == o->prev.bounding_box.w && - obj->cur->bounding_box.h == obj->prev->bounding_box.h && - (obj->cur->bounding_box.x != obj->prev->bounding_box.x || - obj->cur->bounding_box.y != obj->prev->bounding_box.y)) - { - Eina_Bool cache_map = EINA_FALSE; - - /* Check parent speed */ - /* - same speed => do not map this object */ - /* - different speed => map this object */ - /* - if parent is mapped then map this object */ - - if (!obj->smart.parent || obj->smart.parent->child_has_map) - { - cache_map = EINA_TRUE; - } - else - { - if (_evas_render_has_map(obj->smart.parent)) - { - cache_map = EINA_TRUE; - } - else - { - int speed_x, speed_y; - int speed_px, speed_py; - - speed_x = obj->cur->geometry.x - obj->prev->geometry.x; - speed_y = obj->cur->geometry.y - obj->prev->geometry.y; - - speed_px = obj->smart.parent->cur.geometry.x - obj->smart.parent->prev.geometry.x; - speed_py = obj->smart.parent->cur.geometry.y - obj->smart.parent->prev.geometry.y; - - /* speed_x = obj->cur->bounding_box.x - obj->prev->bounding_box.x; */ - /* speed_y = obj->cur->bounding_box.y - obj->prev->bounding_box.y; */ - - /* speed_px = obj->smart.parent->cur.bounding_box.x - obj->smart.parent->prev.bounding_box.x; */ - /* speed_py = obj->smart.parent->cur.bounding_box.y - obj->smart.parent->prev.bounding_box.y; */ - - fprintf(stderr, "speed: '%s',%p (%i, %i) vs '%s',%p (%i, %i)\n", - evas_object_type_get(eo_obj), obj, speed_x, speed_y, - evas_object_type_get(obj->smart.parent), obj->smart.parent, speed_px, speed_py); - - if (speed_x != speed_px || speed_y != speed_py) - cache_map = EINA_TRUE; - } - } - - if (cache_map) - fprintf(stderr, "Wouhou, I can detect moving smart object (%s, %p [%i, %i, %i, %i] < %s, %p [%i, %i, %i, %i])\n", - evas_object_type_get(eo_obj), obj, - obj->cur->bounding_box.x - obj->prev->bounding_box.x, - obj->cur->bounding_box.y - obj->prev->bounding_box.y, - obj->cur->bounding_box.w, obj->cur->bounding_box.h, - evas_object_type_get(obj->smart.parent), obj->smart.parent, - obj->smart.parent->cur.bounding_box.x - obj->smart.parent->prev.bounding_box.x, - obj->smart.parent->cur.bounding_box.y - obj->smart.parent->prev.bounding_box.y, - obj->smart.parent->cur.bounding_box.w, obj->smart.parent->cur.bounding_box.h); - - obj->cur->cached_surface = cache_map; - } -#endif - } if (obj->changed_map || obj->changed_src_visible) evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 9347189336..bdac680ac7 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1632,14 +1632,6 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, } else // not "has map" { -#if 0 - if (0 && obj->cur->cached_surface) - fprintf(stderr, "We should cache '%s' [%i, %i, %i, %i]\n", - evas_object_type_get(eo_obj), - obj->cur->bounding_box.x, obj->cur->bounding_box.x, - obj->cur->bounding_box.w, obj->cur->bounding_box.h); -#endif - if (mapped) { RD(level, " child of mapped obj\n"); diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 91e7b339cd..f01c931db5 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1012,9 +1012,6 @@ struct _Evas_Object_Protected_State Eina_Bool have_clipees : 1; Eina_Bool anti_alias : 1; Eina_Bool valid_bounding_box : 1; - - Eina_Bool cached_surface : 1; - Eina_Bool parent_cached_surface : 1; Eina_Bool snapshot : 1; };