summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-02-14 08:33:32 -0500
committerMike Blumenkrantz <zmike@samsung.com>2020-02-14 08:33:32 -0500
commitdc14257c96c4debae9c5614e9618a4764b45dc80 (patch)
treef8d798a0775ec1cd5e60fe1f746d9a560d482bd4
parentbe3915cc909443554dff834f1bbd25933d4f7584 (diff)
Revert "evas: remove image_load from the engine."
Summary: This reverts commit 867d826395f988b9a9cbc3b5f93bf57ce031885d. Depends on D11337 Reviewers: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11338
-rw-r--r--src/lib/evas/include/evas_private.h1
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c11
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c28
3 files changed, 40 insertions, 0 deletions
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index e7de463..01bac6f 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1349,6 +1349,7 @@ struct _Evas_Func
1349 void *(*polygon_points_clear) (void *engine, void *polygon); 1349 void *(*polygon_points_clear) (void *engine, void *polygon);
1350 void (*polygon_draw) (void *engine, void *data, void *context, void *surface, void *polygon, int x, int y, Eina_Bool do_async); 1350 void (*polygon_draw) (void *engine, void *data, void *context, void *surface, void *polygon, int x, int y, Eina_Bool do_async);
1351 1351
1352 void *(*image_load) (void *engine, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo);
1352 void *(*image_mmap) (void *engine, Eina_File *f, const char *key, int *error, Evas_Image_Load_Opts *lo); 1353 void *(*image_mmap) (void *engine, Eina_File *f, const char *key, int *error, Evas_Image_Load_Opts *lo);
1353 void *(*image_new_from_data) (void *engine, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace); 1354 void *(*image_new_from_data) (void *engine, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace);
1354 void *(*image_new_from_copied_data) (void *engine, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace); 1355 void *(*image_new_from_copied_data) (void *engine, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace);
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 4ae962a..3f4c36c 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -614,6 +614,16 @@ eng_image_native_get(void *engine EINA_UNUSED, void *image)
614} 614}
615 615
616static void * 616static void *
617eng_image_load(void *engine, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo)
618{
619 Evas_Engine_GL_Context *gl_context;
620
621 *error = EVAS_LOAD_ERROR_NONE;
622 gl_context = gl_generic_context_find(engine, 1);
623 return evas_gl_common_image_load(gl_context, file, key, lo, error);
624}
625
626static void *
617eng_image_mmap(void *engine, Eina_File *f, const char *key, int *error, Evas_Image_Load_Opts *lo) 627eng_image_mmap(void *engine, Eina_File *f, const char *key, int *error, Evas_Image_Load_Opts *lo)
618{ 628{
619 Evas_Engine_GL_Context *gl_context; 629 Evas_Engine_GL_Context *gl_context;
@@ -3204,6 +3214,7 @@ module_open(Evas_Module *em)
3204 ORD(polygon_points_clear); 3214 ORD(polygon_points_clear);
3205 ORD(polygon_draw); 3215 ORD(polygon_draw);
3206 3216
3217 ORD(image_load);
3207 ORD(image_mmap); 3218 ORD(image_mmap);
3208 ORD(image_new_from_data); 3219 ORD(image_new_from_data);
3209 ORD(image_new_from_copied_data); 3220 ORD(image_new_from_copied_data);
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 4d145ad..d2f0381 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -1205,6 +1205,33 @@ eng_image_native_get(void *data EINA_UNUSED, void *image)
1205} 1205}
1206 1206
1207static void * 1207static void *
1208eng_image_load(void *data EINA_UNUSED, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo)
1209{
1210 *error = EVAS_LOAD_ERROR_NONE;
1211#ifdef EVAS_CSERVE2
1212 if (evas_cserve2_use_get())
1213 {
1214 Image_Entry *ie;
1215 ie = evas_cache2_image_open(evas_common_image_cache2_get(),
1216 file, key, lo, error);
1217 if (ie)
1218 {
1219 *error = evas_cache2_image_open_wait(ie);
1220 if ((*error != EVAS_LOAD_ERROR_NONE) && ie->animated.animated)
1221 {
1222 evas_cache2_image_close(ie);
1223 goto use_local_cache;
1224 }
1225 }
1226 return ie;
1227 }
1228use_local_cache:
1229#endif
1230
1231 return evas_common_load_image_from_file(file, key, lo, error);
1232}
1233
1234static void *
1208eng_image_mmap(void *data EINA_UNUSED, Eina_File *f, const char *key, int *error, Evas_Image_Load_Opts *lo) 1235eng_image_mmap(void *data EINA_UNUSED, Eina_File *f, const char *key, int *error, Evas_Image_Load_Opts *lo)
1209{ 1236{
1210 *error = EVAS_LOAD_ERROR_NONE; 1237 *error = EVAS_LOAD_ERROR_NONE;
@@ -4637,6 +4664,7 @@ static Evas_Func func =
4637 eng_polygon_points_clear, 4664 eng_polygon_points_clear,
4638 eng_polygon_draw, 4665 eng_polygon_draw,
4639 /* image draw funcs */ 4666 /* image draw funcs */
4667 eng_image_load,
4640 eng_image_mmap, 4668 eng_image_mmap,
4641 eng_image_new_from_data, 4669 eng_image_new_from_data,
4642 eng_image_new_from_copied_data, 4670 eng_image_new_from_copied_data,