summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-04-14 15:21:52 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-08-05 15:12:33 +0200
commit2ebf315591e0554c308d762a5b7c1823649deb1d (patch)
treeb50f29d5617b8d611e34f475d3a265d59e2a7674
parent0d44b94248465a634720cce00ef9d477c8fb5b82 (diff)
evas: add a snapshot bool to Evas_Object_Image.
Snapshot object are rendering the content of the canvas below them into them. They can then be used for filter, map or proxy. Have fun !
-rw-r--r--src/lib/evas/canvas/evas_image.eo22
-rw-r--r--src/lib/evas/canvas/evas_object_image.c22
-rw-r--r--src/lib/evas/include/evas_private.h2
3 files changed, 45 insertions, 1 deletions
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_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 8956f815bf..32191fdabf 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -4738,7 +4738,25 @@ _evas_object_image_video_overlay_do(Evas_Object *eo_obj)
4738 o->delayed.video_hide = EINA_FALSE; 4738 o->delayed.video_hide = EINA_FALSE;
4739} 4739}
4740 4740
4741/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ 4741static void
4742_evas_image_snapshot_set(Eo *eo, Evas_Image_Data *pd EINA_UNUSED, Eina_Bool s)
4743{
4744 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo, EVAS_OBJECT_CLASS);
4745
4746 if (obj->cur->snapshot == s) return ;
4747
4748 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
4749 state_write->snapshot = !!s;
4750 EINA_COW_STATE_WRITE_END(obj, state_write, cur);
4751}
4752
4753static Eina_Bool
4754_evas_image_snapshot_get(Eo *eo, Evas_Image_Data *pd EINA_UNUSED)
4755{
4756 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo, EVAS_OBJECT_CLASS);
4757
4758 return obj->cur->snapshot;
4759}
4742 4760
4743EAPI void 4761EAPI void
4744evas_object_image_file_set(Eo *obj, const char *file, const char *key) 4762evas_object_image_file_set(Eo *obj, const char *file, const char *key)
@@ -4811,3 +4829,5 @@ _evas_image_efl_gfx_filter_program_set(Eo *obj, Evas_Image_Data *pd EINA_UNUSED,
4811} 4829}
4812 4830
4813#include "canvas/evas_image.eo.c" 4831#include "canvas/evas_image.eo.c"
4832
4833/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 01b43401a5..fe838d0f14 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