summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-08-06 11:06:55 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-08-06 11:06:55 +0200
commit79f2576a8919c288f51939b12cc4edfd67023c17 (patch)
tree3a3b6859febe339fb5a538c0cda7ff416af64409
parent0d44b94248465a634720cce00ef9d477c8fb5b82 (diff)
parenta7fd98f8f6d411c120e9c1c8ceeedbeb54d675a5 (diff)
Merge branch 'devs/cedric/evas_snapshot'
Evas snapshot feature is a new attribute for Evas_Objet_Image that allow the object to get the pixels of the object below it in its own buffer. This can be used for two typicall use case. First is improving accessibility by offering a magnifying glass using snapshot together with Evas_Map. Second is to make it possible to blur the underlying content (in conjunction with filters). This should make it possible to do some nice new theme and effect. NOTE: As a technical note, this feature is very costly at the point. We do not support partial update on surface and we can't know if the object below did change, so we are forced to redraw the full content of the snapshot object for every frame. The only way to fix it is to add per surface damage detection. I guess it is time to start rolling this in.
-rw-r--r--src/bin/edje/edje_cc_handlers.c9
-rw-r--r--src/lib/edje/Edje_Common.h3
-rw-r--r--src/lib/edje/edje_cache.c3
-rw-r--r--src/lib/edje/edje_calc.c7
-rw-r--r--src/lib/edje/edje_data.c20
-rw-r--r--src/lib/edje/edje_load.c5
-rw-r--r--src/lib/edje/edje_private.h4
-rw-r--r--src/lib/evas/canvas/evas_image.eo22
-rw-r--r--src/lib/evas/canvas/evas_main.c4
-rw-r--r--src/lib/evas/canvas/evas_object_image.c63
-rw-r--r--src/lib/evas/canvas/evas_object_main.c2
-rw-r--r--src/lib/evas/canvas/evas_render.c440
-rw-r--r--src/lib/evas/include/evas_inline.x3
-rw-r--r--src/lib/evas/include/evas_private.h4
14 files changed, 416 insertions, 173 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index e002d19aa4..3138300936 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -1270,6 +1270,7 @@ New_Object_Handler object_handlers[] =
1270 external{} 1270 external{}
1271 proxy{} 1271 proxy{}
1272 spacer{} 1272 spacer{}
1273 snapshot{}
1273 part { 1274 part {
1274 desc { 1275 desc {
1275 } 1276 }
@@ -1422,6 +1423,7 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c
1422 case EDJE_PART_TYPE_RECTANGLE: 1423 case EDJE_PART_TYPE_RECTANGLE:
1423 case EDJE_PART_TYPE_SWALLOW: 1424 case EDJE_PART_TYPE_SWALLOW:
1424 case EDJE_PART_TYPE_GROUP: 1425 case EDJE_PART_TYPE_GROUP:
1426 case EDJE_PART_TYPE_SNAPSHOT:
1425 result = mem_alloc(SZ(Edje_Part_Description_Common)); 1427 result = mem_alloc(SZ(Edje_Part_Description_Common));
1426 break; 1428 break;
1427 case EDJE_PART_TYPE_TEXT: 1429 case EDJE_PART_TYPE_TEXT:
@@ -4882,6 +4884,7 @@ ob_collections_group_parts_part_short(void)
4882 "external", EDJE_PART_TYPE_EXTERNAL, 4884 "external", EDJE_PART_TYPE_EXTERNAL,
4883 "proxy", EDJE_PART_TYPE_PROXY, 4885 "proxy", EDJE_PART_TYPE_PROXY,
4884 "spacer", EDJE_PART_TYPE_SPACER, 4886 "spacer", EDJE_PART_TYPE_SPACER,
4887 "snapshot", EDJE_PART_TYPE_SNAPSHOT,
4885 NULL); 4888 NULL);
4886 4889
4887 stack_pop_quick(EINA_TRUE, EINA_TRUE); 4890 stack_pop_quick(EINA_TRUE, EINA_TRUE);
@@ -4918,6 +4921,7 @@ _part_desc_free(Edje_Part_Collection *pc,
4918 case EDJE_PART_TYPE_RECTANGLE: 4921 case EDJE_PART_TYPE_RECTANGLE:
4919 case EDJE_PART_TYPE_SWALLOW: 4922 case EDJE_PART_TYPE_SWALLOW:
4920 case EDJE_PART_TYPE_GROUP: 4923 case EDJE_PART_TYPE_GROUP:
4924 case EDJE_PART_TYPE_SNAPSHOT:
4921 /* Nothing todo, this part only have a common description. */ 4925 /* Nothing todo, this part only have a common description. */
4922 break; 4926 break;
4923 case EDJE_PART_TYPE_BOX: 4927 case EDJE_PART_TYPE_BOX:
@@ -5289,6 +5293,7 @@ st_collections_group_parts_part_name(void)
5289 @li EXTERNAL 5293 @li EXTERNAL
5290 @li PROXY 5294 @li PROXY
5291 @li SPACER 5295 @li SPACER
5296 @li SNAPSHOT
5292 @endproperty 5297 @endproperty
5293*/ 5298*/
5294static void 5299static void
@@ -5310,7 +5315,8 @@ st_collections_group_parts_part_type(void)
5310 "TABLE", EDJE_PART_TYPE_TABLE, 5315 "TABLE", EDJE_PART_TYPE_TABLE,
5311 "EXTERNAL", EDJE_PART_TYPE_EXTERNAL, 5316 "EXTERNAL", EDJE_PART_TYPE_EXTERNAL,
5312 "PROXY", EDJE_PART_TYPE_PROXY, 5317 "PROXY", EDJE_PART_TYPE_PROXY,
5313 "SPACER", EDJE_PART_TYPE_SPACER, 5318 "SPACER", EDJE_PART_TYPE_SPACER,
5319 "SNAPSHOT", EDJE_PART_TYPE_SNAPSHOT,
5314 NULL); 5320 NULL);
5315 5321
5316 _part_type_set(type); 5322 _part_type_set(type);
@@ -7025,6 +7031,7 @@ st_collections_group_parts_part_description_inherit(void)
7025 case EDJE_PART_TYPE_RECTANGLE: 7031 case EDJE_PART_TYPE_RECTANGLE:
7026 case EDJE_PART_TYPE_SWALLOW: 7032 case EDJE_PART_TYPE_SWALLOW:
7027 case EDJE_PART_TYPE_GROUP: 7033 case EDJE_PART_TYPE_GROUP:
7034 case EDJE_PART_TYPE_SNAPSHOT:
7028 /* Nothing todo, this part only have a common description. */ 7035 /* Nothing todo, this part only have a common description. */
7029 break; 7036 break;
7030 case EDJE_PART_TYPE_TEXT: 7037 case EDJE_PART_TYPE_TEXT:
diff --git a/src/lib/edje/Edje_Common.h b/src/lib/edje/Edje_Common.h
index e8bc7191bc..468b163c0a 100644
--- a/src/lib/edje/Edje_Common.h
+++ b/src/lib/edje/Edje_Common.h
@@ -1235,7 +1235,8 @@ typedef enum _Edje_Part_Type
1235 EDJE_PART_TYPE_MESH_NODE = 13, 1235 EDJE_PART_TYPE_MESH_NODE = 13,
1236 EDJE_PART_TYPE_LIGHT = 14, 1236 EDJE_PART_TYPE_LIGHT = 14,
1237 EDJE_PART_TYPE_CAMERA = 15, 1237 EDJE_PART_TYPE_CAMERA = 15,
1238 EDJE_PART_TYPE_LAST = 16 /**< Last type value */ 1238 EDJE_PART_TYPE_SNAPSHOT = 16,
1239 EDJE_PART_TYPE_LAST = 17 /**< Last type value */
1239} Edje_Part_Type; 1240} Edje_Part_Type;
1240/** 1241/**
1241 * @} 1242 * @}
diff --git a/src/lib/edje/edje_cache.c b/src/lib/edje/edje_cache.c
index 13f83767f9..10fa3fa7b8 100644
--- a/src/lib/edje/edje_cache.c
+++ b/src/lib/edje/edje_cache.c
@@ -33,6 +33,7 @@ edje_cache_emp_alloc(Edje_Part_Collection_Directory_Entry *ce)
33 INIT_EMP_BOTH(TABLE, Edje_Part_Description_Table, ce); 33 INIT_EMP_BOTH(TABLE, Edje_Part_Description_Table, ce);
34 INIT_EMP_BOTH(EXTERNAL, Edje_Part_Description_External, ce); 34 INIT_EMP_BOTH(EXTERNAL, Edje_Part_Description_External, ce);
35 INIT_EMP_BOTH(SPACER, Edje_Part_Description_Common, ce); 35 INIT_EMP_BOTH(SPACER, Edje_Part_Description_Common, ce);
36 INIT_EMP_BOTH(SNAPSHOT, Edje_Part_Description_Common, ce);
36 INIT_EMP(part, Edje_Part, ce); 37 INIT_EMP(part, Edje_Part, ce);
37} 38}
38 39
@@ -51,6 +52,7 @@ edje_cache_emp_free(Edje_Part_Collection_Directory_Entry *ce)
51 eina_mempool_del(ce->mp.TABLE); 52 eina_mempool_del(ce->mp.TABLE);
52 eina_mempool_del(ce->mp.EXTERNAL); 53 eina_mempool_del(ce->mp.EXTERNAL);
53 eina_mempool_del(ce->mp.SPACER); 54 eina_mempool_del(ce->mp.SPACER);
55 eina_mempool_del(ce->mp.SNAPSHOT);
54 eina_mempool_del(ce->mp.part); 56 eina_mempool_del(ce->mp.part);
55 memset(&ce->mp, 0, sizeof (ce->mp)); 57 memset(&ce->mp, 0, sizeof (ce->mp));
56 58
@@ -65,6 +67,7 @@ edje_cache_emp_free(Edje_Part_Collection_Directory_Entry *ce)
65 eina_mempool_del(ce->mp_rtl.TABLE); 67 eina_mempool_del(ce->mp_rtl.TABLE);
66 eina_mempool_del(ce->mp_rtl.EXTERNAL); 68 eina_mempool_del(ce->mp_rtl.EXTERNAL);
67 eina_mempool_del(ce->mp_rtl.SPACER); 69 eina_mempool_del(ce->mp_rtl.SPACER);
70 eina_mempool_del(ce->mp_rtl.SNAPSHOT);
68 memset(&ce->mp_rtl, 0, sizeof (ce->mp_rtl)); 71 memset(&ce->mp_rtl, 0, sizeof (ce->mp_rtl));
69 ce->ref = NULL; 72 ce->ref = NULL;
70} 73}
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 16d0c1ad77..dcf868a11a 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -326,6 +326,13 @@ case EDJE_PART_TYPE_##Short: \
326 memsize = sizeof(Edje_Part_Description_Common); 326 memsize = sizeof(Edje_Part_Description_Common);
327 break; 327 break;
328 328
329 case EDJE_PART_TYPE_SNAPSHOT:
330 desc_rtl = eina_mempool_malloc(ce->mp_rtl.SNAPSHOT,
331 sizeof (Edje_Part_Description_Common));
332 ce->count.SNAPSHOT++;
333 memsize = sizeof(Edje_Part_Description_Common);
334 break;
335
329 case EDJE_PART_TYPE_SWALLOW: 336 case EDJE_PART_TYPE_SWALLOW:
330 desc_rtl = eina_mempool_malloc(ce->mp_rtl.SWALLOW, 337 desc_rtl = eina_mempool_malloc(ce->mp_rtl.SWALLOW,
331 sizeof (Edje_Part_Description_Common)); 338 sizeof (Edje_Part_Description_Common));
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index cedda6d413..19176d8c26 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -36,6 +36,7 @@ Eet_Data_Descriptor *_edje_edd_edje_part = NULL;
36Eet_Data_Descriptor *_edje_edd_edje_part_pointer = NULL; 36Eet_Data_Descriptor *_edje_edd_edje_part_pointer = NULL;
37Eet_Data_Descriptor *_edje_edd_edje_part_description_variant = NULL; 37Eet_Data_Descriptor *_edje_edd_edje_part_description_variant = NULL;
38Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle = NULL; 38Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle = NULL;
39Eet_Data_Descriptor *_edje_edd_edje_part_description_snapshot = NULL;
39Eet_Data_Descriptor *_edje_edd_edje_part_description_spacer = NULL; 40Eet_Data_Descriptor *_edje_edd_edje_part_description_spacer = NULL;
40Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow = NULL; 41Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow = NULL;
41Eet_Data_Descriptor *_edje_edd_edje_part_description_group = NULL; 42Eet_Data_Descriptor *_edje_edd_edje_part_description_group = NULL;
@@ -54,6 +55,7 @@ Eet_Data_Descriptor *_edje_edd_edje_part_description_light = NULL;
54Eet_Data_Descriptor *_edje_edd_edje_part_description_camera = NULL; 55Eet_Data_Descriptor *_edje_edd_edje_part_description_camera = NULL;
55Eet_Data_Descriptor *_edje_edd_edje_part_description_variant_list = NULL; 56Eet_Data_Descriptor *_edje_edd_edje_part_description_variant_list = NULL;
56Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle_pointer = NULL; 57Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle_pointer = NULL;
58Eet_Data_Descriptor *_edje_edd_edje_part_description_snapshot_pointer = NULL;
57Eet_Data_Descriptor *_edje_edd_edje_part_description_spacer_pointer = NULL; 59Eet_Data_Descriptor *_edje_edd_edje_part_description_spacer_pointer = NULL;
58Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow_pointer = NULL; 60Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow_pointer = NULL;
59Eet_Data_Descriptor *_edje_edd_edje_part_description_group_pointer = NULL; 61Eet_Data_Descriptor *_edje_edd_edje_part_description_group_pointer = NULL;
@@ -116,6 +118,7 @@ EMP(SPACER, spacer)
116EMP(MESH_NODE, mesh_node) 118EMP(MESH_NODE, mesh_node)
117EMP(LIGHT, light) 119EMP(LIGHT, light)
118EMP(CAMERA, camera) 120EMP(CAMERA, camera)
121EMP(SNAPSHOT, snapshot)
119#undef EMP 122#undef EMP
120 123
121EAPI Eina_Mempool *_emp_part = NULL; 124EAPI Eina_Mempool *_emp_part = NULL;
@@ -164,7 +167,8 @@ struct
164 { EDJE_PART_TYPE_SPACER, "spacer" }, 167 { EDJE_PART_TYPE_SPACER, "spacer" },
165 { EDJE_PART_TYPE_MESH_NODE, "mesh_node" }, 168 { EDJE_PART_TYPE_MESH_NODE, "mesh_node" },
166 { EDJE_PART_TYPE_LIGHT, "light" }, 169 { EDJE_PART_TYPE_LIGHT, "light" },
167 { EDJE_PART_TYPE_CAMERA, "camera" } 170 { EDJE_PART_TYPE_CAMERA, "camera" },
171 { EDJE_PART_TYPE_SNAPSHOT, "snapshot" }
168}; 172};
169 173
170static const char * 174static const char *
@@ -254,6 +258,7 @@ _edje_edd_shutdown(void)
254 FREED(_edje_edd_edje_part_pointer); 258 FREED(_edje_edd_edje_part_pointer);
255 FREED(_edje_edd_edje_part_description_variant); 259 FREED(_edje_edd_edje_part_description_variant);
256 FREED(_edje_edd_edje_part_description_rectangle); 260 FREED(_edje_edd_edje_part_description_rectangle);
261 FREED(_edje_edd_edje_part_description_snapshot);
257 FREED(_edje_edd_edje_part_description_spacer); 262 FREED(_edje_edd_edje_part_description_spacer);
258 FREED(_edje_edd_edje_part_description_swallow); 263 FREED(_edje_edd_edje_part_description_swallow);
259 FREED(_edje_edd_edje_part_description_group); 264 FREED(_edje_edd_edje_part_description_group);
@@ -272,6 +277,7 @@ _edje_edd_shutdown(void)
272 FREED(_edje_edd_edje_part_description_3d_vec); 277 FREED(_edje_edd_edje_part_description_3d_vec);
273 FREED(_edje_edd_edje_part_description_variant_list); 278 FREED(_edje_edd_edje_part_description_variant_list);
274 FREED(_edje_edd_edje_part_description_rectangle_pointer); 279 FREED(_edje_edd_edje_part_description_rectangle_pointer);
280 FREED(_edje_edd_edje_part_description_snapshot_pointer);
275 FREED(_edje_edd_edje_part_description_spacer_pointer); 281 FREED(_edje_edd_edje_part_description_spacer_pointer);
276 FREED(_edje_edd_edje_part_description_swallow_pointer); 282 FREED(_edje_edd_edje_part_description_swallow_pointer);
277 FREED(_edje_edd_edje_part_description_group_pointer); 283 FREED(_edje_edd_edje_part_description_group_pointer);
@@ -491,6 +497,7 @@ _edje_edd_init(void)
491 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TABLE", count.TABLE, EET_T_INT); 497 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TABLE", count.TABLE, EET_T_INT);
492 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.EXTERNAL", count.EXTERNAL, EET_T_INT); 498 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.EXTERNAL", count.EXTERNAL, EET_T_INT);
493 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.SPACER", count.SPACER, EET_T_INT); 499 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.SPACER", count.SPACER, EET_T_INT);
500 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.SNAPSHOT", count.SNAPSHOT, EET_T_INT);
494 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.MESH_NODE", count.MESH_NODE, EET_T_INT); 501 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.MESH_NODE", count.MESH_NODE, EET_T_INT);
495 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.LIGHT", count.LIGHT, EET_T_INT); 502 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.LIGHT", count.LIGHT, EET_T_INT);
496 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.CAMERA", count.CAMERA, EET_T_INT); 503 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.CAMERA", count.CAMERA, EET_T_INT);
@@ -865,6 +872,14 @@ _edje_edd_init(void)
865 EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_spacer, Edje_Part_Description_Common); 872 EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_spacer, Edje_Part_Description_Common);
866 873
867 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Common); 874 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Common);
875 eddc.func.mem_free = mem_free_snapshot;
876 eddc.func.mem_alloc = mem_alloc_snapshot;
877 _edje_edd_edje_part_description_snapshot =
878 eet_data_descriptor_file_new(&eddc);
879 EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_snapshot, Edje_Part_Description_Common);
880
881
882 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Common);
868 eddc.func.mem_free = mem_free_swallow; 883 eddc.func.mem_free = mem_free_swallow;
869 eddc.func.mem_alloc = mem_alloc_swallow; 884 eddc.func.mem_alloc = mem_alloc_swallow;
870 _edje_edd_edje_part_description_swallow = 885 _edje_edd_edje_part_description_swallow =
@@ -1117,6 +1132,7 @@ _edje_edd_init(void)
1117 EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_rectangle); 1132 EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_rectangle);
1118 EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_swallow); 1133 EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_swallow);
1119 EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_group); 1134 EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_group);
1135 EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_snapshot);
1120 EDJE_DEFINE_POINTER_TYPE(Part_Description_Image, part_description_image); 1136 EDJE_DEFINE_POINTER_TYPE(Part_Description_Image, part_description_image);
1121 EDJE_DEFINE_POINTER_TYPE(Part_Description_Proxy, part_description_proxy); 1137 EDJE_DEFINE_POINTER_TYPE(Part_Description_Proxy, part_description_proxy);
1122 EDJE_DEFINE_POINTER_TYPE(Part_Description_Text, part_description_text); 1138 EDJE_DEFINE_POINTER_TYPE(Part_Description_Text, part_description_text);
@@ -1135,6 +1151,7 @@ _edje_edd_init(void)
1135 1151
1136 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "spacer", _edje_edd_edje_part_description_spacer); 1152 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "spacer", _edje_edd_edje_part_description_spacer);
1137 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "rectangle", _edje_edd_edje_part_description_rectangle); 1153 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "rectangle", _edje_edd_edje_part_description_rectangle);
1154 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "snapshot", _edje_edd_edje_part_description_snapshot);
1138 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "swallow", _edje_edd_edje_part_description_swallow); 1155 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "swallow", _edje_edd_edje_part_description_swallow);
1139 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "group", _edje_edd_edje_part_description_group); 1156 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "group", _edje_edd_edje_part_description_group);
1140 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "image", _edje_edd_edje_part_description_image); 1157 EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "image", _edje_edd_edje_part_description_image);
@@ -1162,6 +1179,7 @@ _edje_edd_init(void)
1162 _edje_edd_edje_part_description_variant_list = eet_data_descriptor_file_new(&eddc); 1179 _edje_edd_edje_part_description_variant_list = eet_data_descriptor_file_new(&eddc);
1163 1180
1164 EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "rectangle", rectangle); 1181 EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "rectangle", rectangle);
1182 EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "snapshot", snapshot);
1165 EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "spacer", spacer); 1183 EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "spacer", spacer);
1166 EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "swallow", swallow); 1184 EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "swallow", swallow);
1167 EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "group", group); 1185 EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "group", group);
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 6f29897a32..2ab9862b8b 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -710,7 +710,10 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
710 710
711 case EDJE_PART_TYPE_PROXY: 711 case EDJE_PART_TYPE_PROXY:
712 case EDJE_PART_TYPE_IMAGE: 712 case EDJE_PART_TYPE_IMAGE:
713 case EDJE_PART_TYPE_SNAPSHOT:
713 rp->object = evas_object_image_add(ed->base->evas); 714 rp->object = evas_object_image_add(ed->base->evas);
715 if (ep->type == EDJE_PART_TYPE_SNAPSHOT)
716 evas_object_image_snapshot_set(rp->object, EINA_TRUE);
714 break; 717 break;
715 718
716 case EDJE_PART_TYPE_TEXT: 719 case EDJE_PART_TYPE_TEXT:
@@ -1958,6 +1961,8 @@ case EDJE_PART_TYPE_##Type: eina_mempool_free(Ce->mp.Type, Desc); \
1958 FREE_POOL(BOX, ce, desc); 1961 FREE_POOL(BOX, ce, desc);
1959 FREE_POOL(TABLE, ce, desc); 1962 FREE_POOL(TABLE, ce, desc);
1960 FREE_POOL(EXTERNAL, ce, desc); 1963 FREE_POOL(EXTERNAL, ce, desc);
1964 FREE_POOL(SNAPSHOT, ce, desc);
1965 FREE_POOL(SPACER, ce, desc);
1961 } 1966 }
1962} 1967}
1963 1968
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index e629923596..8fec707968 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -837,7 +837,8 @@ struct _Edje_Limit
837 TYPE EXTERNAL; \ 837 TYPE EXTERNAL; \
838 TYPE MESH_NODE; \ 838 TYPE MESH_NODE; \
839 TYPE LIGHT; \ 839 TYPE LIGHT; \
840 TYPE CAMERA; 840 TYPE CAMERA; \
841 TYPE SNAPSHOT;
841 842
842struct _Edje_Part_Collection_Directory_Entry 843struct _Edje_Part_Collection_Directory_Entry
843{ 844{
@@ -2239,6 +2240,7 @@ EAPI extern Eina_Mempool *_emp_SPACER;
2239EAPI extern Eina_Mempool *_emp_MESH_NODE; 2240EAPI extern Eina_Mempool *_emp_MESH_NODE;
2240EAPI extern Eina_Mempool *_emp_LIGHT; 2241EAPI extern Eina_Mempool *_emp_LIGHT;
2241EAPI extern Eina_Mempool *_emp_CAMERA; 2242EAPI extern Eina_Mempool *_emp_CAMERA;
2243EAPI extern Eina_Mempool *_emp_SNAPSHOT;
2242EAPI extern Eina_Mempool *_emp_part; 2244EAPI extern Eina_Mempool *_emp_part;
2243 2245
2244void _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2, FLOAT_T v3, FLOAT_T v4); 2246void _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2, FLOAT_T v3, FLOAT_T v4);
diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo
index 53c9076bcf..58a7baf524 100644
--- a/src/lib/evas/canvas/evas_image.eo
+++ b/src/lib/evas/canvas/evas_image.eo
@@ -784,6 +784,28 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Gfx.Fill, Efl.Gfx.View,
784 Default is #EVAS_IMAGE_ORIENT_NONE. */ 784 Default is #EVAS_IMAGE_ORIENT_NONE. */
785 } 785 }
786 } 786 }
787 @property snapshot {
788 set {
789 /*@
790 The content below the Evas_Object_Image will be rendered inside it and
791 you can reuse it as a source for any kind of effect.
792
793 @since 1.15
794 */
795 }
796 get {
797 /*@
798 Determine wether the Evas_Object_Image replicate the content of the
799 canvas below.
800
801 @return @c EINA_TRUE if it does, @c EINA_FALSE if it doesn't.
802 @since 1.15
803 */
804 }
805 values {
806 s: bool; /*@ Wether to put the content of the canvas below inside the Evas_Object_Image. */
807 }
808 }
787 preload_begin { 809 preload_begin {
788 /*@ Begin preloading an image object's image data in the background */ 810 /*@ Begin preloading an image object's image data in the background */
789 legacy: null; 811 legacy: null;
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index e20f748941..5e7e6ee242 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -175,7 +175,7 @@ _evas_canvas_eo_base_constructor(Eo *eo_obj, Evas_Public_Data *e)
175 175
176#define EVAS_ARRAY_SET(E, Array) \ 176#define EVAS_ARRAY_SET(E, Array) \
177 eina_array_step_set(&E->Array, sizeof (E->Array), \ 177 eina_array_step_set(&E->Array, sizeof (E->Array), \
178 ((1024 * sizeof (void*)) - sizeof (E->Array)) / sizeof (void*)); 178 ((1024 * sizeof (void*)) - sizeof (E->Array)) / sizeof (void*));
179 179
180 EVAS_ARRAY_SET(e, delete_objects); 180 EVAS_ARRAY_SET(e, delete_objects);
181 EVAS_ARRAY_SET(e, active_objects); 181 EVAS_ARRAY_SET(e, active_objects);
@@ -184,6 +184,7 @@ _evas_canvas_eo_base_constructor(Eo *eo_obj, Evas_Public_Data *e)
184 EVAS_ARRAY_SET(e, pending_objects); 184 EVAS_ARRAY_SET(e, pending_objects);
185 EVAS_ARRAY_SET(e, obscuring_objects); 185 EVAS_ARRAY_SET(e, obscuring_objects);
186 EVAS_ARRAY_SET(e, temporary_objects); 186 EVAS_ARRAY_SET(e, temporary_objects);
187 EVAS_ARRAY_SET(e, snapshot_objects);
187 EVAS_ARRAY_SET(e, clip_changes); 188 EVAS_ARRAY_SET(e, clip_changes);
188 EVAS_ARRAY_SET(e, scie_unref_queue); 189 EVAS_ARRAY_SET(e, scie_unref_queue);
189 EVAS_ARRAY_SET(e, image_unref_queue); 190 EVAS_ARRAY_SET(e, image_unref_queue);
@@ -300,6 +301,7 @@ _evas_canvas_eo_base_destructor(Eo *eo_e, Evas_Public_Data *e)
300 eina_array_flush(&e->pending_objects); 301 eina_array_flush(&e->pending_objects);
301 eina_array_flush(&e->obscuring_objects); 302 eina_array_flush(&e->obscuring_objects);
302 eina_array_flush(&e->temporary_objects); 303 eina_array_flush(&e->temporary_objects);
304 eina_array_flush(&e->snapshot_objects);
303 eina_array_flush(&e->clip_changes); 305 eina_array_flush(&e->clip_changes);
304 eina_array_flush(&e->scie_unref_queue); 306 eina_array_flush(&e->scie_unref_queue);
305 eina_array_flush(&e->image_unref_queue); 307 eina_array_flush(&e->image_unref_queue);
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 8956f815bf..2f8561f219 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -69,6 +69,8 @@ struct _Evas_Object_Image_Pixels
69 69
70 Evas_Video_Surface video; 70 Evas_Video_Surface video;
71 unsigned int video_caps; 71 unsigned int video_caps;
72
73 int surface_w, surface_h; /* used by snapshot feature */
72}; 74};
73 75
74struct _Evas_Object_Image_State 76struct _Evas_Object_Image_State
@@ -233,7 +235,7 @@ static const Evas_Object_Image_Load_Opts default_load_opts = {
233}; 235};
234 236
235static const Evas_Object_Image_Pixels default_pixels = { 237static const Evas_Object_Image_Pixels default_pixels = {
236 NULL, { NULL, NULL }, { 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, ~0x0 238 NULL, { NULL, NULL }, { 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, ~0x0, 0, 0
237}; 239};
238 240
239static const Evas_Object_Image_State default_state = { 241static const Evas_Object_Image_State default_state = {
@@ -3301,6 +3303,14 @@ _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
3301 uvw = imagew; 3303 uvw = imagew;
3302 uvh = imageh; 3304 uvh = imageh;
3303 } 3305 }
3306 else if (obj->cur->snapshot)
3307 {
3308 pixels = o->engine_data;
3309 imagew = o->pixels->surface_w;
3310 imageh = o->pixels->surface_h;
3311 uvw = imagew;
3312 uvh = imageh;
3313 }
3304 else if (!o->cur->source) 3314 else if (!o->cur->source)
3305 { 3315 {
3306 pixels = evas_process_dirty_pixels(eo_obj, obj, o, output, surface, o->engine_data); 3316 pixels = evas_process_dirty_pixels(eo_obj, obj, o, output, surface, o->engine_data);
@@ -3322,6 +3332,7 @@ _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
3322 ((Evas_Image_Data *)eo_data_scope_get(o->cur->source, MY_CLASS))->engine_data) 3332 ((Evas_Image_Data *)eo_data_scope_get(o->cur->source, MY_CLASS))->engine_data)
3323 { 3333 {
3324 Evas_Image_Data *oi; 3334 Evas_Image_Data *oi;
3335
3325 oi = eo_data_scope_get(o->cur->source, MY_CLASS); 3336 oi = eo_data_scope_get(o->cur->source, MY_CLASS);
3326 pixels = oi->engine_data; 3337 pixels = oi->engine_data;
3327 imagew = oi->cur->image.w; 3338 imagew = oi->cur->image.w;
@@ -4738,7 +4749,53 @@ _evas_object_image_video_overlay_do(Evas_Object *eo_obj)
4738 o->delayed.video_hide = EINA_FALSE; 4749 o->delayed.video_hide = EINA_FALSE;
4739} 4750}
4740 4751
4741/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ 4752static void
4753_evas_image_snapshot_set(Eo *eo, Evas_Image_Data *pd EINA_UNUSED, Eina_Bool s)
4754{
4755 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo, EVAS_OBJECT_CLASS);
4756
4757 if (obj->cur->snapshot == s) return ;
4758
4759 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
4760 state_write->snapshot = !!s;
4761 EINA_COW_STATE_WRITE_END(obj, state_write, cur);
4762}
4763
4764static Eina_Bool
4765_evas_image_snapshot_get(Eo *eo, Evas_Image_Data *pd EINA_UNUSED)
4766{
4767 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo, EVAS_OBJECT_CLASS);
4768
4769 return obj->cur->snapshot;
4770}
4771
4772void *
4773_evas_object_image_surface_get(Evas_Object *eo, Evas_Object_Protected_Data *obj)
4774{
4775 Evas_Image_Data *pd = eo_data_scope_get(eo, EVAS_IMAGE_CLASS);
4776
4777 if (pd->engine_data &&
4778 pd->pixels->surface_w == obj->cur->geometry.w &&
4779 pd->pixels->surface_h == obj->cur->geometry.h)
4780 return pd->engine_data;
4781
4782 if (pd->engine_data)
4783 ENFN->image_free(ENDT, pd->engine_data);
4784
4785 // FIXME: alpha forced to 1 for now, need to figure out Evas alpha here
4786 EINA_COW_PIXEL_WRITE_BEGIN(pd, pixi_write)
4787 {
4788 pd->engine_data = ENFN->image_map_surface_new(ENDT,
4789 obj->cur->geometry.w,
4790 obj->cur->geometry.h,
4791 1);
4792 pixi_write->surface_w = obj->cur->geometry.w;
4793 pixi_write->surface_h = obj->cur->geometry.h;
4794 }
4795 EINA_COW_PIXEL_WRITE_END(pd, pixi_write);
4796
4797 return pd->engine_data;
4798}
4742 4799
4743EAPI void 4800EAPI void
4744evas_object_image_file_set(Eo *obj, const char *file, const char *key) 4801evas_object_image_file_set(Eo *obj, const char *file, const char *key)
@@ -4811,3 +4868,5 @@ _evas_image_efl_gfx_filter_program_set(Eo *obj, Evas_Image_Data *pd EINA_UNUSED,
4811} 4868}
4812 4869
4813#include "canvas/evas_image.eo.c" 4870#include "canvas/evas_image.eo.c"
4871
4872/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index 3de8510d12..91d6761b41 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 = {
30 NULL, { 0, 0, 0, 0 }, 30 NULL, { 0, 0, 0, 0 },
31 { { 0, 0, 0, 0, 0, 0, 0, 0, EINA_FALSE, EINA_FALSE } }, 31 { { 0, 0, 0, 0, 0, 0, 0, 0, EINA_FALSE, EINA_FALSE } },
32 { 255, 255, 255, 255 }, 32 { 255, 255, 255, 255 },
33 1.0, 0, EVAS_RENDER_BLEND, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE 33 1.0, 0, EVAS_RENDER_BLEND, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE
34}; 34};
35static const Evas_Object_Filter_Data default_filter = { 35static const Evas_Object_Filter_Data default_filter = {
36 NULL, NULL, NULL, NULL, NULL, NULL, { { "default", 0.0 }, { "default", 0.0 }, 0.0 }, EINA_FALSE, EINA_FALSE 36 NULL, NULL, NULL, NULL, NULL, NULL, { { "default", 0.0 }, { "default", 0.0 }, 0.0 }, EINA_FALSE, EINA_FALSE
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 80faf6f3c5..0618e1aeb6 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -496,6 +496,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
496 Eina_Array *restack_objects, 496 Eina_Array *restack_objects,
497 Eina_Array *delete_objects, 497 Eina_Array *delete_objects,
498 Eina_Array *render_objects, 498 Eina_Array *render_objects,
499 Eina_Array *snapshot_objects,
499 int restack, 500 int restack,
500 int *redraw_all, 501 int *redraw_all,
501 Eina_Bool mapped_parent, 502 Eina_Bool mapped_parent,
@@ -538,6 +539,8 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
538 539
539 if ((!mapped_parent) && ((is_active) || (obj->delete_me != 0))) 540 if ((!mapped_parent) && ((is_active) || (obj->delete_me != 0)))
540 OBJ_ARRAY_PUSH(active_objects, obj); 541 OBJ_ARRAY_PUSH(active_objects, obj);
542 if (is_active && obj->cur->snapshot)
543 OBJ_ARRAY_PUSH(snapshot_objects, obj);
541 544
542#ifdef REND_DBG 545#ifdef REND_DBG
543 if (!is_active) 546 if (!is_active)
@@ -596,6 +599,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
596 restack_objects, 599 restack_objects,
597 delete_objects, 600 delete_objects,
598 render_objects, 601 render_objects,
602 snapshot_objects,
599 obj->restack, 603 obj->restack,
600 redraw_all, 604 redraw_all,
601 EINA_TRUE, 605 EINA_TRUE,
@@ -653,6 +657,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
653 restack_objects, 657 restack_objects,
654 delete_objects, 658 delete_objects,
655 render_objects, 659 render_objects,
660 snapshot_objects,
656 obj->restack, 661 obj->restack,
657 redraw_all, 662 redraw_all,
658 mapped_parent, 663 mapped_parent,
@@ -731,6 +736,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
731 restack_objects, 736 restack_objects,
732 delete_objects, 737 delete_objects,
733 render_objects, 738 render_objects,
739 snapshot_objects,
734 restack, 740 restack,
735 redraw_all, 741 redraw_all,
736 mapped_parent, 742 mapped_parent,
@@ -798,6 +804,7 @@ _evas_render_phase1_process(Evas_Public_Data *e,
798 Eina_Array *restack_objects, 804 Eina_Array *restack_objects,
799 Eina_Array *delete_objects, 805 Eina_Array *delete_objects,
800 Eina_Array *render_objects, 806 Eina_Array *render_objects,
807 Eina_Array *snapshot_objects,
801 int *redraw_all) 808 int *redraw_all)
802{ 809{
803 Evas_Layer *lay; 810 Evas_Layer *lay;
@@ -812,7 +819,8 @@ _evas_render_phase1_process(Evas_Public_Data *e,
812 { 819 {
813 clean_them |= _evas_render_phase1_object_process 820 clean_them |= _evas_render_phase1_object_process
814 (e, obj->object, active_objects, restack_objects, delete_objects, 821 (e, obj->object, active_objects, restack_objects, delete_objects,
815 render_objects, 0, redraw_all, EINA_FALSE, EINA_FALSE, 2); 822 render_objects, snapshot_objects, 0, redraw_all,
823 EINA_FALSE, EINA_FALSE, 2);
816 } 824 }
817 } 825 }
818 RD(0, " ---]\n"); 826 RD(0, " ---]\n");
@@ -891,6 +899,7 @@ clean_stuff:
891 OBJS_ARRAY_CLEAN(&e->render_objects); 899 OBJS_ARRAY_CLEAN(&e->render_objects);
892 OBJS_ARRAY_CLEAN(&e->restack_objects); 900 OBJS_ARRAY_CLEAN(&e->restack_objects);
893 OBJS_ARRAY_CLEAN(&e->delete_objects); 901 OBJS_ARRAY_CLEAN(&e->delete_objects);
902 OBJS_ARRAY_CLEAN(&e->snapshot_objects);
894 e->invalidate = EINA_TRUE; 903 e->invalidate = EINA_TRUE;
895 return; 904 return;
896 } 905 }
@@ -934,7 +943,7 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj)
934 Evas_Object *video_parent = NULL; 943 Evas_Object *video_parent = NULL;
935 Eina_Rectangle zone; 944 Eina_Rectangle zone;
936 Evas_Coord xc1, yc1, xc2, yc2; 945 Evas_Coord xc1, yc1, xc2, yc2;
937 unsigned int i; 946 int i;
938 Eina_Bool nooverlay; 947 Eina_Bool nooverlay;
939 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 948 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
940 Evas_Object_Protected_Data *tmp = NULL; 949 Evas_Object_Protected_Data *tmp = NULL;
@@ -2007,7 +2016,7 @@ end:
2007} 2016}
2008 2017
2009static void 2018static void
2010_evas_render_cutout_add(Evas_Public_Data *e, Evas_Object_Protected_Data *obj, int off_x, int off_y) 2019_evas_render_cutout_add(Evas_Public_Data *e, void *context, Evas_Object_Protected_Data *obj, int off_x, int off_y)
2011{ 2020{
2012 if (evas_object_is_source_invisible(obj->object, obj)) return; 2021 if (evas_object_is_source_invisible(obj->object, obj)) return;
2013 if (evas_object_is_opaque(obj->object, obj)) 2022 if (evas_object_is_opaque(obj->object, obj))
@@ -2041,7 +2050,7 @@ _evas_render_cutout_add(Evas_Public_Data *e, Evas_Object_Protected_Data *obj, in
2041 } 2050 }
2042 } 2051 }
2043 e->engine.func->context_cutout_add 2052 e->engine.func->context_cutout_add
2044 (e->engine.data.output, e->engine.data.context, 2053 (e->engine.data.output, context,
2045 cox + off_x, coy + off_y, cow, coh); 2054 cox + off_x, coy + off_y, cow, coh);
2046 } 2055 }
2047 else 2056 else
@@ -2061,7 +2070,7 @@ _evas_render_cutout_add(Evas_Public_Data *e, Evas_Object_Protected_Data *obj, in
2061 obj->cur->cache.clip.w, 2070 obj->cur->cache.clip.w,
2062 obj->cur->cache.clip.h); 2071 obj->cur->cache.clip.h);
2063 e->engine.func->context_cutout_add 2072 e->engine.func->context_cutout_add
2064 (e->engine.data.output, e->engine.data.context, 2073 (e->engine.data.output, context,
2065 obx, oby, obw, obh); 2074 obx, oby, obw, obh);
2066 } 2075 }
2067 } 2076 }
@@ -2122,6 +2131,179 @@ _cb_always_call(Evas *eo_e, Evas_Callback_Type type, void *event_info)
2122} 2131}
2123 2132
2124static Eina_Bool 2133static Eina_Bool
2134evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e,
2135 void *surface, void *context,
2136 Evas_Object_Protected_Data *top,
2137 int ux, int uy, int uw, int uh,
2138 int cx, int cy, int cw, int ch,
2139 int fx, int fy,
2140 Eina_Bool alpha,
2141 Eina_Bool do_async,
2142 unsigned int *offset)
2143{
2144 Evas_Object *eo_obj;
2145 Evas_Object_Protected_Data *obj;
2146 int off_x, off_y;
2147 unsigned int i, j;
2148 Eina_Bool clean_them = EINA_FALSE;
2149
2150 eina_evlog("+render_setup", eo_e, 0.0, NULL);
2151 RD(0, " [--- UPDATE %i %i %ix%i\n", ux, uy, uw, uh);
2152
2153 off_x = cx - ux;
2154 off_y = cy - uy;
2155 /* build obscuring objects list (in order from bottom to top) */
2156 if (alpha)
2157 {
2158 e->engine.func->context_clip_set(e->engine.data.output,
2159 context,
2160 ux + off_x, uy + off_y, uw, uh);
2161 }
2162 for (i = 0; i < e->obscuring_objects.count; ++i)
2163 {
2164 obj = (Evas_Object_Protected_Data *)eina_array_data_get
2165 (&e->obscuring_objects, i);
2166 if (evas_object_is_in_output_rect(obj->object, obj, ux - fx, uy - fy, uw, uh))
2167 {
2168 OBJ_ARRAY_PUSH(&e->temporary_objects, obj);
2169
2170 if (obj == top) break;
2171
2172 /* reset the background of the area if needed (using cutout and engine alpha flag to help) */
2173 if (alpha)
2174 _evas_render_cutout_add(e, context, obj, off_x + fx, off_y + fy);
2175 }
2176 }
2177 if (alpha)
2178 {
2179 e->engine.func->context_color_set(e->engine.data.output,
2180 context,
2181 0, 0, 0, 0);
2182 e->engine.func->context_multiplier_unset
2183 (e->engine.data.output, e->engine.data.context);
2184 e->engine.func->context_render_op_set(e->engine.data.output,
2185 context,
2186 EVAS_RENDER_COPY);
2187 e->engine.func->rectangle_draw(e->engine.data.output,
2188 context, surface,
2189 cx, cy, cw, ch, do_async);
2190 e->engine.func->context_cutout_clear(e->engine.data.output, context);
2191 e->engine.func->context_clip_unset(e->engine.data.output, context);
2192 }
2193 eina_evlog("-render_setup", eo_e, 0.0, NULL);
2194
2195 eina_evlog("+render_objects", eo_e, 0.0, NULL);
2196 /* render all object that intersect with rect */
2197 for (i = 0; i < e->active_objects.count; ++i)
2198 {
2199 obj = eina_array_data_get(&e->active_objects, i);
2200 eo_obj = obj->object;
2201
2202 if (obj == top) break;
2203
2204 /* if it's in our outpout rect and it doesn't clip anything */
2205 RD(0, " OBJ: [%p", obj);
2206 IFRD(0, " '%s'", obj->name);
2207 RD(0, "] '%s' %i %i %ix%i\n", obj->type, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
2208 if ((evas_object_is_in_output_rect(eo_obj, obj, ux - fx, uy - fy, uw, uh) ||
2209 (obj->is_smart)) &&
2210 (!obj->clip.clipees) &&
2211 (obj->cur->visible) &&
2212 (!obj->delete_me) &&
2213 (obj->cur->cache.clip.visible) &&
2214 // (!obj->is_smart) &&
2215 ((obj->cur->color.a > 0 || obj->cur->render_op != EVAS_RENDER_BLEND)))
2216 {
2217 int x, y, w, h;
2218
2219 RD(0, " DRAW (vis: %i, a: %i, clipees: %p)\n", obj->cur->visible, obj->cur->color.a, obj->clip.clipees);
2220 if ((e->temporary_objects.count > *offset) &&
2221 (eina_array_data_get(&e->temporary_objects, *offset) == obj))
2222 (*offset)++;
2223 x = cx; y = cy; w = cw; h = ch;
2224 if (((w > 0) && (h > 0)) || (obj->is_smart))
2225 {
2226 Evas_Object_Protected_Data *prev_mask = NULL;
2227 Evas_Object_Protected_Data *mask = NULL;
2228
2229 if (!obj->is_smart)
2230 {
2231 RECTS_CLIP_TO_RECT(x, y, w, h,
2232 obj->cur->cache.clip.x + off_x + fx,
2233 obj->cur->cache.clip.y + off_y + fy,
2234 obj->cur->cache.clip.w,
2235 obj->cur->cache.clip.h);
2236 }
2237
2238 e->engine.func->context_clip_set(e->engine.data.output,
2239 context,
2240 x, y, w, h);
2241
2242 /* Clipper masks */
2243 if (_evas_render_object_is_mask(obj->cur->clipper))
2244 mask = obj->cur->clipper; // main object clipped by this mask
2245 else if (obj->clip.mask)
2246 mask = obj->clip.mask; // propagated clip
2247 prev_mask = obj->clip.prev_mask;
2248
2249 if (mask)
2250 {
2251 if (mask->mask->redraw || !mask->mask->surface)
2252 evas_render_mask_subrender(obj->layer->evas, mask, prev_mask, 4);
2253
2254 if (mask->mask->surface)
2255 {
2256 e->engine.func->context_clip_image_set
2257 (e->engine.data.output,
2258 context,
2259 mask->mask->surface,
2260 mask->cur->geometry.x + off_x,
2261 mask->cur->geometry.y + off_y,
2262 e, do_async);
2263 }
2264 }
2265
2266#if 1 /* FIXME: this can slow things down... figure out optimum... coverage */
2267 for (j = *offset; j < e->temporary_objects.count; ++j)
2268 {
2269 Evas_Object_Protected_Data *obj2;
2270
2271 obj2 = (Evas_Object_Protected_Data *)eina_array_data_get
2272 (&e->temporary_objects, j);
2273
2274 if (obj2 == top) break;
2275
2276 _evas_render_cutout_add(e, context, obj2, off_x + fx, off_y + fy);
2277 }
2278#endif
2279 clean_them |= evas_render_mapped(e, eo_obj, obj, context,
2280 surface, off_x + fx,
2281 off_y + fy, 0,
2282 cx, cy, cw, ch,
2283 NULL, 4,
2284 EINA_FALSE,
2285 do_async);
2286 e->engine.func->context_cutout_clear(e->engine.data.output,
2287 context);
2288
2289 if (mask)
2290 {
2291 e->engine.func->context_clip_image_unset
2292 (e->engine.data.output, context);
2293 }
2294 }
2295 }
2296 }
2297
2298 eina_evlog("-render_objects", eo_e, 0.0, NULL);
2299 /* free obscuring objects list */
2300 OBJS_ARRAY_CLEAN(&e->temporary_objects);
2301 RD(0, " ---]\n");
2302
2303 return clean_them;
2304}
2305
2306static Eina_Bool
2125evas_render_updates_internal(Evas *eo_e, 2307evas_render_updates_internal(Evas *eo_e,
2126 unsigned char make_updates, 2308 unsigned char make_updates,
2127 unsigned char do_draw, 2309 unsigned char do_draw,
@@ -2133,17 +2315,14 @@ evas_render_updates_internal(Evas *eo_e,
2133 Evas_Object_Protected_Data *obj; 2315 Evas_Object_Protected_Data *obj;
2134 Evas_Public_Data *e; 2316 Evas_Public_Data *e;
2135 Eina_List *ll; 2317 Eina_List *ll;
2136 void *surface;
2137 Eina_Bool clean_them = EINA_FALSE; 2318 Eina_Bool clean_them = EINA_FALSE;
2138 Eina_Bool alpha; 2319 Eina_Bool alpha;
2139 Eina_Rectangle *r; 2320 Eina_Rectangle *r;
2140 int ux, uy, uw, uh; 2321 unsigned int i;
2141 int cx, cy, cw, ch;
2142 unsigned int i, j;
2143 int redraw_all = 0; 2322 int redraw_all = 0;
2144 Eina_Bool haveup = 0; 2323 Evas_Render_Mode render_mode = !do_async ?
2145 Evas_Render_Mode render_mode = EVAS_RENDER_MODE_UNDEF; 2324 EVAS_RENDER_MODE_SYNC :
2146 2325 EVAS_RENDER_MODE_ASYNC_INIT;
2147 Eina_Rectangle clip_rect; 2326 Eina_Rectangle clip_rect;
2148 2327
2149 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS); 2328 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
@@ -2201,6 +2380,7 @@ evas_render_updates_internal(Evas *eo_e,
2201 &e->restack_objects, 2380 &e->restack_objects,
2202 &e->delete_objects, 2381 &e->delete_objects,
2203 &e->render_objects, 2382 &e->render_objects,
2383 &e->snapshot_objects,
2204 &redraw_all); 2384 &redraw_all);
2205 eina_evlog("-render_phase1", eo_e, 0.0, NULL); 2385 eina_evlog("-render_phase1", eo_e, 0.0, NULL);
2206 } 2386 }
@@ -2334,6 +2514,25 @@ evas_render_updates_internal(Evas *eo_e,
2334 e->engine.func->output_redraws_rect_add(e->engine.data.output, 0, 0, 2514 e->engine.func->output_redraws_rect_add(e->engine.data.output, 0, 0,
2335 e->output.w, e->output.h); 2515 e->output.w, e->output.h);
2336 } 2516 }
2517
2518 // Add redraw for all snapshot object due to potential use of pixels outside
2519 // of the update area by filters.
2520 // The side effect is that it also fix rendering of partial update of filter...
2521 // As they are never partially updated anymore !
2522
2523 // FIXME: don't add redraw rect for snapshot with no filter applied on
2524 // Also damage the filter object that use a snapshot.
2525 for (i = 0; i < e->snapshot_objects.count; i++)
2526 {
2527 obj = (Evas_Object_Protected_Data *)eina_array_data_get(&e->snapshot_objects, i);
2528
2529 if (evas_object_is_visible(obj->object, obj))
2530 e->engine.func->output_redraws_rect_add(e->engine.data.output,
2531 obj->cur->geometry.x,
2532 obj->cur->geometry.y,
2533 obj->cur->geometry.w,
2534 obj->cur->geometry.h);
2535 }
2337 eina_evlog("-render_phase4", eo_e, 0.0, NULL); 2536 eina_evlog("-render_phase4", eo_e, 0.0, NULL);
2338 2537
2339 /* phase 5. add obscures */ 2538 /* phase 5. add obscures */
@@ -2370,9 +2569,15 @@ evas_render_updates_internal(Evas *eo_e,
2370 eina_evlog("+render_phase6", eo_e, 0.0, NULL); 2569 eina_evlog("+render_phase6", eo_e, 0.0, NULL);
2371 if (do_draw) 2570 if (do_draw)
2372 { 2571 {
2572 Render_Updates *ru;
2573 void *surface;
2574 int ux, uy, uw, uh;
2575 int cx, cy, cw, ch;
2373 unsigned int offset = 0; 2576 unsigned int offset = 0;
2374 int fx = e->framespace.x; 2577 int fx = e->framespace.x;
2375 int fy = e->framespace.y; 2578 int fy = e->framespace.y;
2579 int j;
2580 Eina_Bool haveup = EINA_FALSE;
2376 2581
2377 if (do_async) _evas_render_busy_begin(); 2582 if (do_async) _evas_render_busy_begin();
2378 eina_evlog("+render_surface", eo_e, 0.0, NULL); 2583 eina_evlog("+render_surface", eo_e, 0.0, NULL);
@@ -2382,11 +2587,54 @@ evas_render_updates_internal(Evas *eo_e,
2382 &ux, &uy, &uw, &uh, 2587 &ux, &uy, &uw, &uh,
2383 &cx, &cy, &cw, &ch))) 2588 &cx, &cy, &cw, &ch)))
2384 { 2589 {
2385 int off_x, off_y; 2590 haveup = EINA_TRUE;
2386 Render_Updates *ru; 2591
2592 /* phase 6.1 render every snapshot that needs to be updated
2593 for this part of the screen */
2594 for (j = e->snapshot_objects.count - 1; j >= 0; j--)
2595 {
2596 Eina_Rectangle output, cr, ur;
2597
2598 obj = (Evas_Object_Protected_Data *)eina_array_data_get(&e->snapshot_objects, j);
2599
2600 EINA_RECTANGLE_SET(&output,
2601 obj->cur->geometry.x,
2602 obj->cur->geometry.y,
2603 obj->cur->geometry.w,
2604 obj->cur->geometry.h);
2605 EINA_RECTANGLE_SET(&ur, ux, uy, uw, uh);
2606
2607 if (eina_rectangle_intersection(&ur, &output))
2608 {
2609 void *ctx;
2610 void *pseudo_canvas;
2611 unsigned int restore_offset = offset;
2612
2613 EINA_RECTANGLE_SET(&cr,
2614 ur.x - output.x, ur.y - output.y,
2615 ur.w, ur.h);
2616
2617 pseudo_canvas = _evas_object_image_surface_get(obj->object, obj);
2618
2619 ctx = e->engine.func->context_new(e->engine.data.output);
2620 clean_them |= evas_render_updates_internal_loop(eo_e, e, pseudo_canvas, ctx,
2621 obj,
2622 ur.x, ur.y, ur.w, ur.h,
2623 cr.x, cr.y, cr.w, cr.h,
2624 fx, fy, alpha,
2625 do_async,
2626 &offset);
2627 e->engine.func->context_free(e->engine.data.output, ctx);
2628
2629 // Force the object has changed for filter to take it into
2630 // account. It won't be in the pending object array.
2631 obj->changed = EINA_TRUE;
2632
2633 offset = restore_offset;
2634 }
2635 }
2387 2636
2388 eina_evlog("+render_setup", eo_e, 0.0, NULL); 2637 /* phase 6.2 render all the object on the target surface */
2389 RD(0, " [--- UPDATE %i %i %ix%i\n", ux, uy, uw, uh);
2390 if (do_async) 2638 if (do_async)
2391 { 2639 {
2392 ru = malloc(sizeof(*ru)); 2640 ru = malloc(sizeof(*ru));
@@ -2401,154 +2649,17 @@ evas_render_updates_internal(Evas *eo_e,
2401 2649
2402 NEW_RECT(rect, ux, uy, uw, uh); 2650 NEW_RECT(rect, ux, uy, uw, uh);
2403 if (rect) 2651 if (rect)
2404 e->render.updates = eina_list_append(e->render.updates, 2652 e->render.updates = eina_list_append(e->render.updates,
2405 rect); 2653 rect);
2406 }
2407 haveup = EINA_TRUE;
2408 off_x = cx - ux;
2409 off_y = cy - uy;
2410 /* build obscuring objects list (in order from bottom to top) */
2411 if (alpha)
2412 {
2413 e->engine.func->context_clip_set(e->engine.data.output,
2414 e->engine.data.context,
2415 ux + off_x, uy + off_y, uw, uh);
2416 }
2417 for (i = 0; i < e->obscuring_objects.count; ++i)
2418 {
2419 obj = (Evas_Object_Protected_Data *)eina_array_data_get
2420 (&e->obscuring_objects, i);
2421 if (evas_object_is_in_output_rect(obj->object, obj, ux - fx, uy - fy, uw, uh))
2422 {
2423 OBJ_ARRAY_PUSH(&e->temporary_objects, obj);
2424
2425 /* reset the background of the area if needed (using cutout and engine alpha flag to help) */
2426 if (alpha)
2427 _evas_render_cutout_add(e, obj, off_x + fx, off_y + fy);
2428 }
2429 } 2654 }
2430 if (alpha)
2431 {
2432 e->engine.func->context_color_set(e->engine.data.output,
2433 e->engine.data.context,
2434 0, 0, 0, 0);
2435 e->engine.func->context_multiplier_unset
2436 (e->engine.data.output, e->engine.data.context);
2437 e->engine.func->context_render_op_set(e->engine.data.output,
2438 e->engine.data.context,
2439 EVAS_RENDER_COPY);
2440 e->engine.func->rectangle_draw(e->engine.data.output,
2441 e->engine.data.context,
2442 surface,
2443 cx, cy, cw, ch, do_async);
2444 e->engine.func->context_cutout_clear(e->engine.data.output,
2445 e->engine.data.context);
2446 e->engine.func->context_clip_unset(e->engine.data.output,
2447 e->engine.data.context);
2448 }
2449 eina_evlog("-render_setup", eo_e, 0.0, NULL);
2450
2451 eina_evlog("+render_objects", eo_e, 0.0, NULL);
2452 /* render all object that intersect with rect */
2453 for (i = 0; i < e->active_objects.count; ++i)
2454 {
2455 obj = eina_array_data_get(&e->active_objects, i);
2456 eo_obj = obj->object;
2457
2458 /* if it's in our outpout rect and it doesn't clip anything */
2459 RD(0, " OBJ: [%p", obj);
2460 IFRD(obj->name, 0, " '%s'", obj->name);
2461 RD(0, "] '%s' %i %i %ix%i\n", obj->type, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
2462 if ((evas_object_is_in_output_rect(eo_obj, obj, ux - fx, uy - fy, uw, uh) ||
2463 (obj->is_smart)) &&
2464 (!obj->clip.clipees) &&
2465 (obj->cur->visible) &&
2466 (!obj->delete_me) &&
2467 (obj->cur->cache.clip.visible) &&
2468// (!obj->is_smart) &&
2469 ((obj->cur->color.a > 0 || obj->cur->render_op != EVAS_RENDER_BLEND)))
2470 {
2471 int x, y, w, h;
2472
2473 RD(0, " DRAW (vis: %i, a: %i, clipees: %p)\n", obj->cur->visible, obj->cur->color.a, obj->clip.clipees);
2474 if ((e->temporary_objects.count > offset) &&
2475 (eina_array_data_get(&e->temporary_objects, offset) == obj))
2476 offset++;
2477 x = cx; y = cy; w = cw; h = ch;
2478 if (((w > 0) && (h > 0)) || (obj->is_smart))
2479 {
2480 Evas_Object_Protected_Data *prev_mask = NULL;
2481 Evas_Object_Protected_Data *mask = NULL;
2482
2483 if (!obj->is_smart)
2484 {
2485 RECTS_CLIP_TO_RECT(x, y, w, h,
2486 obj->cur->cache.clip.x + off_x + fx,
2487 obj->cur->cache.clip.y + off_y + fy,
2488 obj->cur->cache.clip.w,
2489 obj->cur->cache.clip.h);
2490 }
2491
2492 e->engine.func->context_clip_set(e->engine.data.output,
2493 e->engine.data.context,
2494 x, y, w, h);
2495
2496 /* Clipper masks */
2497 if (_evas_render_object_is_mask(obj->cur->clipper))
2498 mask = obj->cur->clipper; // main object clipped by this mask
2499 else if (obj->clip.mask)
2500 mask = obj->clip.mask; // propagated clip
2501 prev_mask = obj->clip.prev_mask;
2502
2503 if (mask)
2504 {
2505 if (mask->mask->redraw || !mask->mask->surface)
2506 evas_render_mask_subrender(obj->layer->evas, mask, prev_mask, 4);
2507
2508 if (mask->mask->surface)
2509 {
2510 e->engine.func->context_clip_image_set
2511 (e->engine.data.output,
2512 e->engine.data.context,
2513 mask->mask->surface,
2514 mask->cur->geometry.x + off_x,
2515 mask->cur->geometry.y + off_y,
2516 e, do_async);
2517 }
2518 }
2519
2520#if 1 /* FIXME: this can slow things down... figure out optimum... coverage */
2521 for (j = offset; j < e->temporary_objects.count; ++j)
2522 {
2523 Evas_Object_Protected_Data *obj2;
2524 2655
2525 obj2 = (Evas_Object_Protected_Data *)eina_array_data_get 2656 clean_them |= evas_render_updates_internal_loop(eo_e, e, surface, e->engine.data.context,
2526 (&e->temporary_objects, j); 2657 NULL,
2527 _evas_render_cutout_add(e, obj2, off_x + fx, off_y + fy); 2658 ux, uy, uw, uh,
2528 }
2529#endif
2530 clean_them |= evas_render_mapped(e, eo_obj, obj, e->engine.data.context,
2531 surface, off_x + fx,
2532 off_y + fy, 0,
2533 cx, cy, cw, ch, 2659 cx, cy, cw, ch,
2534 NULL, 4, 2660 fx, fy, alpha,
2535 EINA_FALSE, 2661 do_async,
2536 do_async); 2662 &offset);
2537 e->engine.func->context_cutout_clear(e->engine.data.output,
2538 e->engine.data.context);
2539
2540 if (mask)
2541 {
2542 e->engine.func->context_clip_image_unset
2543 (e->engine.data.output, e->engine.data.context);
2544 }
2545 }
2546 }
2547 }
2548 eina_evlog("-render_objects", eo_e, 0.0, NULL);
2549
2550 if (!do_async) render_mode = EVAS_RENDER_MODE_SYNC;
2551 else render_mode = EVAS_RENDER_MODE_ASYNC_INIT;
2552 2663
2553 eina_evlog("+render_push", eo_e, 0.0, NULL); 2664 eina_evlog("+render_push", eo_e, 0.0, NULL);
2554 e->engine.func->output_redraws_next_update_push(e->engine.data.output, 2665 e->engine.func->output_redraws_next_update_push(e->engine.data.output,
@@ -2556,10 +2667,6 @@ evas_render_updates_internal(Evas *eo_e,
2556 ux, uy, uw, uh, 2667 ux, uy, uw, uh,
2557 render_mode); 2668 render_mode);
2558 eina_evlog("-render_push", eo_e, 0.0, NULL); 2669 eina_evlog("-render_push", eo_e, 0.0, NULL);
2559
2560 /* free obscuring objects list */
2561 OBJS_ARRAY_CLEAN(&e->temporary_objects);
2562 RD(0, " ---]\n");
2563 } 2670 }
2564 2671
2565 eina_evlog("+render_output_flush", eo_e, 0.0, NULL); 2672 eina_evlog("+render_output_flush", eo_e, 0.0, NULL);
@@ -2697,6 +2804,7 @@ evas_render_updates_internal(Evas *eo_e,
2697 OBJS_ARRAY_CLEAN(&e->render_objects); 2804 OBJS_ARRAY_CLEAN(&e->render_objects);
2698 OBJS_ARRAY_CLEAN(&e->restack_objects); 2805 OBJS_ARRAY_CLEAN(&e->restack_objects);
2699 OBJS_ARRAY_CLEAN(&e->temporary_objects); 2806 OBJS_ARRAY_CLEAN(&e->temporary_objects);
2807 OBJS_ARRAY_CLEAN(&e->snapshot_objects);
2700 eina_array_foreach(&e->clip_changes, _evas_clip_changes_free, NULL); 2808 eina_array_foreach(&e->clip_changes, _evas_clip_changes_free, NULL);
2701 eina_array_clean(&e->clip_changes); 2809 eina_array_clean(&e->clip_changes);
2702/* we should flush here and have a mempool system for this 2810/* we should flush here and have a mempool system for this
@@ -3103,6 +3211,8 @@ evas_render_invalidate(Evas *eo_e)
3103 OBJS_ARRAY_FLUSH(&e->restack_objects); 3211 OBJS_ARRAY_FLUSH(&e->restack_objects);
3104 OBJS_ARRAY_FLUSH(&e->delete_objects); 3212 OBJS_ARRAY_FLUSH(&e->delete_objects);
3105 3213
3214 OBJS_ARRAY_FLUSH(&e->snapshot_objects);
3215
3106 e->invalidate = EINA_TRUE; 3216 e->invalidate = EINA_TRUE;
3107} 3217}
3108 3218
diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x
index 4614737911..29cc7d9744 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -74,6 +74,9 @@ evas_object_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
74 if ((obj->cur->clipper && obj->cur->clipper->mask->is_mask) || 74 if ((obj->cur->clipper && obj->cur->clipper->mask->is_mask) ||
75 (obj->clip.mask)) 75 (obj->clip.mask))
76 return 0; 76 return 0;
77 /* Non masked snapshot are supposed to be opaque */
78 if (obj->cur->snapshot)
79 return 1;
77 if (obj->func->is_opaque) 80 if (obj->func->is_opaque)
78 return obj->func->is_opaque(eo_obj, obj, obj->private_data); 81 return obj->func->is_opaque(eo_obj, obj, obj->private_data);
79 return 1; 82 return 1;
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 01b43401a5..f4e019ee7a 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -808,6 +808,7 @@ struct _Evas_Public_Data
808 Eina_Array pending_objects; 808 Eina_Array pending_objects;
809 Eina_Array obscuring_objects; 809 Eina_Array obscuring_objects;
810 Eina_Array temporary_objects; 810 Eina_Array temporary_objects;
811 Eina_Array snapshot_objects;
811 Eina_Array clip_changes; 812 Eina_Array clip_changes;
812 Eina_Array scie_unref_queue; 813 Eina_Array scie_unref_queue;
813 Eina_Array image_unref_queue; 814 Eina_Array image_unref_queue;
@@ -1004,6 +1005,7 @@ struct _Evas_Object_Protected_State
1004 1005
1005 Eina_Bool cached_surface : 1; 1006 Eina_Bool cached_surface : 1;
1006 Eina_Bool parent_cached_surface : 1; 1007 Eina_Bool parent_cached_surface : 1;
1008 Eina_Bool snapshot : 1;
1007}; 1009};
1008 1010
1009struct _Evas_Object_Protected_Data 1011struct _Evas_Object_Protected_Data
@@ -1878,6 +1880,8 @@ void _evas_device_unref(Evas_Device *dev);
1878 1880
1879Eina_Bool evas_vg_loader_svg(Evas_Object *vg, const Eina_File *f, const char *key EINA_UNUSED); 1881Eina_Bool evas_vg_loader_svg(Evas_Object *vg, const Eina_File *f, const char *key EINA_UNUSED);
1880 1882
1883void *_evas_object_image_surface_get(Evas_Object *eo, Evas_Object_Protected_Data *obj);
1884
1881extern Eina_Cow *evas_object_proxy_cow; 1885extern Eina_Cow *evas_object_proxy_cow;
1882extern Eina_Cow *evas_object_map_cow; 1886extern Eina_Cow *evas_object_map_cow;
1883extern Eina_Cow *evas_object_state_cow; 1887extern Eina_Cow *evas_object_state_cow;