summaryrefslogtreecommitdiff
path: root/legacy/evas/src/modules
diff options
context:
space:
mode:
authorIván Briano <sachieru@gmail.com>2012-05-03 21:01:31 +0000
committerIván Briano <sachieru@gmail.com>2012-05-03 21:01:31 +0000
commit15328efb85bcf413025d787d1d58d812a407f25a (patch)
tree37c09205c159d8b9758ffdada5dff2248e632613 /legacy/evas/src/modules
parentb8ade6a7cfa99ca19c054bd6b0bf488e63accbf4 (diff)
evas/cserve2: fix typo that kept cserve2 disabled
now seriously... Introducing Cache Serve 2. This cache server will initially load images for clients connected to it. It starts slave processes to load these images, and share the loaded images through shm with the clients. All the connection done between clients and the server goes through sockets. The cserve2 build option is turned on by default, while the old cserve was disabled, but in order to make clients use it, the environment variable EVAS_CSERVE2 must be set, and a server must be running. Clients will try to find the socket on a specified location using the environment variable EVAS_CSERVE2_SOCKET. If it's not defined, then the XDG_RUNTIME_DIR path should be used, and finally HOME, TMPDIR and /tmp. SVN revision: 70699
Diffstat (limited to 'legacy/evas/src/modules')
-rw-r--r--legacy/evas/src/modules/engines/buffer/Makefile.am1
-rw-r--r--legacy/evas/src/modules/engines/buffer/evas_outbuf.c75
-rw-r--r--legacy/evas/src/modules/engines/software_generic/Makefile.am1
-rw-r--r--legacy/evas/src/modules/engines/software_generic/evas_engine.c109
-rw-r--r--legacy/evas/src/modules/engines/software_x11/Makefile.am1
-rw-r--r--legacy/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c155
6 files changed, 308 insertions, 34 deletions
diff --git a/legacy/evas/src/modules/engines/buffer/Makefile.am b/legacy/evas/src/modules/engines/buffer/Makefile.am
index f8cd36452f..27f491266a 100644
--- a/legacy/evas/src/modules/engines/buffer/Makefile.am
+++ b/legacy/evas/src/modules/engines/buffer/Makefile.am
@@ -5,6 +5,7 @@ AM_CPPFLAGS = \
5-I. \ 5-I. \
6-I$(top_srcdir)/src/lib \ 6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \ 7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
8-I$(top_srcdir)/src/modules/engines \ 9-I$(top_srcdir)/src/modules/engines \
9@EINA_CFLAGS@ \ 10@EINA_CFLAGS@ \
10@FREETYPE_CFLAGS@ \ 11@FREETYPE_CFLAGS@ \
diff --git a/legacy/evas/src/modules/engines/buffer/evas_outbuf.c b/legacy/evas/src/modules/engines/buffer/evas_outbuf.c
index 0fa1842fe1..7b79ebb263 100644
--- a/legacy/evas/src/modules/engines/buffer/evas_outbuf.c
+++ b/legacy/evas/src/modules/engines/buffer/evas_outbuf.c
@@ -1,3 +1,11 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#ifdef EVAS_CSERVE2
6#include "evas_cs2_private.h"
7#endif
8
1#include "evas_common.h" 9#include "evas_common.h"
2#include "evas_engine.h" 10#include "evas_engine.h"
3 11
@@ -11,6 +19,11 @@ evas_buffer_outbuf_buf_free(Outbuf *buf)
11{ 19{
12 if (buf->priv.back_buf) 20 if (buf->priv.back_buf)
13 { 21 {
22#ifdef EVAS_CSERVE2
23 if (evas_cserve2_use_get())
24 evas_cache2_image_close(&buf->priv.back_buf->cache_entry);
25 else
26#endif
14 evas_cache_image_drop(&buf->priv.back_buf->cache_entry); 27 evas_cache_image_drop(&buf->priv.back_buf->cache_entry);
15 } 28 }
16 free(buf); 29 free(buf);
@@ -50,6 +63,14 @@ evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, in
50 (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32)))) 63 (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32))))
51 { 64 {
52 memset(buf->dest, 0, h * buf->dest_row_bytes); 65 memset(buf->dest, 0, h * buf->dest_row_bytes);
66#ifdef EVAS_CSERVE2
67 if (evas_cserve2_use_get())
68 buf->priv.back_buf = (RGBA_Image *) evas_cache2_image_data(evas_common_image_cache2_get(),
69 w, h,
70 buf->dest,
71 1, EVAS_COLORSPACE_ARGB8888);
72 else
73#endif
53 buf->priv.back_buf = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(), 74 buf->priv.back_buf = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
54 w, h, 75 w, h,
55 buf->dest, 76 buf->dest,
@@ -58,6 +79,14 @@ evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, in
58 else if ((buf->depth == OUTBUF_DEPTH_RGB_32BPP_888_8888) && 79 else if ((buf->depth == OUTBUF_DEPTH_RGB_32BPP_888_8888) &&
59 (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32)))) 80 (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32))))
60 { 81 {
82#ifdef EVAS_CSERVE2
83 if (evas_cserve2_use_get())
84 buf->priv.back_buf = (RGBA_Image *) evas_cache2_image_data(evas_common_image_cache2_get(),
85 w, h,
86 buf->dest,
87 0, EVAS_COLORSPACE_ARGB8888);
88 else
89#endif
61 buf->priv.back_buf = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(), 90 buf->priv.back_buf = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
62 w, h, 91 w, h,
63 buf->dest, 92 buf->dest,
@@ -80,6 +109,11 @@ evas_buffer_outbuf_buf_new_region_for_update(Outbuf *buf, int x, int y, int w, i
80 else 109 else
81 { 110 {
82 *cx = 0; *cy = 0; *cw = w; *ch = h; 111 *cx = 0; *cy = 0; *cw = w; *ch = h;
112#ifdef EVAS_CSERVE2
113 if (evas_cserve2_use_get())
114 im = (RGBA_Image *)evas_cache2_image_empty(evas_common_image_cache2_get());
115 else
116#endif
83 im = (RGBA_Image *) evas_cache_image_empty(evas_common_image_cache_get()); 117 im = (RGBA_Image *) evas_cache_image_empty(evas_common_image_cache_get());
84 if (im) 118 if (im)
85 { 119 {
@@ -87,6 +121,11 @@ evas_buffer_outbuf_buf_new_region_for_update(Outbuf *buf, int x, int y, int w, i
87 ((buf->depth == OUTBUF_DEPTH_BGRA_32BPP_8888_8888))) 121 ((buf->depth == OUTBUF_DEPTH_BGRA_32BPP_8888_8888)))
88 { 122 {
89 im->cache_entry.flags.alpha = 1; 123 im->cache_entry.flags.alpha = 1;
124#ifdef EVAS_CSERVE2
125 if (evas_cserve2_use_get())
126 evas_cache2_image_size_set(&im->cache_entry, w, h);
127 else
128#endif
90 im = (RGBA_Image *) evas_cache_image_size_set(&im->cache_entry, w, h); 129 im = (RGBA_Image *) evas_cache_image_size_set(&im->cache_entry, w, h);
91 } 130 }
92 } 131 }
@@ -97,7 +136,15 @@ evas_buffer_outbuf_buf_new_region_for_update(Outbuf *buf, int x, int y, int w, i
97void 136void
98evas_buffer_outbuf_buf_free_region_for_update(Outbuf *buf, RGBA_Image *update) 137evas_buffer_outbuf_buf_free_region_for_update(Outbuf *buf, RGBA_Image *update)
99{ 138{
100 if (update != buf->priv.back_buf) evas_cache_image_drop(&update->cache_entry); 139 if (update != buf->priv.back_buf)
140 {
141#ifdef EVAS_CSERVE2
142 if (evas_cserve2_use_get())
143 evas_cache2_image_close(&update->cache_entry);
144 else
145#endif
146 evas_cache_image_drop(&update->cache_entry);
147 }
101} 148}
102 149
103void 150void
@@ -108,12 +155,26 @@ evas_buffer_outbuf_buf_switch_buffer(Outbuf *buf)
108 buf->dest = buf->func.switch_buffer(buf->switch_data, buf->dest); 155 buf->dest = buf->func.switch_buffer(buf->switch_data, buf->dest);
109 if (buf->priv.back_buf) 156 if (buf->priv.back_buf)
110 { 157 {
111 evas_cache_image_drop(&buf->priv.back_buf->cache_entry); 158#ifdef EVAS_CSERVE2
112 buf->priv.back_buf = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(), 159 if (evas_cserve2_use_get())
113 buf->w, buf->h, 160 {
114 buf->dest, 161 evas_cache2_image_close(&buf->priv.back_buf->cache_entry);
115 buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888 ? 1 : 0, 162 buf->priv.back_buf = (RGBA_Image *) evas_cache2_image_data(evas_common_image_cache_get(),
116 EVAS_COLORSPACE_ARGB8888); 163 buf->w, buf->h,
164 buf->dest,
165 buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888 ? 1 : 0,
166 EVAS_COLORSPACE_ARGB8888);
167 }
168 else
169#endif
170 {
171 evas_cache_image_drop(&buf->priv.back_buf->cache_entry);
172 buf->priv.back_buf = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
173 buf->w, buf->h,
174 buf->dest,
175 buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888 ? 1 : 0,
176 EVAS_COLORSPACE_ARGB8888);
177 }
117 } 178 }
118 } 179 }
119} 180}
diff --git a/legacy/evas/src/modules/engines/software_generic/Makefile.am b/legacy/evas/src/modules/engines/software_generic/Makefile.am
index fa522f8587..f31810e6de 100644
--- a/legacy/evas/src/modules/engines/software_generic/Makefile.am
+++ b/legacy/evas/src/modules/engines/software_generic/Makefile.am
@@ -5,6 +5,7 @@ AM_CPPFLAGS = \
5-I. \ 5-I. \
6-I$(top_srcdir)/src/lib \ 6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \ 7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/lib/cserve2 \
8-I$(top_srcdir)/src/modules/engines \ 9-I$(top_srcdir)/src/modules/engines \
9@EINA_CFLAGS@ \ 10@EINA_CFLAGS@ \
10@FREETYPE_CFLAGS@ \ 11@FREETYPE_CFLAGS@ \
diff --git a/legacy/evas/src/modules/engines/software_generic/evas_engine.c b/legacy/evas/src/modules/engines/software_generic/evas_engine.c
index cbc709d601..96ed50ca9e 100644
--- a/legacy/evas/src/modules/engines/software_generic/evas_engine.c
+++ b/legacy/evas/src/modules/engines/software_generic/evas_engine.c
@@ -1,5 +1,8 @@
1#include "evas_common.h" /* Also includes international specific stuff */ 1#include "evas_common.h" /* Also includes international specific stuff */
2#include "evas_private.h" 2#include "evas_private.h"
3#ifdef EVAS_CSERVE2
4#include "evas_cs2_private.h"
5#endif
3 6
4#ifdef HAVE_DLSYM 7#ifdef HAVE_DLSYM
5# include <dlfcn.h> /* dlopen,dlclose,etc */ 8# include <dlfcn.h> /* dlopen,dlclose,etc */
@@ -655,24 +658,58 @@ static void *
655eng_image_load(void *data __UNUSED__, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo) 658eng_image_load(void *data __UNUSED__, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo)
656{ 659{
657 *error = EVAS_LOAD_ERROR_NONE; 660 *error = EVAS_LOAD_ERROR_NONE;
661#ifdef EVAS_CSERVE2
662 if (evas_cserve2_use_get())
663 {
664 Image_Entry *ie;
665 ie = evas_cache2_image_open(evas_common_image_cache2_get(),
666 file, key, lo, error);
667 if (ie)
668 evas_cache2_image_open_wait(ie);
669
670 return ie;
671 }
672#endif
658 return evas_common_load_image_from_file(file, key, lo, error); 673 return evas_common_load_image_from_file(file, key, lo, error);
659} 674}
660 675
661static void * 676static void *
662eng_image_new_from_data(void *data __UNUSED__, int w, int h, DATA32 *image_data, int alpha, int cspace) 677eng_image_new_from_data(void *data __UNUSED__, int w, int h, DATA32 *image_data, int alpha, int cspace)
663{ 678{
679#ifdef EVAS_CSERVE2
680 if (evas_cserve2_use_get())
681 {
682 Evas_Cache2 *cache = evas_common_image_cache2_get();
683 return evas_cache2_image_data(cache, w, h, image_data, alpha, cspace);
684 }
685#endif
664 return evas_cache_image_data(evas_common_image_cache_get(), w, h, image_data, alpha, cspace); 686 return evas_cache_image_data(evas_common_image_cache_get(), w, h, image_data, alpha, cspace);
665} 687}
666 688
667static void * 689static void *
668eng_image_new_from_copied_data(void *data __UNUSED__, int w, int h, DATA32 *image_data, int alpha, int cspace) 690eng_image_new_from_copied_data(void *data __UNUSED__, int w, int h, DATA32 *image_data, int alpha, int cspace)
669{ 691{
692#ifdef EVAS_CSERVE2
693 if (evas_cserve2_use_get())
694 {
695 Evas_Cache2 *cache = evas_common_image_cache2_get();
696 return evas_cache2_image_copied_data(cache, w, h, image_data, alpha,
697 cspace);
698 }
699#endif
670 return evas_cache_image_copied_data(evas_common_image_cache_get(), w, h, image_data, alpha, cspace); 700 return evas_cache_image_copied_data(evas_common_image_cache_get(), w, h, image_data, alpha, cspace);
671} 701}
672 702
673static void 703static void
674eng_image_free(void *data __UNUSED__, void *image) 704eng_image_free(void *data __UNUSED__, void *image)
675{ 705{
706#ifdef EVAS_CSERVE2
707 if (evas_cserve2_use_get())
708 {
709 evas_cache2_image_close(image);
710 return;
711 }
712#endif
676 evas_cache_image_drop(image); 713 evas_cache_image_drop(image);
677} 714}
678 715
@@ -691,6 +728,10 @@ eng_image_size_set(void *data __UNUSED__, void *image, int w, int h)
691{ 728{
692 Image_Entry *im = image; 729 Image_Entry *im = image;
693 if (!im) return NULL; 730 if (!im) return NULL;
731#ifdef EVAS_CSERVE2
732 if (evas_cserve2_use_get())
733 return evas_cache2_image_size_set(im, w, h);
734#endif
694 return evas_cache_image_size_set(im, w, h); 735 return evas_cache_image_size_set(im, w, h);
695} 736}
696 737
@@ -699,6 +740,10 @@ eng_image_dirty_region(void *data __UNUSED__, void *image, int x, int y, int w,
699{ 740{
700 Image_Entry *im = image; 741 Image_Entry *im = image;
701 if (!im) return NULL; 742 if (!im) return NULL;
743#ifdef EVAS_CSERVE2
744 if (evas_cserve2_use_get())
745 return evas_cache2_image_dirty(im, x, y, w, h);
746#endif
702 return evas_cache_image_dirty(im, x, y, w, h); 747 return evas_cache_image_dirty(im, x, y, w, h);
703} 748}
704 749
@@ -706,7 +751,7 @@ static void *
706eng_image_data_get(void *data __UNUSED__, void *image, int to_write, DATA32 **image_data, int *err) 751eng_image_data_get(void *data __UNUSED__, void *image, int to_write, DATA32 **image_data, int *err)
707{ 752{
708 RGBA_Image *im; 753 RGBA_Image *im;
709 int error; 754 int error = EVAS_LOAD_ERROR_NONE;
710 755
711 if (!image) 756 if (!image)
712 { 757 {
@@ -714,6 +759,21 @@ eng_image_data_get(void *data __UNUSED__, void *image, int to_write, DATA32 **im
714 return NULL; 759 return NULL;
715 } 760 }
716 im = image; 761 im = image;
762
763#ifdef EVAS_CSERVE2
764 if (evas_cserve2_use_get())
765 {
766 error = evas_cache2_image_load_data(&im->cache_entry);
767 if (err) *err = error;
768
769 if (to_write)
770 im = evas_cache2_image_writable(&im->cache_entry);
771
772 *image_data = im->image.data;
773 return im;
774 }
775#endif
776
717 error = evas_cache_image_load_data(&im->cache_entry); 777 error = evas_cache_image_load_data(&im->cache_entry);
718 switch (im->cache_entry.space) 778 switch (im->cache_entry.space)
719 { 779 {
@@ -756,6 +816,14 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data)
756 im2 = eng_image_new_from_data(data, w, h, image_data, 816 im2 = eng_image_new_from_data(data, w, h, image_data,
757 eng_image_alpha_get(data, image), 817 eng_image_alpha_get(data, image),
758 eng_image_colorspace_get(data, image)); 818 eng_image_colorspace_get(data, image));
819#ifdef EVAS_CSERVE2
820 if (evas_cserve2_use_get())
821 {
822 evas_cache2_image_close(&im->cache_entry);
823 im = im2;
824 break;
825 }
826#endif
759 evas_cache_image_drop(&im->cache_entry); 827 evas_cache_image_drop(&im->cache_entry);
760 im = im2; 828 im = im2;
761 } 829 }
@@ -786,8 +854,15 @@ static void
786eng_image_data_preload_request(void *data __UNUSED__, void *image, const void *target) 854eng_image_data_preload_request(void *data __UNUSED__, void *image, const void *target)
787{ 855{
788 RGBA_Image *im = image; 856 RGBA_Image *im = image;
789
790 if (!im) return ; 857 if (!im) return ;
858
859#ifdef EVAS_CSERVE2
860 if (evas_cserve2_use_get())
861 {
862 evas_cache2_image_preload_data(&im->cache_entry, target);
863 return;
864 }
865#endif
791 evas_cache_image_preload_data(&im->cache_entry, target); 866 evas_cache_image_preload_data(&im->cache_entry, target);
792} 867}
793 868
@@ -795,6 +870,10 @@ static void
795eng_image_data_preload_cancel(void *data __UNUSED__, void *image, const void *target) 870eng_image_data_preload_cancel(void *data __UNUSED__, void *image, const void *target)
796{ 871{
797 RGBA_Image *im = image; 872 RGBA_Image *im = image;
873#ifdef EVAS_CSERVE2
874 if (evas_cserve2_use_get())
875 return;
876#endif
798 877
799 if (!im) return ; 878 if (!im) return ;
800 evas_cache_image_preload_cancel(&im->cache_entry, target); 879 evas_cache_image_preload_cancel(&im->cache_entry, target);
@@ -810,6 +889,10 @@ eng_image_draw(void *data __UNUSED__, void *context, void *surface, void *image,
810#ifdef BUILD_PIPE_RENDER 889#ifdef BUILD_PIPE_RENDER
811 if ((cpunum > 1)) 890 if ((cpunum > 1))
812 { 891 {
892#ifdef EVAS_CSERVE2
893 if (evas_cserve2_use_get())
894 evas_cache2_image_load_data(&im->cache_entry);
895#endif
813 evas_common_rgba_image_scalecache_prepare((Image_Entry *)(im), 896 evas_common_rgba_image_scalecache_prepare((Image_Entry *)(im),
814 surface, context, smooth, 897 surface, context, smooth,
815 src_x, src_y, src_w, src_h, 898 src_x, src_y, src_w, src_h,
@@ -822,9 +905,18 @@ eng_image_draw(void *data __UNUSED__, void *context, void *surface, void *image,
822 else 905 else
823#endif 906#endif
824 { 907 {
825// if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888) 908#ifdef EVAS_CSERVE2
826// evas_cache_image_load_data(&im->cache_entry); 909 if (evas_cserve2_use_get())
827// evas_common_image_colorspace_normalize(im); 910 {
911 evas_cache2_image_load_data(&im->cache_entry);
912 goto image_loaded;
913 }
914#endif
915 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
916 evas_cache_image_load_data(&im->cache_entry);
917 evas_common_image_colorspace_normalize(im);
918
919image_loaded:
828 evas_common_rgba_image_scalecache_prepare(&im->cache_entry, surface, context, smooth, 920 evas_common_rgba_image_scalecache_prepare(&im->cache_entry, surface, context, smooth,
829 src_x, src_y, src_w, src_h, 921 src_x, src_y, src_w, src_h,
830 dst_x, dst_y, dst_w, dst_h); 922 dst_x, dst_y, dst_w, dst_h);
@@ -916,6 +1008,13 @@ eng_image_map_surface_new(void *data __UNUSED__, int w, int h, int alpha)
916static void 1008static void
917eng_image_map_surface_free(void *data __UNUSED__, void *surface) 1009eng_image_map_surface_free(void *data __UNUSED__, void *surface)
918{ 1010{
1011#ifdef EVAS_CSERVE2
1012 if (evas_cserve2_use_get())
1013 {
1014 evas_cache2_image_unload_data(surface);
1015 return;
1016 }
1017#endif
919 evas_cache_image_drop(surface); 1018 evas_cache_image_drop(surface);
920} 1019}
921 1020
diff --git a/legacy/evas/src/modules/engines/software_x11/Makefile.am b/legacy/evas/src/modules/engines/software_x11/Makefile.am
index 441a00abe4..1d5d17bca9 100644
--- a/legacy/evas/src/modules/engines/software_x11/Makefile.am
+++ b/legacy/evas/src/modules/engines/software_x11/Makefile.am
@@ -11,6 +11,7 @@ AM_CPPFLAGS = \
11-I. \ 11-I. \
12-I$(top_srcdir)/src/lib \ 12-I$(top_srcdir)/src/lib \
13-I$(top_srcdir)/src/lib/include \ 13-I$(top_srcdir)/src/lib/include \
14-I$(top_srcdir)/src/lib/cserve2 \
14-I$(top_srcdir)/src/modules/engines \ 15-I$(top_srcdir)/src/modules/engines \
15@FREETYPE_CFLAGS@ \ 16@FREETYPE_CFLAGS@ \
16@PIXMAN_CFLAGS@ \ 17@PIXMAN_CFLAGS@ \
diff --git a/legacy/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c b/legacy/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c
index 9662bb31e9..c78814715a 100644
--- a/legacy/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c
+++ b/legacy/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c
@@ -5,6 +5,9 @@
5#include <sys/time.h> 5#include <sys/time.h>
6#include <sys/utsname.h> 6#include <sys/utsname.h>
7 7
8#ifdef EVAS_CSERVE2
9#include "evas_cs2_private.h"
10#endif
8#include "evas_common.h" 11#include "evas_common.h"
9#include "evas_macros.h" 12#include "evas_macros.h"
10#include "evas_xlib_outbuf.h" 13#include "evas_xlib_outbuf.h"
@@ -157,7 +160,14 @@ evas_software_xlib_outbuf_free(Outbuf *buf)
157 im = buf->priv.pending_writes->data; 160 im = buf->priv.pending_writes->data;
158 buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes); 161 buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes);
159 obr = im->extended_info; 162 obr = im->extended_info;
160 evas_cache_image_drop(&im->cache_entry); 163#ifdef EVAS_CSERVE2
164 if (evas_cserve2_use_get())
165 {
166 evas_cache2_image_close(&im->cache_entry);
167 }
168 else
169#endif
170 evas_cache_image_drop(&im->cache_entry);
161 if (obr->xob) _unfind_xob(obr->xob, 0); 171 if (obr->xob) _unfind_xob(obr->xob, 0);
162 if (obr->mxob) _unfind_xob(obr->mxob, 0); 172 if (obr->mxob) _unfind_xob(obr->mxob, 0);
163 free(obr); 173 free(obr);
@@ -411,10 +421,20 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
411 free(obr); 421 free(obr);
412 return NULL; 422 return NULL;
413 } 423 }
414 im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), 424#ifdef EVAS_CSERVE2
415 buf->w, buf->h, 425 if (evas_cserve2_use_get())
416 (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl), 426 {
417 alpha, EVAS_COLORSPACE_ARGB8888); 427 im = (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
428 buf->w, buf->h,
429 (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl),
430 alpha, EVAS_COLORSPACE_ARGB8888);
431 }
432 else
433#endif
434 im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
435 buf->w, buf->h,
436 (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl),
437 alpha, EVAS_COLORSPACE_ARGB8888);
418 if (!im) 438 if (!im)
419 { 439 {
420 evas_software_xlib_x_output_buffer_free(obr->xob, 0); 440 evas_software_xlib_x_output_buffer_free(obr->xob, 0);
@@ -432,14 +452,24 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
432 } 452 }
433 else 453 else
434 { 454 {
435 im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); 455#ifdef EVAS_CSERVE2
456 if (evas_cserve2_use_get())
457 im = (RGBA_Image *)evas_cache2_image_empty(evas_common_image_cache2_get());
458 else
459#endif
460 im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
436 if (!im) 461 if (!im)
437 { 462 {
438 free(obr); 463 free(obr);
439 return NULL; 464 return NULL;
440 } 465 }
441 im->cache_entry.flags.alpha |= alpha ? 1 : 0; 466 im->cache_entry.flags.alpha |= alpha ? 1 : 0;
442 evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h); 467#ifdef EVAS_CSERVE2
468 if (evas_cserve2_use_get())
469 evas_cache2_image_surface_alloc(&im->cache_entry, buf->w, buf->h);
470 else
471#endif
472 evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h);
443 im->extended_info = obr; 473 im->extended_info = obr;
444 if ((buf->rot == 0) || (buf->rot == 180)) 474 if ((buf->rot == 0) || (buf->rot == 180))
445 { 475 {
@@ -451,7 +481,14 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
451 NULL); 481 NULL);
452 if (!obr->xob) 482 if (!obr->xob)
453 { 483 {
454 evas_cache_image_drop(&im->cache_entry); 484#ifdef EVAS_CSERVE2
485 if (evas_cserve2_use_get())
486 {
487 evas_cache2_image_close(&im->cache_entry);
488 }
489 else
490#endif
491 evas_cache_image_drop(&im->cache_entry);
455 free(obr); 492 free(obr);
456 return NULL; 493 return NULL;
457 } 494 }
@@ -472,7 +509,14 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
472 NULL); 509 NULL);
473 if (!obr->xob) 510 if (!obr->xob)
474 { 511 {
475 evas_cache_image_drop(&im->cache_entry); 512#ifdef EVAS_CSERVE2
513 if (evas_cserve2_use_get())
514 {
515 evas_cache2_image_close(&im->cache_entry);
516 }
517 else
518#endif
519 evas_cache_image_drop(&im->cache_entry);
476 free(obr); 520 free(obr);
477 return NULL; 521 return NULL;
478 } 522 }
@@ -532,10 +576,18 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
532 free(obr); 576 free(obr);
533 return NULL; 577 return NULL;
534 } 578 }
535 im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), 579#ifdef EVAS_CSERVE2
536 w, h, 580 if (evas_cserve2_use_get())
537 (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl), 581 im = (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
538 alpha, EVAS_COLORSPACE_ARGB8888); 582 w, h,
583 (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl),
584 alpha, EVAS_COLORSPACE_ARGB8888);
585 else
586#endif
587 im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
588 w, h,
589 (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl),
590 alpha, EVAS_COLORSPACE_ARGB8888);
539 if (!im) 591 if (!im)
540 { 592 {
541 _unfind_xob(obr->xob, 0); 593 _unfind_xob(obr->xob, 0);
@@ -552,7 +604,12 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
552 } 604 }
553 else 605 else
554 { 606 {
555 im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); 607#ifdef EVAS_CSERVE2
608 if (evas_cserve2_use_get())
609 im = (RGBA_Image *)evas_cache2_image_empty(evas_common_image_cache2_get());
610 else
611#endif
612 im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
556 if (!im) 613 if (!im)
557 { 614 {
558 free(obr); 615 free(obr);
@@ -561,7 +618,12 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
561 im->cache_entry.w = w; 618 im->cache_entry.w = w;
562 im->cache_entry.h = h; 619 im->cache_entry.h = h;
563 im->cache_entry.flags.alpha |= alpha ? 1 : 0; 620 im->cache_entry.flags.alpha |= alpha ? 1 : 0;
564 evas_cache_image_surface_alloc(&im->cache_entry, w, h); 621#ifdef EVAS_CSERVE2
622 if (evas_cserve2_use_get())
623 evas_cache2_image_surface_alloc(&im->cache_entry, w, h);
624 else
625#endif
626 evas_cache_image_surface_alloc(&im->cache_entry, w, h);
565 im->extended_info = obr; 627 im->extended_info = obr;
566 if ((buf->rot == 0) || (buf->rot == 180)) 628 if ((buf->rot == 0) || (buf->rot == 180))
567 { 629 {
@@ -573,7 +635,14 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
573 NULL); 635 NULL);
574 if (!obr->xob) 636 if (!obr->xob)
575 { 637 {
576 evas_cache_image_drop(&im->cache_entry); 638#ifdef EVAS_CSERVE2
639 if (evas_cserve2_use_get())
640 {
641 evas_cache2_image_close(&im->cache_entry);
642 }
643 else
644#endif
645 evas_cache_image_drop(&im->cache_entry);
577 free(obr); 646 free(obr);
578 return NULL; 647 return NULL;
579 } 648 }
@@ -594,7 +663,14 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
594 NULL); 663 NULL);
595 if (!obr->xob) 664 if (!obr->xob)
596 { 665 {
597 evas_cache_image_drop(&im->cache_entry); 666#ifdef EVAS_CSERVE2
667 if (evas_cserve2_use_get())
668 {
669 evas_cache2_image_close(&im->cache_entry);
670 }
671 else
672#endif
673 evas_cache_image_drop(&im->cache_entry);
598 free(obr); 674 free(obr);
599 return NULL; 675 return NULL;
600 } 676 }
@@ -723,7 +799,14 @@ evas_software_xlib_outbuf_flush(Outbuf *buf)
723 eina_list_remove_list(buf->priv.prev_pending_writes, 799 eina_list_remove_list(buf->priv.prev_pending_writes,
724 buf->priv.prev_pending_writes); 800 buf->priv.prev_pending_writes);
725 obr = im->extended_info; 801 obr = im->extended_info;
726 evas_cache_image_drop(&im->cache_entry); 802#ifdef EVAS_CSERVE2
803 if (evas_cserve2_use_get())
804 {
805 evas_cache2_image_close(&im->cache_entry);
806 }
807 else
808#endif
809 evas_cache_image_drop(&im->cache_entry);
727 if (obr->xob) _unfind_xob(obr->xob, 0); 810 if (obr->xob) _unfind_xob(obr->xob, 0);
728 if (obr->mxob) _unfind_xob(obr->mxob, 0); 811 if (obr->mxob) _unfind_xob(obr->mxob, 0);
729 free(obr); 812 free(obr);
@@ -760,11 +843,25 @@ evas_software_xlib_outbuf_flush(Outbuf *buf)
760 im = eina_list_data_get(buf->priv.pending_writes); 843 im = eina_list_data_get(buf->priv.pending_writes);
761 buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes); 844 buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes);
762 obr = im->extended_info; 845 obr = im->extended_info;
763 evas_cache_image_drop(&im->cache_entry); 846#ifdef EVAS_CSERVE2
847 if (evas_cserve2_use_get())
848 {
849 evas_cache2_image_close(&im->cache_entry);
850 }
851 else
852#endif
853 evas_cache_image_drop(&im->cache_entry);
764 if (obr->xob) _unfind_xob(obr->xob, 0); 854 if (obr->xob) _unfind_xob(obr->xob, 0);
765 if (obr->mxob) _unfind_xob(obr->mxob, 0); 855 if (obr->mxob) _unfind_xob(obr->mxob, 0);
766 free(obr); 856 free(obr);
767 evas_cache_image_drop(&im->cache_entry); 857#ifdef EVAS_CSERVE2
858 if (evas_cserve2_use_get())
859 {
860 evas_cache2_image_close(&im->cache_entry);
861 }
862 else
863#endif
864 evas_cache_image_drop(&im->cache_entry);
768 } 865 }
769#endif 866#endif
770 } 867 }
@@ -785,7 +882,14 @@ evas_software_xlib_outbuf_idle_flush(Outbuf *buf)
785 if (obr->xob) evas_software_xlib_x_output_buffer_free(obr->xob, 0); 882 if (obr->xob) evas_software_xlib_x_output_buffer_free(obr->xob, 0);
786 if (obr->mxob) evas_software_xlib_x_output_buffer_free(obr->mxob, 0); 883 if (obr->mxob) evas_software_xlib_x_output_buffer_free(obr->mxob, 0);
787 free(obr); 884 free(obr);
788 evas_cache_image_drop(&im->cache_entry); 885#ifdef EVAS_CSERVE2
886 if (evas_cserve2_use_get())
887 {
888 evas_cache2_image_close(&im->cache_entry);
889 }
890 else
891#endif
892 evas_cache_image_drop(&im->cache_entry);
789 } 893 }
790 else 894 else
791 { 895 {
@@ -800,7 +904,14 @@ evas_software_xlib_outbuf_idle_flush(Outbuf *buf)
800 eina_list_remove_list(buf->priv.prev_pending_writes, 904 eina_list_remove_list(buf->priv.prev_pending_writes,
801 buf->priv.prev_pending_writes); 905 buf->priv.prev_pending_writes);
802 obr = im->extended_info; 906 obr = im->extended_info;
803 evas_cache_image_drop(&im->cache_entry); 907#ifdef EVAS_CSERVE2
908 if (evas_cserve2_use_get())
909 {
910 evas_cache2_image_close(&im->cache_entry);
911 }
912 else
913#endif
914 evas_cache_image_drop(&im->cache_entry);
804 if (obr->xob) _unfind_xob(obr->xob, 0); 915 if (obr->xob) _unfind_xob(obr->xob, 0);
805 if (obr->mxob) _unfind_xob(obr->mxob, 0); 916 if (obr->mxob) _unfind_xob(obr->mxob, 0);
806 free(obr); 917 free(obr);