summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-04-22 11:47:14 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-04-22 11:47:14 +0000
commitc885080057631dbb7e99b20d1f4fcc9b6076a5a7 (patch)
tree6d207c09f02db1b75f3c0549c91755659b09b357 /legacy/evas/src/lib
parent02ee0d1ee65f6a79bc2397d1b9c93e90eaa1032c (diff)
an initial test at trying pixman instead of evas software rendering.
results... in comments. disabled atm unless u --enable it. only replaces 1 operation in 2 cases. SVN revision: 58824
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/Makefile.am4
-rw-r--r--legacy/evas/src/lib/cache/Makefile.am4
-rw-r--r--legacy/evas/src/lib/canvas/Makefile.am3
-rw-r--r--legacy/evas/src/lib/cserve/Makefile.am3
-rw-r--r--legacy/evas/src/lib/engines/common/Makefile.am4
-rw-r--r--legacy/evas/src/lib/engines/common/evas_image_data.c4
-rw-r--r--legacy/evas/src/lib/engines/common/evas_image_main.c47
-rw-r--r--legacy/evas/src/lib/engines/common/evas_image_private.h4
-rw-r--r--legacy/evas/src/lib/engines/common/evas_image_scalecache.c17
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_sample.c56
-rw-r--r--legacy/evas/src/lib/engines/common_16/Makefile.am1
-rw-r--r--legacy/evas/src/lib/engines/common_8/Makefile.am1
-rw-r--r--legacy/evas/src/lib/file/Makefile.am5
-rw-r--r--legacy/evas/src/lib/include/evas_common.h10
14 files changed, 126 insertions, 37 deletions
diff --git a/legacy/evas/src/lib/Makefile.am b/legacy/evas/src/lib/Makefile.am
index f2f6041fb1..6e44840190 100644
--- a/legacy/evas/src/lib/Makefile.am
+++ b/legacy/evas/src/lib/Makefile.am
@@ -178,7 +178,8 @@ AM_CPPFLAGS = \
178@HARFBUZZ_CFLAGS@ \ 178@HARFBUZZ_CFLAGS@ \
179@EET_CFLAGS@ \ 179@EET_CFLAGS@ \
180@FONTCONFIG_CFLAGS@ \ 180@FONTCONFIG_CFLAGS@ \
181@pthread_cflags@ 181@pthread_cflags@ \
182@PIXMAN_CFLAGS@
182 183
183AM_CFLAGS = @WIN32_CFLAGS@ 184AM_CFLAGS = @WIN32_CFLAGS@
184 185
@@ -210,6 +211,7 @@ engines/common/libevas_engine_common.la \
210@EINA_LIBS@ \ 211@EINA_LIBS@ \
211$(EVAS_STATIC_MODULE) \ 212$(EVAS_STATIC_MODULE) \
212$(EVAS_STATIC_LIBADD) \ 213$(EVAS_STATIC_LIBADD) \
214@PIXMAN_LIBS@ \
213-lm 215-lm
214 216
215libevas_la_DEPENDENCIES = \ 217libevas_la_DEPENDENCIES = \
diff --git a/legacy/evas/src/lib/cache/Makefile.am b/legacy/evas/src/lib/cache/Makefile.am
index b172b4a39e..d417262baf 100644
--- a/legacy/evas/src/lib/cache/Makefile.am
+++ b/legacy/evas/src/lib/cache/Makefile.am
@@ -10,7 +10,9 @@ AM_CPPFLAGS = -I. \
10 @WIN32_CPPFLAGS@ \ 10 @WIN32_CPPFLAGS@ \
11 @EVIL_CFLAGS@ \ 11 @EVIL_CFLAGS@ \
12 @FREETYPE_CFLAGS@ \ 12 @FREETYPE_CFLAGS@ \
13 @EINA_CFLAGS@ 13 @PIXMAN_CFLAGS@ \
14 @EINA_CFLAGS@ \
15 @PIXMAN_CFLAGS@
14 16
15noinst_LTLIBRARIES = libevas_cache.la 17noinst_LTLIBRARIES = libevas_cache.la
16libevas_cache_la_SOURCES = \ 18libevas_cache_la_SOURCES = \
diff --git a/legacy/evas/src/lib/canvas/Makefile.am b/legacy/evas/src/lib/canvas/Makefile.am
index b408ec28b4..3b62505c85 100644
--- a/legacy/evas/src/lib/canvas/Makefile.am
+++ b/legacy/evas/src/lib/canvas/Makefile.am
@@ -13,7 +13,8 @@ AM_CPPFLAGS = \
13@EET_CFLAGS@ \ 13@EET_CFLAGS@ \
14@FONTCONFIG_CFLAGS@ \ 14@FONTCONFIG_CFLAGS@ \
15@EINA_CFLAGS@ \ 15@EINA_CFLAGS@ \
16@EVIL_CFLAGS@ 16@EVIL_CFLAGS@ \
17@PIXMAN_CFLAGS@
17 18
18noinst_LTLIBRARIES = libevas_canvas.la 19noinst_LTLIBRARIES = libevas_canvas.la
19libevas_canvas_la_SOURCES = \ 20libevas_canvas_la_SOURCES = \
diff --git a/legacy/evas/src/lib/cserve/Makefile.am b/legacy/evas/src/lib/cserve/Makefile.am
index 5d33c81362..6ff6e2a51d 100644
--- a/legacy/evas/src/lib/cserve/Makefile.am
+++ b/legacy/evas/src/lib/cserve/Makefile.am
@@ -13,7 +13,8 @@ AM_CPPFLAGS = \
13@FRIBIDI_CFLAGS@ \ 13@FRIBIDI_CFLAGS@ \
14@EET_CFLAGS@ \ 14@EET_CFLAGS@ \
15@FONTCONFIG_CFLAGS@ \ 15@FONTCONFIG_CFLAGS@ \
16@pthread_cflags@ 16@pthread_cflags@ \
17@PIXMAN_CFLAGS@
17 18
18if EVAS_CSERVE 19if EVAS_CSERVE
19 20
diff --git a/legacy/evas/src/lib/engines/common/Makefile.am b/legacy/evas/src/lib/engines/common/Makefile.am
index 62b96aab6b..961b20fcfa 100644
--- a/legacy/evas/src/lib/engines/common/Makefile.am
+++ b/legacy/evas/src/lib/engines/common/Makefile.am
@@ -11,9 +11,11 @@ AM_CPPFLAGS = -I. \
11 -DPACKAGE_LIB_DIR=\"$(libdir)\" \ 11 -DPACKAGE_LIB_DIR=\"$(libdir)\" \
12 -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ 12 -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
13 @FREETYPE_CFLAGS@ @VALGRIND_CFLAGS@ \ 13 @FREETYPE_CFLAGS@ @VALGRIND_CFLAGS@ \
14 @PIXMAN_CFLAGS@ \
14 @EET_CFLAGS@ @pthread_cflags@ \ 15 @EET_CFLAGS@ @pthread_cflags@ \
15 @WIN32_CFLAGS@ @EINA_CFLAGS@ \ 16 @WIN32_CFLAGS@ @EINA_CFLAGS@ \
16 @FRIBIDI_CFLAGS@ @HARFBUZZ_CFLAGS@ 17 @FRIBIDI_CFLAGS@ @HARFBUZZ_CFLAGS@ \
18 @PIXMAN_CFLAGS@
17 19
18noinst_LTLIBRARIES = libevas_engine_common.la 20noinst_LTLIBRARIES = libevas_engine_common.la
19libevas_engine_common_la_SOURCES = \ 21libevas_engine_common_la_SOURCES = \
diff --git a/legacy/evas/src/lib/engines/common/evas_image_data.c b/legacy/evas/src/lib/engines/common/evas_image_data.c
index 15ee166fa2..e5c2f6d73b 100644
--- a/legacy/evas/src/lib/engines/common/evas_image_data.c
+++ b/legacy/evas/src/lib/engines/common/evas_image_data.c
@@ -31,6 +31,7 @@ evas_common_rgba_image_from_data(Image_Entry* ie_dst, int w, int h, DATA32 *imag
31 } 31 }
32 dst->cache_entry.space = cspace; 32 dst->cache_entry.space = cspace;
33 evas_common_image_colorspace_dirty(dst); 33 evas_common_image_colorspace_dirty(dst);
34 _evas_common_rgba_image_post_surface(ie_dst);
34 return 0; 35 return 0;
35} 36}
36 37
@@ -60,6 +61,7 @@ evas_common_rgba_image_from_copied_data(Image_Entry* ie_dst, int w, int h, DATA3
60 61
61 dst->cache_entry.space = cspace; 62 dst->cache_entry.space = cspace;
62 evas_common_image_colorspace_dirty(dst); 63 evas_common_image_colorspace_dirty(dst);
64 _evas_common_rgba_image_post_surface(ie_dst);
63 return 0; 65 return 0;
64} 66}
65 67
@@ -80,6 +82,7 @@ evas_common_rgba_image_size_set(Image_Entry *ie_dst, const Image_Entry *ie_im, u
80 dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char *) * 2); 82 dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char *) * 2);
81 evas_common_image_colorspace_dirty(dst); 83 evas_common_image_colorspace_dirty(dst);
82 84
85 _evas_common_rgba_image_post_surface(ie_dst);
83 return 0; 86 return 0;
84} 87}
85 88
@@ -126,5 +129,6 @@ evas_common_rgba_image_colorspace_set(Image_Entry* ie_dst, int cspace)
126 dst->cache_entry.space = cspace; 129 dst->cache_entry.space = cspace;
127 evas_common_image_colorspace_dirty(dst); 130 evas_common_image_colorspace_dirty(dst);
128 131
132 _evas_common_rgba_image_post_surface(ie_dst);
129 return 0; 133 return 0;
130} 134}
diff --git a/legacy/evas/src/lib/engines/common/evas_image_main.c b/legacy/evas/src/lib/engines/common/evas_image_main.c
index 03a06f2227..caf20a5f9c 100644
--- a/legacy/evas/src/lib/engines/common/evas_image_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_image_main.c
@@ -144,6 +144,7 @@ _evas_common_rgba_image_new(void)
144#endif 144#endif
145 145
146 evas_common_rgba_image_scalecache_init(&im->cache_entry); 146 evas_common_rgba_image_scalecache_init(&im->cache_entry);
147
147 return &im->cache_entry; 148 return &im->cache_entry;
148} 149}
149 150
@@ -246,6 +247,42 @@ evas_common_rgba_image_unload(Image_Entry *ie)
246#endif 247#endif
247} 248}
248 249
250void
251_evas_common_rgba_image_post_surface(Image_Entry *ie)
252{
253#ifdef HAVE_PIXMAN
254 RGBA_Image *im = (RGBA_Image *) ie;
255
256 if (im->pixman.im) pixman_image_unref(im->pixman.im);
257 if (im->cache_entry.flags.alpha)
258 {
259 im->pixman.im = pixman_image_create_bits
260 (
261// FIXME: endianess determines this
262 PIXMAN_a8r8g8b8,
263// PIXMAN_b8g8r8a8,
264 im->cache_entry.w, im->cache_entry.h,
265 im->image.data,
266 im->cache_entry.w * 4
267 );
268 }
269 else
270 {
271 im->pixman.im = pixman_image_create_bits
272 (
273// FIXME: endianess determines this
274 PIXMAN_x8r8g8b8,
275// PIXMAN_b8g8r8x8,
276 im->cache_entry.w, im->cache_entry.h,
277 im->image.data,
278 im->cache_entry.w * 4
279 );
280 }
281#else
282 ie = NULL;
283#endif
284}
285
249static int 286static int
250_evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned int h) 287_evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned int h)
251{ 288{
@@ -275,7 +312,8 @@ _evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned
275# endif 312# endif
276# endif 313# endif
277#endif 314#endif
278 315 _evas_common_rgba_image_post_surface(ie);
316
279 return 0; 317 return 0;
280} 318}
281 319
@@ -284,6 +322,13 @@ _evas_common_rgba_image_surface_delete(Image_Entry *ie)
284{ 322{
285 RGBA_Image *im = (RGBA_Image *) ie; 323 RGBA_Image *im = (RGBA_Image *) ie;
286 324
325#ifdef HAVE_PIXMAN
326 if (im->pixman.im)
327 {
328 pixman_image_unref(im->pixman.im);
329 im->pixman.im = NULL;
330 }
331#endif
287 if (ie->file) 332 if (ie->file)
288 DBG("unload: [%p] %s %s", ie, ie->file, ie->key); 333 DBG("unload: [%p] %s %s", ie, ie->file, ie->key);
289 if ((im->cs.data) && (im->image.data)) 334 if ((im->cs.data) && (im->image.data))
diff --git a/legacy/evas/src/lib/engines/common/evas_image_private.h b/legacy/evas/src/lib/engines/common/evas_image_private.h
index d9aeea795d..cf613696fd 100644
--- a/legacy/evas/src/lib/engines/common/evas_image_private.h
+++ b/legacy/evas/src/lib/engines/common/evas_image_private.h
@@ -13,5 +13,7 @@ void evas_common_rgba_image_scalecache_shutdown(Image_Entry *ie);
13void evas_common_rgba_image_scalecache_dirty(Image_Entry *ie); 13void evas_common_rgba_image_scalecache_dirty(Image_Entry *ie);
14void evas_common_rgba_image_scalecache_orig_use(Image_Entry *ie); 14void evas_common_rgba_image_scalecache_orig_use(Image_Entry *ie);
15int evas_common_rgba_image_scalecache_usage_get(Image_Entry *ie); 15int evas_common_rgba_image_scalecache_usage_get(Image_Entry *ie);
16 16
17void _evas_common_rgba_image_post_surface(Image_Entry *ie);
18
17#endif /* _EVAS_IMAGE_PRIVATE_H */ 19#endif /* _EVAS_IMAGE_PRIVATE_H */
diff --git a/legacy/evas/src/lib/engines/common/evas_image_scalecache.c b/legacy/evas/src/lib/engines/common/evas_image_scalecache.c
index 63d4c47eb3..dc9ade6a19 100644
--- a/legacy/evas/src/lib/engines/common/evas_image_scalecache.c
+++ b/legacy/evas/src/lib/engines/common/evas_image_scalecache.c
@@ -518,18 +518,11 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
518 LKU(im->cache.lock); 518 LKU(im->cache.lock);
519 if (im->image.data) 519 if (im->image.data)
520 { 520 {
521 if (smooth) 521 evas_common_scale_rgba_in_to_out_clip_sample(im, dst, dc,
522 evas_common_scale_rgba_in_to_out_clip_smooth(im, dst, dc, 522 src_region_x, src_region_y,
523 src_region_x, src_region_y, 523 src_region_w, src_region_h,
524 src_region_w, src_region_h, 524 dst_region_x, dst_region_y,
525 dst_region_x, dst_region_y, 525 dst_region_w, dst_region_h);
526 dst_region_w, dst_region_h);
527 else
528 evas_common_scale_rgba_in_to_out_clip_sample(im, dst, dc,
529 src_region_x, src_region_y,
530 src_region_w, src_region_h,
531 dst_region_x, dst_region_y,
532 dst_region_w, dst_region_h);
533 } 526 }
534 return; 527 return;
535 } 528 }
diff --git a/legacy/evas/src/lib/engines/common/evas_scale_sample.c b/legacy/evas/src/lib/engines/common/evas_scale_sample.c
index 9eefe14c4e..68d9e4990d 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_sample.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_sample.c
@@ -257,24 +257,48 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
257 257
258 if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h)) 258 if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h))
259 { 259 {
260 ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x; 260#ifdef HAVE_PIXMAN
261 for (y = 0; y < dst_clip_h; y++) 261 if ((1) &&
262 { 262 (src->pixman.im) && (dst->pixman.im) &&
263 /* * blend here [clip_w *] ptr -> dst_ptr * */ 263 ((!dc->mul.use) ||
264 if (mask) 264 ((dc->mul.use) && (dc->mul.col == 0xffffffff))) &&
265 { 265 ((dc->render_op == _EVAS_RENDER_COPY) ||
266 mask += dst_clip_x - dc->mask.x; 266 (dc->render_op == _EVAS_RENDER_BLEND))
267 mask += (dst_clip_y - dc->mask.y) * maskobj->cache_entry.w; 267 )
268 } 268 {
269 pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
270 if (dc->render_op == _EVAS_RENDER_BLEND) op = PIXMAN_OP_OVER;
271 pixman_image_composite(op,
272 src->pixman.im, NULL,
273 dst->pixman.im,
274 (dst_clip_x - dst_region_x) + src_region_x,
275 (dst_clip_y - dst_region_y) + src_region_y,
276 0, 0,
277 dst_clip_x, dst_clip_y,
278 dst_clip_w, dst_clip_h);
279 }
280 else
281#endif
282 {
283 ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
284 for (y = 0; y < dst_clip_h; y++)
285 {
286 /* * blend here [clip_w *] ptr -> dst_ptr * */
287 if (mask)
288 {
289 mask += dst_clip_x - dc->mask.x;
290 mask += (dst_clip_y - dc->mask.y) * maskobj->cache_entry.w;
291 }
269#ifdef EVAS_SLI 292#ifdef EVAS_SLI
270 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y) 293 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
271#endif 294#endif
272 { 295 {
273 func(ptr, mask, dc->mul.col, dst_ptr, dst_clip_w); 296 func(ptr, mask, dc->mul.col, dst_ptr, dst_clip_w);
274 } 297 }
275 ptr += src_w; 298 ptr += src_w;
276 dst_ptr += dst_w; 299 dst_ptr += dst_w;
277 if (mask) mask += maskobj->cache_entry.w; 300 if (mask) mask += maskobj->cache_entry.w;
301 }
278 } 302 }
279 } 303 }
280 else 304 else
diff --git a/legacy/evas/src/lib/engines/common_16/Makefile.am b/legacy/evas/src/lib/engines/common_16/Makefile.am
index c7579fc99f..ef2ab305e4 100644
--- a/legacy/evas/src/lib/engines/common_16/Makefile.am
+++ b/legacy/evas/src/lib/engines/common_16/Makefile.am
@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
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@FREETYPE_CFLAGS@ \ 8@FREETYPE_CFLAGS@ \
9@PIXMAN_CFLAGS@ \
9@VALGRIND_CFLAGS@ \ 10@VALGRIND_CFLAGS@ \
10@EINA_CFLAGS@ \ 11@EINA_CFLAGS@ \
11@EET_CFLAGS@ \ 12@EET_CFLAGS@ \
diff --git a/legacy/evas/src/lib/engines/common_8/Makefile.am b/legacy/evas/src/lib/engines/common_8/Makefile.am
index 5fdd086f97..58a1b1f8e2 100644
--- a/legacy/evas/src/lib/engines/common_8/Makefile.am
+++ b/legacy/evas/src/lib/engines/common_8/Makefile.am
@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
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@FREETYPE_CFLAGS@ \ 8@FREETYPE_CFLAGS@ \
9@PIXMAN_CFLAGS@ \
9@VALGRIND_CFLAGS@ \ 10@VALGRIND_CFLAGS@ \
10@EINA_CFLAGS@ \ 11@EINA_CFLAGS@ \
11@EET_CFLAGS@ \ 12@EET_CFLAGS@ \
diff --git a/legacy/evas/src/lib/file/Makefile.am b/legacy/evas/src/lib/file/Makefile.am
index 8d0ee97517..7875fbe7e2 100644
--- a/legacy/evas/src/lib/file/Makefile.am
+++ b/legacy/evas/src/lib/file/Makefile.am
@@ -11,8 +11,9 @@ AM_CPPFLAGS = \
11@FREETYPE_CFLAGS@ \ 11@FREETYPE_CFLAGS@ \
12@EINA_CFLAGS@ \ 12@EINA_CFLAGS@ \
13@EVIL_CFLAGS@ \ 13@EVIL_CFLAGS@ \
14@WIN32_CPPFLAGS@ 14@WIN32_CPPFLAGS@ \
15 15@PIXMAN_CFLAGS@
16
16AM_CFLAGS = @WIN32_CFLAGS@ 17AM_CFLAGS = @WIN32_CFLAGS@
17 18
18noinst_LTLIBRARIES = libevas_file.la 19noinst_LTLIBRARIES = libevas_file.la
diff --git a/legacy/evas/src/lib/include/evas_common.h b/legacy/evas/src/lib/include/evas_common.h
index 74077d891a..7fa2b97489 100644
--- a/legacy/evas/src/lib/include/evas_common.h
+++ b/legacy/evas/src/lib/include/evas_common.h
@@ -13,6 +13,10 @@
13#include "Evas.h" 13#include "Evas.h"
14#include "Evas_GL.h" 14#include "Evas_GL.h"
15 15
16#ifdef HAVE_PIXMAN
17#include <pixman.h>
18#endif
19
16#include <sys/types.h> 20#include <sys/types.h>
17#include <sys/stat.h> 21#include <sys/stat.h>
18#include <unistd.h> 22#include <unistd.h>
@@ -819,6 +823,12 @@ struct _RGBA_Image
819 unsigned long long newest_usage; 823 unsigned long long newest_usage;
820 unsigned long long newest_usage_count; 824 unsigned long long newest_usage_count;
821 } cache; 825 } cache;
826
827#ifdef HAVE_PIXMAN
828 struct {
829 pixman_image_t *im;
830 } pixman;
831#endif
822}; 832};
823 833
824struct _RGBA_Polygon_Point 834struct _RGBA_Polygon_Point