summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2008-04-12 00:32:30 +0000
committerCarsten Haitzler <raster@rasterman.com>2008-04-12 00:32:30 +0000
commitae1977a214c227695564909094cf8e6184704d0a (patch)
treec9a02bc1a359c504bb6fb54837e5b069e9bf70f4 /legacy/evas/src/lib/engines/common
parentc290fa032dd5b431f1c5b816cdf4f35525f21dec (diff)
cedric's cache changes patch
SVN revision: 34253
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_blit_main.c22
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_draw.c6
-rw-r--r--legacy/evas/src/lib/engines/common/evas_gradient_main.c18
-rw-r--r--legacy/evas/src/lib/engines/common/evas_image_data.c73
-rw-r--r--legacy/evas/src/lib/engines/common/evas_image_load.c56
-rw-r--r--legacy/evas/src/lib/engines/common/evas_image_main.c342
-rw-r--r--legacy/evas/src/lib/engines/common/evas_line_main.c26
-rw-r--r--legacy/evas/src/lib/engines/common/evas_pipe.c12
-rw-r--r--legacy/evas/src/lib/engines/common/evas_polygon_main.c6
-rw-r--r--legacy/evas/src/lib/engines/common/evas_rectangle_main.c8
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_sample.c20
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_smooth.c4
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler.c14
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c2
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_noscale.c2
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_up.c10
16 files changed, 311 insertions, 310 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_blit_main.c b/legacy/evas/src/lib/engines/common/evas_blit_main.c
index 637924b11a..208f4351ef 100644
--- a/legacy/evas/src/lib/engines/common/evas_blit_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_blit_main.c
@@ -32,7 +32,7 @@ evas_common_blit_rectangle(const RGBA_Image *src, RGBA_Image *dst, int src_x, in
32 32
33 /* clip clip clip */ 33 /* clip clip clip */
34 if (w <= 0) return; 34 if (w <= 0) return;
35 if (src_x + w > src->image->w) w = src->image->w - src_x; 35 if (src_x + w > src->cache_entry.w) w = src->cache_entry.w - src_x;
36 if (w <= 0) return; 36 if (w <= 0) return;
37 if (src_x < 0) 37 if (src_x < 0)
38 { 38 {
@@ -43,7 +43,7 @@ evas_common_blit_rectangle(const RGBA_Image *src, RGBA_Image *dst, int src_x, in
43 if (w <= 0) return; 43 if (w <= 0) return;
44 44
45 if (h <= 0) return; 45 if (h <= 0) return;
46 if (src_y + h > src->image->h) h = src->image->h - src_y; 46 if (src_y + h > src->cache_entry.h) h = src->cache_entry.h - src_y;
47 if (h <= 0) return; 47 if (h <= 0) return;
48 if (src_y < 0) 48 if (src_y < 0)
49 { 49 {
@@ -54,7 +54,7 @@ evas_common_blit_rectangle(const RGBA_Image *src, RGBA_Image *dst, int src_x, in
54 if (h <= 0) return; 54 if (h <= 0) return;
55 55
56 if (w <= 0) return; 56 if (w <= 0) return;
57 if (dst_x + w > dst->image->w) w = dst->image->w - dst_x; 57 if (dst_x + w > dst->cache_entry.w) w = dst->cache_entry.w - dst_x;
58 if (w <= 0) return; 58 if (w <= 0) return;
59 if (dst_x < 0) 59 if (dst_x < 0)
60 { 60 {
@@ -65,7 +65,7 @@ evas_common_blit_rectangle(const RGBA_Image *src, RGBA_Image *dst, int src_x, in
65 if (w <= 0) return; 65 if (w <= 0) return;
66 66
67 if (h <= 0) return; 67 if (h <= 0) return;
68 if (dst_y + h > dst->image->h) h = dst->image->h - dst_y; 68 if (dst_y + h > dst->cache_entry.h) h = dst->cache_entry.h - dst_y;
69 if (h <= 0) return; 69 if (h <= 0) return;
70 if (dst_y < 0) 70 if (dst_y < 0)
71 { 71 {
@@ -78,13 +78,13 @@ evas_common_blit_rectangle(const RGBA_Image *src, RGBA_Image *dst, int src_x, in
78 if (dst == src) 78 if (dst == src)
79 { 79 {
80 /* src after dst - go forward */ 80 /* src after dst - go forward */
81 if (((src_y * src->image->w) + src_x) > ((dst_y * dst->image->w) + dst_x)) 81 if (((src_y * src->cache_entry.w) + src_x) > ((dst_y * dst->cache_entry.w) + dst_x))
82 { 82 {
83 func = evas_common_draw_func_copy_get(w, 0); 83 func = evas_common_draw_func_copy_get(w, 0);
84 for (y = 0; y < h; y++) 84 for (y = 0; y < h; y++)
85 { 85 {
86 src_ptr = src->image->data + ((y + src_y) * src->image->w) + src_x; 86 src_ptr = src->image.data + ((y + src_y) * src->cache_entry.w) + src_x;
87 dst_ptr = dst->image->data + ((y + dst_y) * dst->image->w) + dst_x; 87 dst_ptr = dst->image.data + ((y + dst_y) * dst->cache_entry.w) + dst_x;
88 func(src_ptr, dst_ptr, w); 88 func(src_ptr, dst_ptr, w);
89 } 89 }
90 } 90 }
@@ -94,8 +94,8 @@ evas_common_blit_rectangle(const RGBA_Image *src, RGBA_Image *dst, int src_x, in
94 func = evas_common_draw_func_copy_get(w, 1); 94 func = evas_common_draw_func_copy_get(w, 1);
95 for (y = h - 1; y >= 0; y--) 95 for (y = h - 1; y >= 0; y--)
96 { 96 {
97 src_ptr = src->image->data + ((y + src_y) * src->image->w) + src_x; 97 src_ptr = src->image.data + ((y + src_y) * src->cache_entry.w) + src_x;
98 dst_ptr = dst->image->data + ((y + dst_y) * dst->image->w) + dst_x; 98 dst_ptr = dst->image.data + ((y + dst_y) * dst->cache_entry.w) + dst_x;
99 func(src_ptr, dst_ptr, w); 99 func(src_ptr, dst_ptr, w);
100 } 100 }
101 } 101 }
@@ -105,8 +105,8 @@ evas_common_blit_rectangle(const RGBA_Image *src, RGBA_Image *dst, int src_x, in
105 func = evas_common_draw_func_copy_get(w, 0); 105 func = evas_common_draw_func_copy_get(w, 0);
106 for (y = 0; y < h; y++) 106 for (y = 0; y < h; y++)
107 { 107 {
108 src_ptr = src->image->data + ((y + src_y) * src->image->w) + src_x; 108 src_ptr = src->image.data + ((y + src_y) * src->cache_entry.w) + src_x;
109 dst_ptr = dst->image->data + ((y + dst_y) * dst->image->w) + dst_x; 109 dst_ptr = dst->image.data + ((y + dst_y) * dst->cache_entry.w) + dst_x;
110 func(src_ptr, dst_ptr, w); 110 func(src_ptr, dst_ptr, w);
111 } 111 }
112 } 112 }
diff --git a/legacy/evas/src/lib/engines/common/evas_font_draw.c b/legacy/evas/src/lib/engines/common/evas_font_draw.c
index 21246e3765..058d430f72 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_draw.c
+++ b/legacy/evas/src/lib/engines/common/evas_font_draw.c
@@ -146,9 +146,9 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int
146 146
147 fi = fn->fonts->data; 147 fi = fn->fonts->data;
148 148
149 im = dst->image->data; 149 im = dst->image.data;
150 im_w = dst->image->w; 150 im_w = dst->cache_entry.w;
151 im_h = dst->image->h; 151 im_h = dst->cache_entry.h;
152 152
153 ext_x = 0; ext_y = 0; ext_w = im_w; ext_h = im_h; 153 ext_x = 0; ext_y = 0; ext_w = im_w; ext_h = im_h;
154 if (dc->clip.use) 154 if (dc->clip.use)
diff --git a/legacy/evas/src/lib/engines/common/evas_gradient_main.c b/legacy/evas/src/lib/engines/common/evas_gradient_main.c
index 00dbc7e3e6..3df3e2c279 100644
--- a/legacy/evas/src/lib/engines/common/evas_gradient_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_gradient_main.c
@@ -432,7 +432,7 @@ evas_common_gradient_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
432 float angle; 432 float angle;
433 int direct_copy = 0, buf_step = 0; 433 int direct_copy = 0, buf_step = 0;
434 434
435 if (!dst || !dc || !gr || !dst || !dst->image || !dst->image->data) 435 if (!dst || !dc || !gr || !dst || !dst->image.data)
436 return; 436 return;
437 if (!gr->map.data || !gr->type.geometer) 437 if (!gr->map.data || !gr->type.geometer)
438 return; 438 return;
@@ -440,7 +440,7 @@ evas_common_gradient_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
440 return; 440 return;
441 if ((w < 1) || (h < 1)) 441 if ((w < 1) || (h < 1))
442 return; 442 return;
443 clx = 0; cly = 0; clw = dst->image->w; clh = dst->image->h; 443 clx = 0; cly = 0; clw = dst->cache_entry.w; clh = dst->cache_entry.h;
444 if ((clw < 1) || (clh < 1)) return; 444 if ((clw < 1) || (clh < 1)) return;
445 445
446 if (dc->clip.use) 446 if (dc->clip.use)
@@ -459,14 +459,14 @@ evas_common_gradient_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
459 if ((dc->render_op == _EVAS_RENDER_FILL) || 459 if ((dc->render_op == _EVAS_RENDER_FILL) ||
460 (dc->render_op == _EVAS_RENDER_COPY)) 460 (dc->render_op == _EVAS_RENDER_COPY))
461 { 461 {
462 direct_copy = 1; buf_step = dst->image->w; 462 direct_copy = 1; buf_step = dst->cache_entry.w;
463 if (gr->type.geometer->has_alpha(gr, dc->render_op)) 463 if (gr->type.geometer->has_alpha(gr, dc->render_op))
464 dst->flags |= RGBA_IMAGE_HAS_ALPHA; 464 dst->flags |= RGBA_IMAGE_HAS_ALPHA;
465 } 465 }
466 else if ((dc->render_op == _EVAS_RENDER_BLEND) && 466 else if ((dc->render_op == _EVAS_RENDER_BLEND) &&
467 !gr->type.geometer->has_alpha(gr, dc->render_op)) 467 !gr->type.geometer->has_alpha(gr, dc->render_op))
468 { 468 {
469 direct_copy = 1; buf_step = dst->image->w; 469 direct_copy = 1; buf_step = dst->cache_entry.w;
470 } 470 }
471 } 471 }
472 if (!direct_copy) 472 if (!direct_copy)
@@ -514,13 +514,13 @@ evas_common_gradient_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
514 514
515 map = gr->map.data; 515 map = gr->map.data;
516 len = gr->map.len; 516 len = gr->map.len;
517 pdst = dst->image->data + (y * dst->image->w) + x; 517 pdst = dst->image.data + (y * dst->cache_entry.w) + x;
518 dst_end = pdst + (h * dst->image->w); 518 dst_end = pdst + (h * dst->cache_entry.w);
519 if (!direct_copy) 519 if (!direct_copy)
520 { 520 {
521 buf = argb_buf->image->data; 521 buf = argb_buf->image.data;
522 if (alpha_buf) 522 if (alpha_buf)
523 mask = (DATA8 *)alpha_buf->image->data; 523 mask = (DATA8 *)alpha_buf->image.data;
524 } 524 }
525 else 525 else
526 buf = pdst; 526 buf = pdst;
@@ -536,7 +536,7 @@ evas_common_gradient_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
536 evas_common_cpu_end_opt(); 536 evas_common_cpu_end_opt();
537 } 537 }
538 buf += buf_step; 538 buf += buf_step;
539 pdst += dst->image->w; 539 pdst += dst->cache_entry.w;
540 yoff++; 540 yoff++;
541 } 541 }
542 542
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 3fcab35ad0..27e51b6616 100644
--- a/legacy/evas/src/lib/engines/common/evas_image_data.c
+++ b/legacy/evas/src/lib/engines/common/evas_image_data.c
@@ -3,16 +3,18 @@
3 3
4#include <assert.h> 4#include <assert.h>
5 5
6EAPI int 6int
7evas_common_image_from_data(RGBA_Image* dst, int w, int h, DATA32 *image_data, int alpha, int cspace) 7evas_common_rgba_image_from_data(Image_Entry* ie_dst, int w, int h, DATA32 *image_data, int alpha, int cspace)
8{ 8{
9 RGBA_Image *dst = (RGBA_Image *) ie_dst;
10
9 switch (cspace) 11 switch (cspace)
10 { 12 {
11 case EVAS_COLORSPACE_ARGB8888: 13 case EVAS_COLORSPACE_ARGB8888:
12 dst->image->w = w; 14 dst->cache_entry.w = w;
13 dst->image->h = h; 15 dst->cache_entry.h = h;
14 dst->image->data = image_data; 16 dst->image.data = image_data;
15 dst->image->no_free = 1; 17 dst->image.no_free = 1;
16 if (alpha) 18 if (alpha)
17 dst->flags |= RGBA_IMAGE_HAS_ALPHA; 19 dst->flags |= RGBA_IMAGE_HAS_ALPHA;
18 else 20 else
@@ -21,9 +23,8 @@ evas_common_image_from_data(RGBA_Image* dst, int w, int h, DATA32 *image_data, i
21 case EVAS_COLORSPACE_YCBCR422P601_PL: 23 case EVAS_COLORSPACE_YCBCR422P601_PL:
22 case EVAS_COLORSPACE_YCBCR422P709_PL: 24 case EVAS_COLORSPACE_YCBCR422P709_PL:
23 w &= ~0x1; 25 w &= ~0x1;
24 dst->image->w = w; 26 dst->cache_entry.w = w;
25 dst->image->h = h; 27 dst->cache_entry.h = h;
26 evas_common_image_surface_alloc(dst->image);
27 dst->cs.data = image_data; 28 dst->cs.data = image_data;
28 dst->cs.no_free = 1; 29 dst->cs.no_free = 1;
29 break; 30 break;
@@ -31,14 +32,17 @@ evas_common_image_from_data(RGBA_Image* dst, int w, int h, DATA32 *image_data, i
31 abort(); 32 abort();
32 break; 33 break;
33 } 34 }
34 dst->cs.space = cspace; 35 dst->cache_entry.space = cspace;
35 evas_common_image_colorspace_dirty(dst); 36 evas_common_image_colorspace_dirty(dst);
36 return 0; 37 return 0;
37} 38}
38 39
39EAPI int 40int
40evas_common_image_from_copied_data(RGBA_Image* dst, int w, int h, DATA32 *image_data, int alpha, int cspace) 41evas_common_rgba_image_from_copied_data(Image_Entry* ie_dst, int w, int h, DATA32 *image_data, int alpha, int cspace)
41{ 42{
43 RGBA_Image *dst = (RGBA_Image *) ie_dst;
44
45 /* FIXME: Is dst->image.data valid. */
42 switch (cspace) 46 switch (cspace)
43 { 47 {
44 case EVAS_COLORSPACE_ARGB8888: 48 case EVAS_COLORSPACE_ARGB8888:
@@ -47,46 +51,49 @@ evas_common_image_from_copied_data(RGBA_Image* dst, int w, int h, DATA32 *image_
47 else 51 else
48 dst->flags &= ~RGBA_IMAGE_HAS_ALPHA; 52 dst->flags &= ~RGBA_IMAGE_HAS_ALPHA;
49 if (image_data) 53 if (image_data)
50 memcpy(dst->image->data, image_data, w * h * sizeof(DATA32)); 54 memcpy(dst->image.data, image_data, w * h * sizeof(DATA32));
51 break; 55 break;
52 case EVAS_COLORSPACE_YCBCR422P601_PL: 56 case EVAS_COLORSPACE_YCBCR422P601_PL:
53 case EVAS_COLORSPACE_YCBCR422P709_PL: 57 case EVAS_COLORSPACE_YCBCR422P709_PL:
54 dst->cs.data = calloc(1, dst->image->h * sizeof(unsigned char*) * 2); 58 dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char*) * 2);
55 if (image_data && (dst->cs.data)) 59 if (image_data && (dst->cs.data))
56 memcpy(dst->cs.data, image_data, dst->image->h * sizeof(unsigned char*) * 2); 60 memcpy(dst->cs.data, image_data, dst->cache_entry.h * sizeof(unsigned char*) * 2);
57 break; 61 break;
58 default: 62 default:
59 abort(); 63 abort();
60 break; 64 break;
61 } 65 }
62 66
63 dst->cs.space = cspace; 67 dst->cache_entry.space = cspace;
64 evas_common_image_colorspace_dirty(dst); 68 evas_common_image_colorspace_dirty(dst);
65 return 0; 69 return 0;
66} 70}
67 71
68EAPI int 72int
69evas_common_image_size_set(RGBA_Image* dst, const RGBA_Image* im, int w, int h) 73evas_common_rgba_image_size_set(Image_Entry *ie_dst, const Image_Entry *ie_im, int w, int h)
70{ 74{
71 if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) || 75 RGBA_Image *dst = (RGBA_Image *) ie_dst;
72 (im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL)) 76 RGBA_Image *im = (RGBA_Image *) ie_im;
77
78 if ((im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
79 (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P709_PL))
73 w &= ~0x1; 80 w &= ~0x1;
74 81
75 dst->cs.space = im->cs.space;
76 dst->flags = im->flags; 82 dst->flags = im->flags;
77 dst->cs.no_free = 0; 83 dst->cs.no_free = 0;
78 if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) || 84 if ((im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
79 (im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL)) 85 (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P709_PL))
80 dst->cs.data = calloc(1, dst->image->h * sizeof(unsigned char *) * 2); 86 dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char *) * 2);
81 evas_common_image_surface_alloc(dst->image);
82 evas_common_image_colorspace_dirty(dst); 87 evas_common_image_colorspace_dirty(dst);
83 88
84 return 0; 89 return 0;
85} 90}
86 91
87EAPI int 92int
88evas_common_image_colorspace_set(RGBA_Image* dst, int cspace) 93evas_common_rgba_image_colorspace_set(Image_Entry* ie_dst, int cspace)
89{ 94{
95 RGBA_Image *dst = (RGBA_Image *) ie_dst;
96
90 switch (cspace) 97 switch (cspace)
91 { 98 {
92 case EVAS_COLORSPACE_ARGB8888: 99 case EVAS_COLORSPACE_ARGB8888:
@@ -99,24 +106,24 @@ evas_common_image_colorspace_set(RGBA_Image* dst, int cspace)
99 break; 106 break;
100 case EVAS_COLORSPACE_YCBCR422P601_PL: 107 case EVAS_COLORSPACE_YCBCR422P601_PL:
101 case EVAS_COLORSPACE_YCBCR422P709_PL: 108 case EVAS_COLORSPACE_YCBCR422P709_PL:
102 if (dst->image->no_free) 109 if (dst->image.no_free)
103 { 110 {
104 dst->image->data = NULL; 111 dst->image.data = NULL;
105 dst->image->no_free = 0; 112 dst->image.no_free = 0;
106 evas_common_image_surface_alloc(dst->image); 113 /* FIXME: Must allocate image.data surface cleanly. */
107 } 114 }
108 if (dst->cs.data) 115 if (dst->cs.data)
109 { 116 {
110 if (!dst->cs.no_free) free(dst->cs.data); 117 if (!dst->cs.no_free) free(dst->cs.data);
111 } 118 }
112 dst->cs.data = calloc(1, dst->image->h * sizeof(unsigned char *) * 2); 119 dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char *) * 2);
113 dst->cs.no_free = 0; 120 dst->cs.no_free = 0;
114 break; 121 break;
115 default: 122 default:
116 abort(); 123 abort();
117 break; 124 break;
118 } 125 }
119 dst->cs.space = cspace; 126 dst->cache_entry.space = cspace;
120 evas_common_image_colorspace_dirty(dst); 127 evas_common_image_colorspace_dirty(dst);
121 128
122 return 0; 129 return 0;
diff --git a/legacy/evas/src/lib/engines/common/evas_image_load.c b/legacy/evas/src/lib/engines/common/evas_image_load.c
index 1b41e61db6..7b80ecf74c 100644
--- a/legacy/evas/src/lib/engines/common/evas_image_load.c
+++ b/legacy/evas/src/lib/engines/common/evas_image_load.c
@@ -29,17 +29,18 @@ static struct ext_loader_s loaders[] = {
29 { "pnm", "pmaps" } 29 { "pnm", "pmaps" }
30}; 30};
31 31
32EAPI int 32int
33evas_common_load_image_module_from_file(RGBA_Image *im) 33evas_common_load_rgba_image_module_from_file(Image_Entry *ie)
34{ 34{
35 Evas_Image_Load_Func *evas_image_load_func = NULL; 35 Evas_Image_Load_Func *evas_image_load_func = NULL;
36 RGBA_Image *im = (RGBA_Image *) ie;
36 const char *loader = NULL; 37 const char *loader = NULL;
37 char *dot;
38 Evas_List *l; 38 Evas_List *l;
39 Evas_Module *em; 39 Evas_Module *em;
40 int i; 40 char *dot;
41 int i;
41 42
42 dot = strrchr (im->info.file, '.'); 43 dot = strrchr (ie->file, '.');
43 if (dot) 44 if (dot)
44 { 45 {
45 for (i = 0, ++dot; i < (sizeof (loaders) / sizeof (struct ext_loader_s)); ++i) 46 for (i = 0, ++dot; i < (sizeof (loaders) / sizeof (struct ext_loader_s)); ++i)
@@ -61,7 +62,7 @@ evas_common_load_image_module_from_file(RGBA_Image *im)
61 { 62 {
62 evas_module_use(em); 63 evas_module_use(em);
63 evas_image_load_func = em->functions; 64 evas_image_load_func = em->functions;
64 if (evas_image_load_func->file_head(im, im->info.file, im->info.key)) 65 if (evas_image_load_func->file_head(im, ie->file, ie->key))
65 goto ok; 66 goto ok;
66 } 67 }
67 } 68 }
@@ -74,7 +75,7 @@ evas_common_load_image_module_from_file(RGBA_Image *im)
74 if (!evas_module_load(em)) continue; 75 if (!evas_module_load(em)) continue;
75 evas_image_load_func = em->functions; 76 evas_image_load_func = em->functions;
76 evas_module_use(em); 77 evas_module_use(em);
77 if (evas_image_load_func->file_head(im, im->info.file, im->info.key)) 78 if (evas_image_load_func->file_head(im, ie->file, ie->key))
78 { 79 {
79 if (evas_modules != l) 80 if (evas_modules != l)
80 { 81 {
@@ -87,39 +88,28 @@ evas_common_load_image_module_from_file(RGBA_Image *im)
87 return -1; 88 return -1;
88 89
89 ok: 90 ok:
90 im->info.module = (void *)em; 91 im->info.module = (void*) em;
91 im->info.loader = (void *)evas_image_load_func; 92 im->info.loader = (void*) evas_image_load_func;
92 evas_module_ref((Evas_Module *)im->info.module); 93 evas_module_ref((Evas_Module*) im->info.module);
93 return 0; 94 return 0;
94} 95}
95 96
96EAPI void 97int
97evas_common_load_image_data_from_file(RGBA_Image *im) 98evas_common_load_rgba_image_data_from_file(Image_Entry *ie)
98{ 99{
99 Evas_Image_Load_Func *evas_image_load_func = NULL; 100 Evas_Image_Load_Func *evas_image_load_func = NULL;
101 RGBA_Image *im = (RGBA_Image *) ie;
100 102
101 if ((im->flags & RGBA_IMAGE_LOADED) == RGBA_IMAGE_LOADED) return; 103 if (!im->info.module) return -1;
102 if (!im->info.module) return; 104 if (ie->flags.loaded) return -1;
103 105
104 evas_image_load_func = im->info.loader; 106 evas_image_load_func = im->info.loader;
105 evas_module_use((Evas_Module *)im->info.module); 107 evas_module_use((Evas_Module*) im->info.module);
106 if (!evas_image_load_func->file_data(im, im->info.file, im->info.key)) 108 if (!evas_image_load_func->file_data(im, ie->file, ie->key))
107 { 109 return -1;
108 if (!im->image->data) evas_common_image_surface_alloc(im->image);
109 if (!im->image->data)
110 {
111 const DATA32 pixel = 0xffffffff;
112 110
113 im->image->w = 1; 111 evas_module_unref((Evas_Module*) im->info.module);
114 im->image->h = 1; 112 im->info.module = NULL;
115 im->image->data = (DATA32 *)&pixel; 113
116 im->image->no_free = 1; 114 return 0;
117 }
118 }
119 else
120 {
121 evas_module_unref((Evas_Module *)im->info.module);
122 im->info.module = NULL;
123 }
124 im->flags |= RGBA_IMAGE_LOADED;
125} 115}
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 a7b3c27462..64695fd553 100644
--- a/legacy/evas/src/lib/engines/common/evas_image_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_image_main.c
@@ -26,28 +26,47 @@ static int reference = 0;
26#define EVAS_ALPHA_LINE_BUFFER_MIN_LEN 256 26#define EVAS_ALPHA_LINE_BUFFER_MIN_LEN 256
27#define EVAS_ALPHA_LINE_BUFFER_MAX_LEN 2048 27#define EVAS_ALPHA_LINE_BUFFER_MAX_LEN 2048
28 28
29/* The cache is doing the allocation and deallocation, you must just do the rest. */
30static void _evas_common_image_unload(RGBA_Image* im);
31 29
32static void _evas_common_image_dirty_region(RGBA_Image* im, int x, int y, int w, int h); 30static Image_Entry *_evas_common_rgba_image_new(void);
31static void _evas_common_rgba_image_delete(Image_Entry *ie);
32
33static int _evas_common_rgba_image_surface_alloc(Image_Entry *ie, int w, int h);
34static void _evas_common_rgba_image_surface_delete(Image_Entry *ie);
35
36static void _evas_common_rgba_image_unload(Image_Entry *im);
37
38static void _evas_common_rgba_image_dirty_region(Image_Entry *im, int x, int y, int w, int h);
39
40static int _evas_common_rgba_image_ram_usage(Image_Entry *ie);
33 41
34/* Only called when references > 0. Need to provide a fresh copie of im. */ 42/* Only called when references > 0. Need to provide a fresh copie of im. */
35/* The destination surface does have a surface, but no allocated pixel data. */ 43/* The destination surface does have a surface, but no allocated pixel data. */
36static int _evas_common_image_dirty(RGBA_Image* dst, const RGBA_Image* src); 44static int _evas_common_rgba_image_dirty(Image_Entry* dst, const Image_Entry* src);
45
46static void
47_evas_common_rgba_image_debug(const char* context, Image_Entry *eim)
48{
49 fprintf(stderr, "%p = [%s] {%s,%s} %i [%i|%i]\n", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h);
50}
37 51
38static const Evas_Cache_Image_Func _evas_common_image_func = 52static const Evas_Cache_Image_Func _evas_common_image_func =
39{ 53{
40 evas_common_load_image_module_from_file, 54 _evas_common_rgba_image_new,
41 _evas_common_image_unload, 55 _evas_common_rgba_image_delete,
42 _evas_common_image_dirty_region, 56 _evas_common_rgba_image_surface_alloc,
43 _evas_common_image_dirty, 57 _evas_common_rgba_image_surface_delete,
44 evas_common_image_size_set, 58 evas_common_load_rgba_image_module_from_file,
45 evas_common_image_from_copied_data, 59 _evas_common_rgba_image_unload,
46 evas_common_image_from_data, 60 _evas_common_rgba_image_dirty_region,
47 evas_common_image_colorspace_set, 61 _evas_common_rgba_image_dirty,
48 evas_common_load_image_data_from_file, 62 evas_common_rgba_image_size_set,
49 evas_common_image_ram_usage, 63 evas_common_rgba_image_from_copied_data,
50 NULL 64 evas_common_rgba_image_from_data,
65 evas_common_rgba_image_colorspace_set,
66 evas_common_load_rgba_image_data_from_file,
67 _evas_common_rgba_image_ram_usage,
68/* _evas_common_rgba_image_debug */
69 NULL
51}; 70};
52 71
53EAPI void 72EAPI void
@@ -91,22 +110,67 @@ evas_common_image_shutdown(void)
91#endif 110#endif
92} 111}
93 112
94static void 113static Image_Entry *
95_evas_common_image_unload(RGBA_Image* im) 114_evas_common_rgba_image_new(void)
96{ 115{
116 RGBA_Image *im;
117
118 im = calloc(1, sizeof(RGBA_Image));
119 if (!im) return NULL;
120 im->flags = RGBA_IMAGE_NOTHING;
121 im->ref = 1;
122 return &im->cache_entry;
97} 123}
98 124
99static void 125static void
100_evas_common_image_dirty_region(RGBA_Image* im, int x, int y, int w, int h) 126_evas_common_rgba_image_delete(Image_Entry *ie)
101{ 127{
128 RGBA_Image *im = (RGBA_Image *) ie;
129
130 evas_common_pipe_free(im);
131 if (im->info.module) evas_module_unref((Evas_Module *)im->info.module);
132 /* memset the image to 0x99 because i recently saw a segv where an
133 * seemed to be used BUT its contents were wrong - it looks like it was
134 * overwritten by something from efreet - as there was an execute command
135 * for a command there and some other signs - but to make sure, I am
136 * going to empty this struct out in case this happens again so i know
137 * that something else is overwritign this struct - or not */
138 memset(im, 0x99, sizeof(im));
139 free(im);
102} 140}
103 141
104void 142static int
105evas_common_image_delete(RGBA_Image* im) 143_evas_common_rgba_image_surface_alloc(Image_Entry *ie, int w, int h)
106{ 144{
107 if ((im->cs.data) && (im->image->data)) 145 RGBA_Image *im = (RGBA_Image *) ie;
146 size_t siz = 0;
147
148/* if (im->image.data) /\* return 0; *\/ */
149/* free(im->image.data); */
150
151 if (im->flags & RGBA_IMAGE_ALPHA_ONLY)
152 siz = w * h * sizeof(DATA8);
153 else
154 siz = w * h * sizeof(DATA32);
155
156 im->image.data = realloc(im->image.data, siz);
157 if (im->image.data == NULL) return -1;
158
159#ifdef HAVE_VALGRIND
160 VALGRIND_MAKE_READABLE(im->image.data, siz);
161#endif
162
163 return 0;
164}
165
166static void
167_evas_common_rgba_image_surface_delete(Image_Entry *ie)
168{
169 RGBA_Image *im = (RGBA_Image *) ie;
170
171 if ((im->cs.data) && (im->image.data))
108 { 172 {
109 if (im->cs.data != im->image->data) 173 if (im->cs.data != im->image.data)
110 { 174 {
111 if (!im->cs.no_free) free(im->cs.data); 175 if (!im->cs.no_free) free(im->cs.data);
112 } 176 }
@@ -115,34 +179,54 @@ evas_common_image_delete(RGBA_Image* im)
115 { 179 {
116 if (!im->cs.no_free) free(im->cs.data); 180 if (!im->cs.no_free) free(im->cs.data);
117 } 181 }
118
119 im->cs.data = NULL; 182 im->cs.data = NULL;
120 evas_common_pipe_free(im); 183
121 if (im->image) evas_common_image_surface_free(im->image); 184 if (im->image.data && !im->image.no_free)
122 if (im->info.file) evas_stringshare_del(im->info.file); 185 free(im->image.data);
123 if (im->info.key) evas_stringshare_del(im->info.key); 186 im->image.data = NULL;
124 if (im->info.module) evas_module_unref((Evas_Module *)im->info.module); 187 im->image.no_free = 1;
125 /* memset the image to 0x99 because i recently saw a segv where an 188}
126 * seemed to be used BUT its contents were wrong - it looks like it was 189
127 * overwritten by something from efreet - as there was an execute command 190static void
128 * for a command there and some other signs - but to make sure, I am 191_evas_common_rgba_image_unload(Image_Entry* im)
129 * going to empty this struct out in case this happens again so i know 192{
130 * that something else is overwritign this struct - or not */ 193}
131 memset(im, 0x99, sizeof(im)); 194
132 free(im); 195static void
196_evas_common_rgba_image_dirty_region(Image_Entry* im, int x, int y, int w, int h)
197{
133} 198}
134 199
135/* Only called when references > 0. Need to provide a fresh copie of im. */ 200/* Only called when references > 0. Need to provide a fresh copie of im. */
136static int 201static int
137_evas_common_image_dirty(RGBA_Image* dst, const RGBA_Image* src) 202_evas_common_rgba_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src)
138{ 203{
139 evas_common_load_image_data_from_file(src); 204 RGBA_Image *dst = (RGBA_Image *) ie_dst;
205 RGBA_Image *src = (RGBA_Image *) ie_src;
206
207 evas_cache_image_load_data(&src->cache_entry);
208 if (_evas_common_rgba_image_surface_alloc(&dst->cache_entry,
209 src->cache_entry.w, src->cache_entry.h))
210 return 1;
211
140 evas_common_image_colorspace_normalize(src); 212 evas_common_image_colorspace_normalize(src);
141 evas_common_image_colorspace_normalize(dst); 213 evas_common_image_colorspace_normalize(dst);
142 evas_common_image_surface_alloc(dst->image); 214/* evas_common_blit_rectangle(src, dst, 0, 0, src->cache_entry.w, src->cache_entry.h, 0, 0); */
143 evas_common_blit_rectangle(src, dst, 0, 0, src->image->w, src->image->h, 0, 0); 215/* evas_common_cpu_end_opt(); */
144 evas_common_cpu_end_opt(); 216
217 return 0;
218}
145 219
220static int
221_evas_common_rgba_image_ram_usage(Image_Entry *ie)
222{
223 RGBA_Image *im = (RGBA_Image *) ie;
224
225// ram += sizeof(struct _RGBA_Image);
226// if (im->info.real_file) ram += strlen(im->info.real_file);
227// if (im->info.comment) ram += strlen(im->info.comment);
228 if ((im->image.data) && (!im->image.no_free))
229 return im->cache_entry.w * im->cache_entry.h * sizeof(DATA32);
146 return 0; 230 return 0;
147} 231}
148 232
@@ -212,138 +296,73 @@ evas_common_image_surface_alpha_tiles_calc(RGBA_Surface *is, int tsize)
212} 296}
213#endif 297#endif
214 298
215EAPI RGBA_Surface * 299/* EAPI void */
216evas_common_image_surface_new(RGBA_Image *im) 300/* evas_common_image_surface_dealloc(RGBA_Surface *is) */
217{ 301/* { */
218 RGBA_Surface *is; 302/* if ((is->data) && (!is->no_free)) */
219 303/* { */
220 is = calloc(1, sizeof(RGBA_Surface)); 304/* free(is->data); */
221 is->im = im; 305/* is->data = NULL; */
222 return is; 306/* } */
223} 307/* } */
224 308
225EAPI void 309static RGBA_Image *
226evas_common_image_surface_free(RGBA_Surface *is)
227{
228 evas_common_image_surface_dealloc(is);
229 free(is);
230}
231
232EAPI void
233evas_common_image_surface_alloc(RGBA_Surface *is)
234{
235 size_t siz = 0;
236
237 if (is->data) return ;
238
239 if (is->im->flags & RGBA_IMAGE_ALPHA_ONLY)
240 siz = is->w * is->h * sizeof(DATA8);
241 else
242 siz = is->w * is->h * sizeof(DATA32);
243
244 is->data = malloc(siz);
245
246#ifdef HAVE_VALGRIND
247 VALGRIND_MAKE_READABLE(is->data, siz);
248#endif
249}
250
251EAPI void
252evas_common_image_surface_dealloc(RGBA_Surface *is)
253{
254 if ((is->data) && (!is->no_free))
255 {
256 free(is->data);
257 is->data = NULL;
258 }
259}
260
261EAPI RGBA_Image *
262evas_common_image_create(int w, int h) 310evas_common_image_create(int w, int h)
263{ 311{
264 RGBA_Image *im; 312 RGBA_Image *im;
265 313
266 im = evas_common_image_new(); 314 im = (RGBA_Image *) _evas_common_rgba_image_new();
267 if (!im) return NULL; 315 if (!im) return NULL;
268 im->image = evas_common_image_surface_new(im); 316 im->cache_entry.w = w;
269 if (!im->image) 317 im->cache_entry.h = h;
270 { 318 if (_evas_common_rgba_image_surface_alloc(&im->cache_entry, w, h))
271 evas_common_image_delete(im);
272 return NULL;
273 }
274 im->image->w = w;
275 im->image->h = h;
276 evas_common_image_surface_alloc(im->image);
277 if (!im->image->data)
278 { 319 {
279 evas_common_image_delete(im); 320 _evas_common_rgba_image_delete(&im->cache_entry);
280 return NULL; 321 return NULL;
281 } 322 }
282 im->flags = RGBA_IMAGE_IS_DIRTY; 323 im->cache_entry.flags.cached = 0;
283 im->references = 1;
284 return im; 324 return im;
285} 325}
286 326
287EAPI RGBA_Image * 327EAPI RGBA_Image *
288evas_common_image_alpha_create(int w, int h) 328evas_common_image_alpha_create(int w, int h)
289{ 329{
290 RGBA_Image *im; 330 RGBA_Image *im;
291 331
292 im = evas_common_image_new(); 332 im = (RGBA_Image *) _evas_common_rgba_image_new();
293 if (!im) return NULL; 333 if (!im) return NULL;
294 im->image = evas_common_image_surface_new(im); 334 im->cache_entry.w = w;
295 if (!im->image) 335 im->cache_entry.h = h;
296 {
297 evas_common_image_delete(im);
298 return NULL;
299 }
300 im->image->w = w;
301 im->image->h = h;
302 im->flags |= RGBA_IMAGE_ALPHA_ONLY; 336 im->flags |= RGBA_IMAGE_ALPHA_ONLY;
303 evas_common_image_surface_alloc(im->image); 337 if (_evas_common_rgba_image_surface_alloc(&im->cache_entry, w, h))
304 if (!im->image->data)
305 { 338 {
306 evas_common_image_delete(im); 339 _evas_common_rgba_image_delete(&im->cache_entry);
307 return NULL; 340 return NULL;
308 } 341 }
309 im->flags = RGBA_IMAGE_IS_DIRTY; 342 im->cache_entry.flags.cached = 0;
310 im->references = 1;
311 return im; 343 return im;
312} 344}
313 345
314EAPI RGBA_Image * 346void
315evas_common_image_new(void)
316{
317 RGBA_Image *im;
318
319 im = calloc(1, sizeof(RGBA_Image));
320 if (!im) return NULL;
321 im->flags = RGBA_IMAGE_NOTHING;
322 im->ref = 1;
323 im->cs.space = EVAS_COLORSPACE_ARGB8888;
324 return im;
325}
326
327EAPI void
328evas_common_image_colorspace_normalize(RGBA_Image *im) 347evas_common_image_colorspace_normalize(RGBA_Image *im)
329{ 348{
330 if ((!im->cs.data) || 349 if ((!im->cs.data) ||
331 ((!im->cs.dirty) && (!(im->flags & RGBA_IMAGE_IS_DIRTY)))) return; 350 ((!im->cs.dirty) && (!(im->flags & RGBA_IMAGE_IS_DIRTY)))) return;
332 switch (im->cs.space) 351 switch (im->cache_entry.space)
333 { 352 {
334 case EVAS_COLORSPACE_ARGB8888: 353 case EVAS_COLORSPACE_ARGB8888:
335 if (im->image->data != im->cs.data) 354 if (im->image.data != im->cs.data)
336 { 355 {
337 if (!im->image->no_free) free(im->image->data); 356 if (!im->image.no_free) free(im->image.data);
338 im->image->data = im->cs.data; 357 im->image.data = im->cs.data;
339 im->cs.no_free = im->image->no_free; 358 im->cs.no_free = im->image.no_free;
340 } 359 }
341 break; 360 break;
342 case EVAS_COLORSPACE_YCBCR422P601_PL: 361 case EVAS_COLORSPACE_YCBCR422P601_PL:
343#ifdef BUILD_CONVERT_YUV 362#ifdef BUILD_CONVERT_YUV
344 if ((im->image->data) && (*((unsigned char **)im->cs.data))) 363 if ((im->image.data) && (*((unsigned char **)im->cs.data)))
345 evas_common_convert_yuv_420p_601_rgba(im->cs.data, (DATA8*) im->image->data, 364 evas_common_convert_yuv_420p_601_rgba(im->cs.data, (DATA8*) im->image.data,
346 im->image->w, im->image->h); 365 im->cache_entry.w, im->cache_entry.h);
347#endif 366#endif
348 break; 367 break;
349 default: 368 default:
@@ -374,25 +393,10 @@ evas_common_image_get_cache(void)
374EAPI RGBA_Image * 393EAPI RGBA_Image *
375evas_common_load_image_from_file(const char *file, const char *key, RGBA_Image_Loadopts *lo) 394evas_common_load_image_from_file(const char *file, const char *key, RGBA_Image_Loadopts *lo)
376{ 395{
377 int error; 396 int error;
378 397
379 if (file == NULL) return NULL; 398 if (file == NULL) return NULL;
380 return evas_cache_image_request(eci, file, key, lo, &error); 399 return (RGBA_Image *) evas_cache_image_request(eci, file, key, lo, &error);
381}
382
383EAPI int
384evas_common_image_ram_usage(RGBA_Image *im)
385{
386 int ram = 0;
387
388// ram += sizeof(struct _RGBA_Image);
389// if (im->info.file) ram += strlen(im->info.file);
390// if (im->info.real_file) ram += strlen(im->info.real_file);
391// if (im->info.key) ram += strlen(im->info.key);
392// if (im->info.comment) ram += strlen(im->info.comment);
393 if ((im->image) && (im->image->data) && (!im->image->no_free))
394 ram += im->image->w * im->image->h * sizeof(DATA32);
395 return ram;
396} 400}
397 401
398EAPI void 402EAPI void
@@ -438,7 +442,7 @@ evas_common_image_line_buffer_obtain(int len)
438EAPI void 442EAPI void
439evas_common_image_line_buffer_release(RGBA_Image *im) 443evas_common_image_line_buffer_release(RGBA_Image *im)
440{ 444{
441 evas_common_image_delete(im); 445 _evas_common_rgba_image_delete(&im->cache_entry);;
442/* 446/*
443 if (!evas_rgba_line_buffer) return; 447 if (!evas_rgba_line_buffer) return;
444 if (EVAS_RGBA_LINE_BUFFER_MAX_LEN < evas_rgba_line_buffer->image->w) 448 if (EVAS_RGBA_LINE_BUFFER_MAX_LEN < evas_rgba_line_buffer->image->w)
@@ -458,7 +462,7 @@ evas_common_image_line_buffer_release(RGBA_Image *im)
458EAPI void 462EAPI void
459evas_common_image_line_buffer_free(RGBA_Image *im) 463evas_common_image_line_buffer_free(RGBA_Image *im)
460{ 464{
461 evas_common_image_delete(im); 465 _evas_common_rgba_image_delete(&im->cache_entry);;
462/* 466/*
463 if (!evas_rgba_line_buffer) return; 467 if (!evas_rgba_line_buffer) return;
464 evas_common_image_free(evas_rgba_line_buffer); 468 evas_common_image_free(evas_rgba_line_buffer);
@@ -496,7 +500,7 @@ evas_common_image_alpha_line_buffer_obtain(int len)
496EAPI void 500EAPI void
497evas_common_image_alpha_line_buffer_release(RGBA_Image *im) 501evas_common_image_alpha_line_buffer_release(RGBA_Image *im)
498{ 502{
499 evas_common_image_delete(im); 503 _evas_common_rgba_image_delete(&im->cache_entry);;
500/* 504/*
501 if (!evas_alpha_line_buffer) return; 505 if (!evas_alpha_line_buffer) return;
502 if (EVAS_ALPHA_LINE_BUFFER_MAX_LEN < evas_alpha_line_buffer->image->w) 506 if (EVAS_ALPHA_LINE_BUFFER_MAX_LEN < evas_alpha_line_buffer->image->w)
@@ -519,11 +523,11 @@ evas_common_image_premul(RGBA_Image *im)
519 DATA32 *s, *se; 523 DATA32 *s, *se;
520 DATA32 nas = 0; 524 DATA32 nas = 0;
521 525
522 if (!im || !im->image || !im->image->data) return; 526 if (!im || !im->image.data) return;
523 if (!(im->flags & RGBA_IMAGE_HAS_ALPHA)) return; 527 if (!(im->flags & RGBA_IMAGE_HAS_ALPHA)) return;
524 528
525 s = im->image->data; 529 s = im->image.data;
526 se = s + (im->image->w * im->image->h); 530 se = s + (im->cache_entry.w * im->cache_entry.h);
527 while (s < se) 531 while (s < se)
528 { 532 {
529 DATA32 a = 1 + (*s >> 24); 533 DATA32 a = 1 + (*s >> 24);
@@ -534,7 +538,7 @@ evas_common_image_premul(RGBA_Image *im)
534 if ((a == 1) || (a == 256)) 538 if ((a == 1) || (a == 256))
535 nas++; 539 nas++;
536 } 540 }
537 if ((ALPHA_SPARSE_INV_FRACTION * nas) >= (im->image->w * im->image->h)) 541 if ((ALPHA_SPARSE_INV_FRACTION * nas) >= (im->cache_entry.w * im->cache_entry.h))
538 im->flags |= RGBA_IMAGE_ALPHA_SPARSE; 542 im->flags |= RGBA_IMAGE_ALPHA_SPARSE;
539} 543}
540 544
@@ -544,11 +548,11 @@ evas_common_image_set_alpha_sparse(RGBA_Image *im)
544 DATA32 *s, *se; 548 DATA32 *s, *se;
545 DATA32 nas = 0; 549 DATA32 nas = 0;
546 550
547 if (!im || !im->image || !im->image->data) return; 551 if (!im || !im->image.data) return;
548 if (!(im->flags & RGBA_IMAGE_HAS_ALPHA)) return; 552 if (!(im->flags & RGBA_IMAGE_HAS_ALPHA)) return;
549 553
550 s = im->image->data; 554 s = im->image.data;
551 se = s + (im->image->w * im->image->h); 555 se = s + (im->cache_entry.w * im->cache_entry.h);
552 while (s < se) 556 while (s < se)
553 { 557 {
554 DATA32 p = *s & 0xff000000; 558 DATA32 p = *s & 0xff000000;
@@ -557,6 +561,6 @@ evas_common_image_set_alpha_sparse(RGBA_Image *im)
557 nas++; 561 nas++;
558 s++; 562 s++;
559 } 563 }
560 if ((ALPHA_SPARSE_INV_FRACTION * nas) >= (im->image->w * im->image->h)) 564 if ((ALPHA_SPARSE_INV_FRACTION * nas) >= (im->cache_entry.w * im->cache_entry.h))
561 im->flags |= RGBA_IMAGE_ALPHA_SPARSE; 565 im->flags |= RGBA_IMAGE_ALPHA_SPARSE;
562} 566}
diff --git a/legacy/evas/src/lib/engines/common/evas_line_main.c b/legacy/evas/src/lib/engines/common/evas_line_main.c
index 5026bbd621..189c0c13fc 100644
--- a/legacy/evas/src/lib/engines/common/evas_line_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_line_main.c
@@ -52,8 +52,8 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, in
52 } 52 }
53 53
54 clx = cly = 0; 54 clx = cly = 0;
55 clw = dst->image->w; 55 clw = dst->cache_entry.w;
56 clh = dst->image->h; 56 clh = dst->cache_entry.h;
57 57
58 /* save out clip info */ 58 /* save out clip info */
59 cuse = dc->clip.use; 59 cuse = dc->clip.use;
@@ -104,13 +104,13 @@ _evas_draw_point(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y)
104{ 104{
105 RGBA_Gfx_Pt_Func pfunc; 105 RGBA_Gfx_Pt_Func pfunc;
106 106
107 if (!IN_RANGE(x, y, dst->image->w, dst->image->h)) 107 if (!IN_RANGE(x, y, dst->cache_entry.w, dst->cache_entry.h))
108 return; 108 return;
109 if ((dc->clip.use) && (!IN_RECT(x, y, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h))) 109 if ((dc->clip.use) && (!IN_RECT(x, y, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h)))
110 return; 110 return;
111 pfunc = evas_common_gfx_func_composite_color_pt_get(dc->col.col, dst, dc->render_op); 111 pfunc = evas_common_gfx_func_composite_color_pt_get(dc->col.col, dst, dc->render_op);
112 if (pfunc) 112 if (pfunc)
113 pfunc(0, 255, dc->col.col, dst->image->data + (dst->image->w * y) + x); 113 pfunc(0, 255, dc->col.col, dst->image.data + (dst->cache_entry.w * y) + x);
114} 114}
115 115
116/* 116/*
@@ -129,7 +129,7 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
129 RGBA_Gfx_Pt_Func pfunc; 129 RGBA_Gfx_Pt_Func pfunc;
130 RGBA_Gfx_Func sfunc; 130 RGBA_Gfx_Func sfunc;
131 131
132 dstw = dst->image->w; 132 dstw = dst->cache_entry.w;
133 color = dc->col.col; 133 color = dc->col.col;
134 134
135 if (y0 > y1) 135 if (y0 > y1)
@@ -170,7 +170,7 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
170 if (x1 > rx) x1 = rx; 170 if (x1 > rx) x1 = rx;
171 171
172 len = x1 - x0 + 1; 172 len = x1 - x0 + 1;
173 p = dst->image->data + (dstw * y0) + x0; 173 p = dst->image.data + (dstw * y0) + x0;
174 sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, len, dc->render_op); 174 sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, len, dc->render_op);
175 if (sfunc) 175 if (sfunc)
176 sfunc(NULL, NULL, color, p, len); 176 sfunc(NULL, NULL, color, p, len);
@@ -190,7 +190,7 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
190 if (y1 > by) y1 = by; 190 if (y1 > by) y1 = by;
191 191
192 len = y1 - y0 + 1; 192 len = y1 - y0 + 1;
193 p = dst->image->data + (dstw * y0) + x0; 193 p = dst->image.data + (dstw * y0) + x0;
194 while (len--) 194 while (len--)
195 { 195 {
196#ifdef EVAS_SLI 196#ifdef EVAS_SLI
@@ -268,7 +268,7 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
268 } 268 }
269 if (y1 > y0) 269 if (y1 > y0)
270 { 270 {
271 p = dst->image->data + (dstw * y0) + x0; 271 p = dst->image.data + (dstw * y0) + x0;
272 len = y1 - y0 + 1; 272 len = y1 - y0 + 1;
273 if (dx > 0) dstw++; 273 if (dx > 0) dstw++;
274 else dstw--; 274 else dstw--;
@@ -276,7 +276,7 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
276 else 276 else
277 { 277 {
278 len = y0 - y1 + 1; 278 len = y0 - y1 + 1;
279 p = dst->image->data + (dstw * y1) + x1; 279 p = dst->image.data + (dstw * y1) + x1;
280 if (dx > 0) dstw--; 280 if (dx > 0) dstw--;
281 else dstw++; 281 else dstw++;
282 } 282 }
@@ -472,8 +472,8 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1,
472 clw = dc->clip.w; 472 clw = dc->clip.w;
473 clh = dc->clip.h; 473 clh = dc->clip.h;
474 474
475 data = dst->image->data; 475 data = dst->image.data;
476 dstw = dst->image->w; 476 dstw = dst->cache_entry.w;
477 477
478 data += (dstw * cly) + clx; 478 data += (dstw * cly) + clx;
479 x0 -= clx; 479 x0 -= clx;
@@ -579,8 +579,8 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x
579 clw = dc->clip.w; 579 clw = dc->clip.w;
580 clh = dc->clip.h; 580 clh = dc->clip.h;
581 581
582 data = dst->image->data; 582 data = dst->image.data;
583 dstw = dst->image->w; 583 dstw = dst->cache_entry.w;
584 584
585 data += (dstw * cly) + clx; 585 data += (dstw * cly) + clx;
586 x0 -= clx; 586 x0 -= clx;
diff --git a/legacy/evas/src/lib/engines/common/evas_pipe.c b/legacy/evas/src/lib/engines/common/evas_pipe.c
index 56a7866103..f12daab0bf 100644
--- a/legacy/evas/src/lib/engines/common/evas_pipe.c
+++ b/legacy/evas/src/lib/engines/common/evas_pipe.c
@@ -139,26 +139,26 @@ evas_common_pipe_begin(RGBA_Image *im)
139 } 139 }
140 } 140 }
141 y = 0; 141 y = 0;
142 h = im->image->h / thread_num; 142 h = im->cache_entry.h / thread_num;
143 if (h < 1) h = 1; 143 if (h < 1) h = 1;
144 for (i = 0; i < thread_num; i++) 144 for (i = 0; i < thread_num; i++)
145 { 145 {
146 RGBA_Pipe_Thread_Info *info; 146 RGBA_Pipe_Thread_Info *info;
147 147
148// if (y >= im->image->h) break; 148// if (y >= im->cache_entry.h) break;
149 info = calloc(1, sizeof(RGBA_Pipe_Thread_Info)); 149 info = calloc(1, sizeof(RGBA_Pipe_Thread_Info));
150 info->im = im; 150 info->im = im;
151#ifdef EVAS_SLI 151#ifdef EVAS_SLI
152 info->x = 0; 152 info->x = 0;
153 info->w = im->image->w; 153 info->w = im->cache_entry.w;
154 info->y = i; 154 info->y = i;
155 info->h = thread_num; 155 info->h = thread_num;
156#else 156#else
157 info->x = 0; 157 info->x = 0;
158 info->y = y; 158 info->y = y;
159 info->w = im->image->w; 159 info->w = im->cache_entry.w;
160 if (i == (thread_num - 1)) 160 if (i == (thread_num - 1))
161 info->h = im->image->h - y; 161 info->h = im->cache_entry.h - y;
162 else 162 else
163 info->h = h; 163 info->h = h;
164 y += info->h; 164 y += info->h;
@@ -485,7 +485,7 @@ evas_common_pipe_op_image_free(RGBA_Pipe_Op *op)
485{ 485{
486 op->op.image.src->ref--; 486 op->op.image.src->ref--;
487 if (op->op.image.src->ref == 0) 487 if (op->op.image.src->ref == 0)
488 evas_cache_image_drop(op->op.image.src); 488 evas_cache_image_drop(&op->op.image.src->cache_entry);
489 evas_common_pipe_op_free(op); 489 evas_common_pipe_op_free(op);
490} 490}
491 491
diff --git a/legacy/evas/src/lib/engines/common/evas_polygon_main.c b/legacy/evas/src/lib/engines/common/evas_polygon_main.c
index 88903fb6b7..03f8242341 100644
--- a/legacy/evas/src/lib/engines/common/evas_polygon_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_polygon_main.c
@@ -134,8 +134,8 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
134 134
135 ext_x = 0; 135 ext_x = 0;
136 ext_y = 0; 136 ext_y = 0;
137 ext_w = dst->image->w; 137 ext_w = dst->cache_entry.w;
138 ext_h = dst->image->h; 138 ext_h = dst->cache_entry.h;
139 if (dc->clip.use) 139 if (dc->clip.use)
140 { 140 {
141 if (dc->clip.x > ext_x) 141 if (dc->clip.x > ext_x)
@@ -280,7 +280,7 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
280 if (((span->y) % dc->sli.h) == dc->sli.y) 280 if (((span->y) % dc->sli.h) == dc->sli.y)
281#endif 281#endif
282 { 282 {
283 ptr = dst->image->data + (span->y * (dst->image->w)) + span->x; 283 ptr = dst->image.data + (span->y * (dst->cache_entry.w)) + span->x;
284 func(NULL, NULL, dc->col.col, ptr, span->w); 284 func(NULL, NULL, dc->col.col, ptr, span->w);
285 } 285 }
286 } 286 }
diff --git a/legacy/evas/src/lib/engines/common/evas_rectangle_main.c b/legacy/evas/src/lib/engines/common/evas_rectangle_main.c
index 92fd1db7d2..761e2a7e3d 100644
--- a/legacy/evas/src/lib/engines/common/evas_rectangle_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_rectangle_main.c
@@ -17,11 +17,11 @@ evas_common_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
17 /* handle cutouts here! */ 17 /* handle cutouts here! */
18 18
19 if ((w <= 0) || (h <= 0)) return; 19 if ((w <= 0) || (h <= 0)) return;
20 if (!(RECTS_INTERSECT(x, y, w, h, 0, 0, dst->image->w, dst->image->h))) 20 if (!(RECTS_INTERSECT(x, y, w, h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
21 return; 21 return;
22 /* save out clip info */ 22 /* save out clip info */
23 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h; 23 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
24 evas_common_draw_context_clip_clip(dc, 0, 0, dst->image->w, dst->image->h); 24 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
25 /* no cutouts - cut right to the chase */ 25 /* no cutouts - cut right to the chase */
26 if (!dc->cutout.rects) 26 if (!dc->cutout.rects)
27 { 27 {
@@ -58,7 +58,7 @@ rectangle_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, in
58 if ((w <= 0) || (h <= 0)) return; 58 if ((w <= 0) || (h <= 0)) return;
59 59
60 func = evas_common_gfx_func_composite_color_span_get(dc->col.col, dst, w, dc->render_op); 60 func = evas_common_gfx_func_composite_color_span_get(dc->col.col, dst, w, dc->render_op);
61 ptr = dst->image->data + (y * dst->image->w) + x; 61 ptr = dst->image.data + (y * dst->cache_entry.w) + x;
62 for (yy = 0; yy < h; yy++) 62 for (yy = 0; yy < h; yy++)
63 { 63 {
64#ifdef EVAS_SLI 64#ifdef EVAS_SLI
@@ -67,6 +67,6 @@ rectangle_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, in
67 { 67 {
68 func(NULL, NULL, dc->col.col, ptr, w); 68 func(NULL, NULL, dc->col.col, ptr, w);
69 } 69 }
70 ptr += dst->image->w; 70 ptr += dst->cache_entry.w;
71 } 71 }
72} 72}
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 b505450f9e..23f8e50656 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_sample.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_sample.c
@@ -37,7 +37,7 @@ evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
37 /* handle cutouts here! */ 37 /* handle cutouts here! */
38 38
39 if ((dst_region_w <= 0) || (dst_region_h <= 0)) return; 39 if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
40 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->image->w, dst->image->h))) 40 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
41 return; 41 return;
42 /* no cutouts - cut right to the chase */ 42 /* no cutouts - cut right to the chase */
43 if (!dc->cutout.rects) 43 if (!dc->cutout.rects)
@@ -51,7 +51,7 @@ evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
51 } 51 }
52 /* save out clip info */ 52 /* save out clip info */
53 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h; 53 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
54 evas_common_draw_context_clip_clip(dc, 0, 0, dst->image->w, dst->image->h); 54 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
55 evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y, dst_region_w, dst_region_h); 55 evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
56 /* our clip is 0 size.. abort */ 56 /* our clip is 0 size.. abort */
57 if ((dc->clip.w <= 0) || (dc->clip.h <= 0)) 57 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
@@ -94,18 +94,18 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
94 int src_w, src_h, dst_w, dst_h; 94 int src_w, src_h, dst_w, dst_h;
95 RGBA_Gfx_Func func; 95 RGBA_Gfx_Func func;
96 96
97 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->image->w, dst->image->h))) 97 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
98 return; 98 return;
99 if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h, 0, 0, src->image->w, src->image->h))) 99 if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
100 return; 100 return;
101 101
102 src_w = src->image->w; 102 src_w = src->cache_entry.w;
103 src_h = src->image->h; 103 src_h = src->cache_entry.h;
104 dst_w = dst->image->w; 104 dst_w = dst->cache_entry.w;
105 dst_h = dst->image->h; 105 dst_h = dst->cache_entry.h;
106 106
107 src_data = src->image->data; 107 src_data = src->image.data;
108 dst_data = dst->image->data; 108 dst_data = dst->image.data;
109 109
110 if (dc->clip.use) 110 if (dc->clip.use)
111 { 111 {
diff --git a/legacy/evas/src/lib/engines/common/evas_scale_smooth.c b/legacy/evas/src/lib/engines/common/evas_scale_smooth.c
index 4244b05eae..86c50cdf18 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_smooth.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_smooth.c
@@ -454,7 +454,7 @@ evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
454 /* handle cutouts here! */ 454 /* handle cutouts here! */
455 455
456 if ((dst_region_w <= 0) || (dst_region_h <= 0)) return; 456 if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
457 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->image->w, dst->image->h))) 457 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
458 return; 458 return;
459# ifdef BUILD_MMX 459# ifdef BUILD_MMX
460 evas_common_cpu_can_do(&mmx, &sse, &sse2); 460 evas_common_cpu_can_do(&mmx, &sse, &sse2);
@@ -482,7 +482,7 @@ evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
482 } 482 }
483 /* save out clip info */ 483 /* save out clip info */
484 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h; 484 c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
485 evas_common_draw_context_clip_clip(dc, 0, 0, dst->image->w, dst->image->h); 485 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
486 evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y, dst_region_w, dst_region_h); 486 evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
487 /* our clip is 0 size.. abort */ 487 /* our clip is 0 size.. abort */
488 if ((dc->clip.w <= 0) || (dc->clip.h <= 0)) 488 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
diff --git a/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler.c b/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler.c
index f69fe3fabb..e07aaee108 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler.c
@@ -11,15 +11,15 @@ SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst,
11 int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h; 11 int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h;
12 int src_w, src_h, dst_w, dst_h; 12 int src_w, src_h, dst_w, dst_h;
13 13
14 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->image->w, dst->image->h))) 14 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
15 return; 15 return;
16 if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h, 0, 0, src->image->w, src->image->h))) 16 if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
17 return; 17 return;
18 18
19 src_w = src->image->w; 19 src_w = src->cache_entry.w;
20 src_h = src->image->h; 20 src_h = src->cache_entry.h;
21 dst_w = dst->image->w; 21 dst_w = dst->cache_entry.w;
22 dst_h = dst->image->h; 22 dst_h = dst->cache_entry.h;
23 23
24 if (dc->clip.use) 24 if (dc->clip.use)
25 { 25 {
@@ -141,7 +141,7 @@ SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst,
141 dst_jump = dst_w - dst_clip_w; 141 dst_jump = dst_w - dst_clip_w;
142 142
143 /* figure out dest start ptr */ 143 /* figure out dest start ptr */
144 dst_ptr = dst->image->data + dst_clip_x + (dst_clip_y * dst_w); 144 dst_ptr = dst->image.data + dst_clip_x + (dst_clip_y * dst_w);
145 145
146/* FIXME: 146/* FIXME:
147 * 147 *
diff --git a/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c b/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c
index d4250e0a23..050ee07967 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c
@@ -7,7 +7,7 @@
7 7
8 RGBA_Gfx_Func func; 8 RGBA_Gfx_Func func;
9 9
10 src_data = src->image->data; 10 src_data = src->image.data;
11 11
12 xpoints = scale_calc_x_points(src_region_w, dst_region_w); 12 xpoints = scale_calc_x_points(src_region_w, dst_region_w);
13 ypoints = scale_calc_y_points(src_data, src_w, src_region_h, dst_region_h); 13 ypoints = scale_calc_y_points(src_data, src_w, src_region_h, dst_region_h);
diff --git a/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_noscale.c b/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_noscale.c
index 01ca8f92a4..c9581553df 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_noscale.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_noscale.c
@@ -5,7 +5,7 @@
5 int ysli = dst_clip_y; 5 int ysli = dst_clip_y;
6#endif 6#endif
7 7
8 ptr = src->image->data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x; 8 ptr = src->image.data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
9 if (dc->mul.use) 9 if (dc->mul.use)
10 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op); 10 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
11 else 11 else
diff --git a/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_up.c b/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_up.c
index 0a6088f376..098d01c5a4 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_up.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler_up.c
@@ -18,10 +18,10 @@
18 if (!dc->mul.use) 18 if (!dc->mul.use)
19 { 19 {
20 if ((dc->render_op == _EVAS_RENDER_BLEND) && !(src->flags & RGBA_IMAGE_HAS_ALPHA)) 20 if ((dc->render_op == _EVAS_RENDER_BLEND) && !(src->flags & RGBA_IMAGE_HAS_ALPHA))
21 { direct_scale = 1; buf_step = dst->image->w; } 21 { direct_scale = 1; buf_step = dst->cache_entry.w; }
22 else if (dc->render_op == _EVAS_RENDER_COPY) 22 else if (dc->render_op == _EVAS_RENDER_COPY)
23 { 23 {
24 direct_scale = 1; buf_step = dst->image->w; 24 direct_scale = 1; buf_step = dst->cache_entry.w;
25 if (src->flags & RGBA_IMAGE_HAS_ALPHA) 25 if (src->flags & RGBA_IMAGE_HAS_ALPHA)
26 dst->flags |= RGBA_IMAGE_HAS_ALPHA; 26 dst->flags |= RGBA_IMAGE_HAS_ALPHA;
27 } 27 }
@@ -61,7 +61,7 @@
61#ifdef EVAS_SLI 61#ifdef EVAS_SLI
62 int ysli = dst_clip_y; 62 int ysli = dst_clip_y;
63#endif 63#endif
64 psrc = src->image->data + (src_w * (sry + cy)) + srx; 64 psrc = src->image.data + (src_w * (sry + cy)) + srx;
65 while (pdst < pdst_end) 65 while (pdst < pdst_end)
66 { 66 {
67#ifdef EVAS_SLI 67#ifdef EVAS_SLI
@@ -117,7 +117,7 @@
117 } 117 }
118 else if (drw == srw) 118 else if (drw == srw)
119 { 119 {
120 DATA32 *ps = src->image->data + (src_w * sry) + srx + cx; 120 DATA32 *ps = src->image.data + (src_w * sry) + srx + cx;
121#ifdef EVAS_SLI 121#ifdef EVAS_SLI
122 int ysli = dst_clip_y; 122 int ysli = dst_clip_y;
123#endif 123#endif
@@ -176,7 +176,7 @@
176 } 176 }
177 177
178 { 178 {
179 DATA32 *ps = src->image->data + (src_w * sry) + srx; 179 DATA32 *ps = src->image.data + (src_w * sry) + srx;
180 int sxx0 = sxx; 180 int sxx0 = sxx;
181#ifdef EVAS_SLI 181#ifdef EVAS_SLI
182 int ysli = dst_clip_y; 182 int ysli = dst_clip_y;