aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/evas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-10-08 14:00:39 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-10-12 13:44:44 +0900
commita8243ed382780615dd572babfeee3a333375ba80 (patch)
treeb5e7ce4a7a863921c1286bd023c9c34bafa1d3e7 /src/modules/evas
parentEvas filter: Fix proxies of filtered images (diff)
downloadefl-a8243ed382780615dd572babfeee3a333375ba80.tar.gz
Evas: Add engine function image_ref
This is to simplify and fix filters. This is an internal function.
Diffstat (limited to 'src/modules/evas')
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c10
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c16
2 files changed, 26 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index f4c7233e6c..2cf26ab235 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -527,6 +527,15 @@ eng_image_free(void *data, void *image)
evas_gl_common_image_free(image);
}
+static void *
+eng_image_ref(void *data EINA_UNUSED, void *image)
+{
+ Evas_GL_Image *im = image;
+ if (!im) return NULL;
+ im->references++;
+ return im;
+}
+
static void
eng_image_size_get(void *data EINA_UNUSED, void *image, int *w, int *h)
{
@@ -2591,6 +2600,7 @@ module_open(Evas_Module *em)
ORD(image_new_from_data);
ORD(image_new_from_copied_data);
ORD(image_free);
+ ORD(image_ref);
ORD(image_size_get);
ORD(image_size_set);
ORD(image_dirty_region);
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index dbeee246f4..5c860aec83 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -1221,6 +1221,21 @@ eng_image_free(void *data EINA_UNUSED, void *image)
evas_cache_image_drop(image);
}
+static void *
+eng_image_ref(void *data EINA_UNUSED, void *image)
+{
+ if (!image) return NULL;
+#ifdef EVAS_CSERVE2
+ if (evas_cserve2_use_get() && evas_cache2_image_cached(image))
+ {
+ evas_cache2_image_ref(image);
+ return image;
+ }
+#endif
+ evas_cache_image_ref(image);
+ return image;
+}
+
static void
eng_image_size_get(void *data EINA_UNUSED, void *image, int *w, int *h)
{
@@ -3980,6 +3995,7 @@ static Evas_Func func =
eng_image_new_from_data,
eng_image_new_from_copied_data,
eng_image_free,
+ eng_image_ref,
eng_image_size_get,
eng_image_size_set,
NULL, // eng_image_stride_get