summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2018-08-30 13:38:15 +0900
committerHermet Park <hermetpark@gmail.com>2018-08-30 13:39:31 +0900
commit4e2287ecaf3230c21a114bf68b1b673ed3712dc1 (patch)
treed0774f6a5d5ba9c6c14581a3b701e2186e2b843b /src/modules/evas/engines/gl_common
parente800139953d1f2995a1f0c41301a166cfe232f63 (diff)
evas-gl-common: Remove cserve2 support
ref T7226 Depends on D6927
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c135
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_preload.c21
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c10
3 files changed, 18 insertions, 148 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 22cce55ab8..3aa40ead42 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -1,21 +1,11 @@
1#include "evas_gl_private.h" 1#include "evas_gl_private.h"
2 2
3#ifdef EVAS_CSERVE2
4#include "evas_cs2_private.h"
5#endif
6
7void 3void
8evas_gl_common_image_alloc_ensure(Evas_GL_Image *im) 4evas_gl_common_image_alloc_ensure(Evas_GL_Image *im)
9{ 5{
10 if (!im->im) return; 6 if (!im->im) return;
11#ifdef EVAS_CSERVE2 7 im->im = (RGBA_Image *)evas_cache_image_size_set(&im->im->cache_entry,
12 if (evas_cache2_image_cached(&im->im->cache_entry)) 8 im->w, im->h);
13 im->im = (RGBA_Image *)evas_cache2_image_size_set(&im->im->cache_entry,
14 im->w, im->h);
15 else
16#endif
17 im->im = (RGBA_Image *)evas_cache_image_size_set(&im->im->cache_entry,
18 im->w, im->h);
19} 9}
20 10
21EAPI void 11EAPI void
@@ -27,14 +17,7 @@ evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc)
27 EINA_LIST_FOREACH(gc->shared->images, l, im) 17 EINA_LIST_FOREACH(gc->shared->images, l, im)
28 { 18 {
29 if (im->im) 19 if (im->im)
30 { 20 evas_cache_image_unload_data(&im->im->cache_entry);
31#ifdef EVAS_CSERVE2
32 if (evas_cache2_image_cached(&im->im->cache_entry))
33 evas_cache2_image_unload_data(&im->im->cache_entry);
34 else
35#endif
36 evas_cache_image_unload_data(&im->im->cache_entry);
37 }
38 if (im->tex) 21 if (im->tex)
39 { 22 {
40 if (!im->tex->pt->dyn.img) 23 if (!im->tex->pt->dyn.img)
@@ -250,12 +233,7 @@ evas_gl_common_image_new_from_rgbaimage(Evas_Engine_GL_Context *gc, RGBA_Image *
250 im = calloc(1, sizeof(Evas_GL_Image)); 233 im = calloc(1, sizeof(Evas_GL_Image));
251 if (!im) 234 if (!im)
252 { 235 {
253#ifdef EVAS_CSERVE2 236 evas_cache_image_drop(&(im_im->cache_entry));
254 if (evas_cache2_image_cached(&im_im->cache_entry))
255 evas_cache2_image_close(&(im_im->cache_entry));
256 else
257#endif
258 evas_cache_image_drop(&(im_im->cache_entry));
259 if (error) *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; 237 if (error) *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
260 return NULL; 238 return NULL;
261 } 239 }
@@ -308,26 +286,6 @@ evas_gl_common_image_mmap(Evas_Engine_GL_Context *gc, Eina_File *f, const char *
308{ 286{
309 RGBA_Image *im_im; 287 RGBA_Image *im_im;
310 288
311#ifdef EVAS_CSERVE2
312 if (evas_cserve2_use_get() && !eina_file_virtual(f))
313 {
314 im_im = (RGBA_Image *) evas_cache2_image_open
315 (evas_common_image_cache2_get(), eina_file_filename_get(f), key, lo, error);
316 if (im_im)
317 {
318 *error = evas_cache2_image_open_wait(&im_im->cache_entry);
319 if ((*error != EVAS_LOAD_ERROR_NONE)
320 && im_im->cache_entry.animated.animated)
321 {
322 evas_cache2_image_close(&im_im->cache_entry);
323 im_im = NULL;
324 }
325 else
326 return evas_gl_common_image_new_from_rgbaimage(gc, im_im, lo, error);
327 }
328 }
329#endif
330
331 im_im = evas_common_load_image_from_mmap(f, key, lo, error); 289 im_im = evas_common_load_image_from_mmap(f, key, lo, error);
332 if (!im_im) return NULL; 290 if (!im_im) return NULL;
333 291
@@ -526,12 +484,7 @@ evas_gl_common_image_alpha_set(Evas_GL_Image *im, int alpha)
526 im->alpha = alpha; 484 im->alpha = alpha;
527 if (!im->im) return im; 485 if (!im->im) return im;
528 evas_gl_common_image_alloc_ensure(im); 486 evas_gl_common_image_alloc_ensure(im);
529#ifdef EVAS_CSERVE2 487 evas_cache_image_load_data(&im->im->cache_entry);
530 if (evas_cache2_image_cached(&im->im->cache_entry))
531 evas_cache2_image_load_data(&im->im->cache_entry);
532 else
533#endif
534 evas_cache_image_load_data(&im->im->cache_entry);
535 im->im->cache_entry.flags.alpha = alpha ? 1 : 0; 488 im->im->cache_entry.flags.alpha = alpha ? 1 : 0;
536 489
537 if (im->tex) evas_gl_common_texture_free(im->tex, EINA_TRUE); 490 if (im->tex) evas_gl_common_texture_free(im->tex, EINA_TRUE);
@@ -566,12 +519,7 @@ evas_gl_common_image_native_enable(Evas_GL_Image *im)
566 } 519 }
567 if (im->im) 520 if (im->im)
568 { 521 {
569#ifdef EVAS_CSERVE2 522 evas_cache_image_drop(&im->im->cache_entry);
570 if (evas_cache2_image_cached(&im->im->cache_entry))
571 evas_cache2_image_close(&im->im->cache_entry);
572 else
573#endif
574 evas_cache_image_drop(&im->im->cache_entry);
575 im->im = NULL; 523 im->im = NULL;
576 } 524 }
577 if (im->tex) 525 if (im->tex)
@@ -590,12 +538,7 @@ evas_gl_common_image_native_disable(Evas_GL_Image *im)
590{ 538{
591 if (im->im) 539 if (im->im)
592 { 540 {
593#ifdef EVAS_CSERVE2 541 evas_cache_image_drop(&im->im->cache_entry);
594 if (!evas_cache2_image_cached(&im->im->cache_entry))
595 evas_cache2_image_close(&im->im->cache_entry);
596 else
597#endif
598 evas_cache_image_drop(&im->im->cache_entry);
599 im->im = NULL; 542 im->im = NULL;
600 } 543 }
601 if (im->tex) 544 if (im->tex)
@@ -664,12 +607,7 @@ evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint)
664 } 607 }
665 if (im->im) 608 if (im->im)
666 { 609 {
667#ifdef EVAS_CSERVE2 610 evas_cache_image_drop(&im->im->cache_entry);
668 if (evas_cache2_image_cached(&im->im->cache_entry))
669 evas_cache2_image_close(&im->im->cache_entry);
670 else
671#endif
672 evas_cache_image_drop(&im->im->cache_entry);
673 im->im = NULL; 611 im->im = NULL;
674 } 612 }
675 if (im->tex) 613 if (im->tex)
@@ -684,12 +622,7 @@ evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint)
684 { 622 {
685 if (im->im) 623 if (im->im)
686 { 624 {
687#ifdef EVAS_CSERVE2 625 evas_cache_image_drop(&im->im->cache_entry);
688 if (evas_cache2_image_cached(&im->im->cache_entry))
689 evas_cache2_image_close(&im->im->cache_entry);
690 else
691#endif
692 evas_cache_image_drop(&im->im->cache_entry);
693 im->im = NULL; 626 im->im = NULL;
694 } 627 }
695 if (im->tex) 628 if (im->tex)
@@ -758,14 +691,7 @@ evas_gl_common_image_free(Evas_GL_Image *im)
758 } 691 }
759 if (im->tex) evas_gl_common_texture_free(im->tex, EINA_TRUE); 692 if (im->tex) evas_gl_common_texture_free(im->tex, EINA_TRUE);
760 if (im->im) 693 if (im->im)
761 { 694 evas_cache_image_drop(&im->im->cache_entry);
762#ifdef EVAS_CSERVE2
763 if (evas_cache2_image_cached(&im->im->cache_entry))
764 evas_cache2_image_close(&im->im->cache_entry);
765 else
766#endif
767 evas_cache_image_drop(&im->im->cache_entry);
768 }
769 695
770 free(im); 696 free(im);
771} 697}
@@ -825,12 +751,7 @@ evas_gl_common_image_dirty(Evas_GL_Image *im, unsigned int x, unsigned int y, un
825 if (im->im) 751 if (im->im)
826 { 752 {
827 evas_gl_common_image_alloc_ensure(im); 753 evas_gl_common_image_alloc_ensure(im);
828#ifdef EVAS_CSERVE2 754 im->im = (RGBA_Image *)evas_cache_image_dirty(&im->im->cache_entry, x, y, w, h);
829 if (evas_cache2_image_cached(&im->im->cache_entry))
830 im->im = (RGBA_Image *)evas_cache2_image_dirty(&im->im->cache_entry, x, y, w, h);
831 else
832#endif
833 im->im = (RGBA_Image *)evas_cache_image_dirty(&im->im->cache_entry, x, y, w, h);
834 } 755 }
835 im->dirty = 1; 756 im->dirty = 1;
836} 757}
@@ -890,37 +811,15 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
890 if ((im->tex) && 811 if ((im->tex) &&
891 ((im->dirty) || (ie->animated.animated) || (ie->flags.updated_data))) 812 ((im->dirty) || (ie->animated.animated) || (ie->flags.updated_data)))
892 { 813 {
893#ifdef EVAS_CSERVE2 814 evas_cache_image_load_data(ie);
894 if (evas_cache2_image_cached(ie)) 815 evas_gl_common_texture_update(im->tex, im->im);
895 { 816 evas_cache_image_unload_data(ie);
896 evas_cache2_image_load_data(ie);
897 evas_gl_common_texture_update(im->tex, im->im);
898 evas_cache2_image_unload_data(ie);
899 }
900 else
901#endif
902 {
903 evas_cache_image_load_data(ie);
904 evas_gl_common_texture_update(im->tex, im->im);
905 evas_cache_image_unload_data(ie);
906 }
907 } 817 }
908 else if (!im->tex && !ie->load_error) 818 else if (!im->tex && !ie->load_error)
909 { 819 {
910#ifdef EVAS_CSERVE2 820 evas_cache_image_load_data(ie);
911 if (evas_cache2_image_cached(ie)) 821 im->tex = evas_gl_common_texture_new(gc, im->im, im->disable_atlas);
912 { 822 evas_cache_image_unload_data(ie);
913 evas_cache2_image_load_data(ie);
914 im->tex = evas_gl_common_texture_new(gc, im->im, im->disable_atlas);
915 evas_cache2_image_unload_data(ie);
916 }
917 else
918#endif
919 {
920 evas_cache_image_load_data(ie);
921 im->tex = evas_gl_common_texture_new(gc, im->im, im->disable_atlas);
922 evas_cache_image_unload_data(ie);
923 }
924 } 823 }
925 ie->flags.updated_data = EINA_FALSE; 824 ie->flags.updated_data = EINA_FALSE;
926 im->dirty = 0; 825 im->dirty = 0;
diff --git a/src/modules/evas/engines/gl_common/evas_gl_preload.c b/src/modules/evas/engines/gl_common/evas_gl_preload.c
index 7a89cf8b46..666f944d82 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_preload.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_preload.c
@@ -1,9 +1,5 @@
1#include "evas_gl_private.h" 1#include "evas_gl_private.h"
2 2
3#ifdef EVAS_CSERVE2
4#include "evas_cs2_private.h"
5#endif
6
7static Eina_Thread async_loader_thread; 3static Eina_Thread async_loader_thread;
8static Eina_Condition async_loader_cond; 4static Eina_Condition async_loader_cond;
9static Eina_Lock async_loader_lock; 5static Eina_Lock async_loader_lock;
@@ -56,11 +52,6 @@ evas_gl_preload_pop(Evas_GL_Texture *tex)
56 if (running) evas_gl_preload_render_lock(tmp_cb, tmp_data); 52 if (running) evas_gl_preload_render_lock(tmp_cb, tmp_data);
57 53
58 evas_gl_common_texture_free(current->tex, EINA_FALSE); 54 evas_gl_common_texture_free(current->tex, EINA_FALSE);
59#ifdef EVAS_CSERVE2
60 if (evas_cache2_image_cached(&current->im->cache_entry))
61 evas_cache2_image_close(&current->im->cache_entry);
62 else
63#endif
64 evas_cache_image_drop(&current->im->cache_entry); 55 evas_cache_image_drop(&current->im->cache_entry);
65 free(current); 56 free(current);
66 57
@@ -75,12 +66,7 @@ evas_gl_preload_pop(Evas_GL_Texture *tex)
75 async_loader_tex = eina_list_remove_list(async_loader_tex, l); 66 async_loader_tex = eina_list_remove_list(async_loader_tex, l);
76 67
77 evas_gl_common_texture_free(async->tex, EINA_FALSE); 68 evas_gl_common_texture_free(async->tex, EINA_FALSE);
78#ifdef EVAS_CSERVE2 69 evas_cache_image_drop(&async->im->cache_entry);
79 if (evas_cache2_image_cached(&async->im->cache_entry))
80 evas_cache2_image_close(&async->im->cache_entry);
81 else
82#endif
83 evas_cache_image_drop(&async->im->cache_entry);
84 free(async); 70 free(async);
85 71
86 break; 72 break;
@@ -122,11 +108,6 @@ _evas_gl_preload_main_loop_wakeup(void)
122 108
123 evas_gl_common_texture_free(async->tex, EINA_FALSE); 109 evas_gl_common_texture_free(async->tex, EINA_FALSE);
124 } 110 }
125#ifdef EVAS_CSERVE2
126 if (evas_cache2_image_cached(&async->im->cache_entry))
127 evas_cache2_image_close(&async->im->cache_entry);
128 else
129#endif
130 evas_cache_image_drop(&async->im->cache_entry); 111 evas_cache_image_drop(&async->im->cache_entry);
131 free(async); 112 free(async);
132 } 113 }
diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c b/src/modules/evas/engines/gl_common/evas_gl_texture.c
index 5d99e07be0..cc5ed6bd13 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -1523,11 +1523,6 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1523 async->tex = tex; 1523 async->tex = tex;
1524 async->tex->references++; 1524 async->tex->references++;
1525 async->im = im; 1525 async->im = im;
1526#ifdef EVAS_CSERVE2
1527 if (evas_cache2_image_cached(&async->im->cache_entry))
1528 evas_cache2_image_ref(&async->im->cache_entry);
1529 else
1530#endif
1531 evas_cache_image_ref(&async->im->cache_entry); 1526 evas_cache_image_ref(&async->im->cache_entry);
1532 async->unpack_row_length = tex->gc->shared->info.unpack_row_length; 1527 async->unpack_row_length = tex->gc->shared->info.unpack_row_length;
1533 1528
@@ -1536,11 +1531,6 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1536 1531
1537 // Failed to start asynchronous upload, likely due to preload not being supported by the backend 1532 // Failed to start asynchronous upload, likely due to preload not being supported by the backend
1538 async->tex->references--; 1533 async->tex->references--;
1539#ifdef EVAS_CSERVE2
1540 if (evas_cache2_image_cached(&async->im->cache_entry))
1541 evas_cache2_image_close(&async->im->cache_entry);
1542 else
1543#endif
1544 evas_cache_image_drop(&async->im->cache_entry); 1534 evas_cache_image_drop(&async->im->cache_entry);
1545 free(async); 1535 free(async);
1546 1536