summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@profusion.mobi>2012-12-17 21:29:33 +0000
committerLeandro Pereira <leandro@profusion.mobi>2012-12-17 21:29:33 +0000
commitb4ceb3f2ba49ad4db3567807af6886f1fbb7b24d (patch)
treeeaaf99d15fe8f12adfc0b284bb5dcdd554f38112 /src/lib/evas
parent6ea27233227ee92afb21497a50f5224336f2489b (diff)
evas/common: Prepare soil to land scaling code for threaded render
SVN revision: 81188
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_scale_main.h3
-rw-r--r--src/lib/evas/common/evas_scale_sample.c194
-rw-r--r--src/lib/evas/common/evas_scale_smooth.c102
-rw-r--r--src/lib/evas/common/evas_scale_smooth_scaler.c51
-rw-r--r--src/lib/evas/common/evas_scale_smooth_scaler_down.c12
-rw-r--r--src/lib/evas/common/evas_scale_smooth_scaler_downx.c10
-rw-r--r--src/lib/evas/common/evas_scale_smooth_scaler_downx_downy.c62
-rw-r--r--src/lib/evas/common/evas_scale_smooth_scaler_downy.c10
-rw-r--r--src/lib/evas/common/evas_scale_smooth_scaler_noscale.c8
-rw-r--r--src/lib/evas/common/evas_scale_smooth_scaler_up.c18
10 files changed, 367 insertions, 103 deletions
diff --git a/src/lib/evas/common/evas_scale_main.h b/src/lib/evas/common/evas_scale_main.h
index a126457162..e81f2cbfc4 100644
--- a/src/lib/evas/common/evas_scale_main.h
+++ b/src/lib/evas/common/evas_scale_main.h
@@ -13,7 +13,8 @@ EAPI void evas_common_rgba_image_scalecache_dump(void);
13 13
14EAPI void evas_common_scale_rgba_in_to_out_clip_sample_do (const Cutout_Rects *reuse, const Eina_Rectangle *clip, RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h); 14EAPI void evas_common_scale_rgba_in_to_out_clip_sample_do (const Cutout_Rects *reuse, const Eina_Rectangle *clip, RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
15EAPI void evas_common_scale_rgba_in_to_out_clip_smooth_do (const Cutout_Rects *reuse, const Eina_Rectangle *clip, RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h); 15EAPI void evas_common_scale_rgba_in_to_out_clip_smooth_do (const Cutout_Rects *reuse, const Eina_Rectangle *clip, RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
16EAPI void evas_common_scale_rgba_sample_draw (RGBA_Image *src, RGBA_Image *dst, int dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32 mul_col, int render_op, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
17EAPI void evas_common_scale_rgba_smooth_draw (RGBA_Image *src, RGBA_Image *dst, int dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32 mul_col, int render_op, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
16EAPI Eina_Bool evas_common_scale_rgba_in_to_out_clip_prepare (Cutout_Rects *reuse, const RGBA_Image *src, const RGBA_Image *dst, RGBA_Draw_Context *dc, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h); 18EAPI Eina_Bool evas_common_scale_rgba_in_to_out_clip_prepare (Cutout_Rects *reuse, const RGBA_Image *src, const RGBA_Image *dst, RGBA_Draw_Context *dc, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
17 19
18
19#endif /* _EVAS_SCALE_MAIN_H */ 20#endif /* _EVAS_SCALE_MAIN_H */
diff --git a/src/lib/evas/common/evas_scale_sample.c b/src/lib/evas/common/evas_scale_sample.c
index 5a11af8a6d..f9fc650376 100644
--- a/src/lib/evas/common/evas_scale_sample.c
+++ b/src/lib/evas/common/evas_scale_sample.c
@@ -58,13 +58,197 @@ evas_common_scale_rgba_in_to_out_clip_sample_do(const Cutout_Rects *reuse,
58 } 58 }
59} 59}
60 60
61EAPI void
62evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32 mul_col, int render_op, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h)
63{
64 int x, y;
65 int *lin_ptr;
66 DATA32 *buf, *dptr;
67 DATA32 **row_ptr;
68 DATA32 *ptr, *dst_ptr, *src_data, *dst_data;
69 int src_w, src_h, dst_w, dst_h;
70 RGBA_Gfx_Func func;
71
72 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
73 0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
74 if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h,
75 0, 0, src->cache_entry.w, src->cache_entry.h))) return;
76
77 src_w = src->cache_entry.w;
78 src_h = src->cache_entry.h;
79 dst_w = dst->cache_entry.w;
80 dst_h = dst->cache_entry.h;
81
82 src_data = src->image.data;
83 dst_data = dst->image.data;
84
85 if (dst_clip_x < 0)
86 {
87 dst_clip_w += dst_clip_x;
88 dst_clip_x = 0;
89 }
90 if (dst_clip_y < 0)
91 {
92 dst_clip_h += dst_clip_y;
93 dst_clip_y = 0;
94 }
95 if ((dst_clip_x + dst_clip_w) > dst_w)
96 dst_clip_w = dst_w - dst_clip_x;
97 if ((dst_clip_y + dst_clip_h) > dst_h)
98 dst_clip_h = dst_h - dst_clip_y;
99
100 if (dst_clip_x < dst_region_x)
101 {
102 dst_clip_w += dst_clip_x - dst_region_x;
103 dst_clip_x = dst_region_x;
104 }
105 if ((dst_clip_x + dst_clip_w) > (dst_region_x + dst_region_w))
106 dst_clip_w = dst_region_x + dst_region_w - dst_clip_x;
107 if (dst_clip_y < dst_region_y)
108 {
109 dst_clip_h += dst_clip_y - dst_region_y;
110 dst_clip_y = dst_region_y;
111 }
112 if ((dst_clip_y + dst_clip_h) > (dst_region_y + dst_region_h))
113 dst_clip_h = dst_region_y + dst_region_h - dst_clip_y;
114
115 if ((src_region_w <= 0) || (src_region_h <= 0) ||
116 (dst_region_w <= 0) || (dst_region_h <= 0) ||
117 (dst_clip_w <= 0) || (dst_clip_h <= 0))
118 return;
119
120 /* sanitise x */
121 if (src_region_x < 0)
122 {
123 dst_region_x -= (src_region_x * dst_region_w) / src_region_w;
124 dst_region_w += (src_region_x * dst_region_w) / src_region_w;
125 src_region_w += src_region_x;
126 src_region_x = 0;
127 }
128 if (src_region_x >= src_w) return;
129 if ((src_region_x + src_region_w) > src_w)
130 {
131 dst_region_w = (dst_region_w * (src_w - src_region_x)) / (src_region_w);
132 src_region_w = src_w - src_region_x;
133 }
134 if (dst_region_w <= 0) return;
135 if (src_region_w <= 0) return;
136 if (dst_clip_x < 0)
137 {
138 dst_clip_w += dst_clip_x;
139 dst_clip_x = 0;
140 }
141 if (dst_clip_w <= 0) return;
142 if (dst_clip_x >= dst_w) return;
143 if (dst_clip_x < dst_region_x)
144 {
145 dst_clip_w += (dst_clip_x - dst_region_x);
146 dst_clip_x = dst_region_x;
147 }
148 if ((dst_clip_x + dst_clip_w) > dst_w)
149 {
150 dst_clip_w = dst_w - dst_clip_x;
151 }
152 if (dst_clip_w <= 0) return;
153
154 /* sanitise y */
155 if (src_region_y < 0)
156 {
157 dst_region_y -= (src_region_y * dst_region_h) / src_region_h;
158 dst_region_h += (src_region_y * dst_region_h) / src_region_h;
159 src_region_h += src_region_y;
160 src_region_y = 0;
161 }
162 if (src_region_y >= src_h) return;
163 if ((src_region_y + src_region_h) > src_h)
164 {
165 dst_region_h = (dst_region_h * (src_h - src_region_y)) / (src_region_h);
166 src_region_h = src_h - src_region_y;
167 }
168 if (dst_region_h <= 0) return;
169 if (src_region_h <= 0) return;
170 if (dst_clip_y < 0)
171 {
172 dst_clip_h += dst_clip_y;
173 dst_clip_y = 0;
174 }
175 if (dst_clip_h <= 0) return;
176 if (dst_clip_y >= dst_h) return;
177 if (dst_clip_y < dst_region_y)
178 {
179 dst_clip_h += (dst_clip_y - dst_region_y);
180 dst_clip_y = dst_region_y;
181 }
182 if ((dst_clip_y + dst_clip_h) > dst_h)
183 {
184 dst_clip_h = dst_h - dst_clip_y;
185 }
186 if (dst_clip_h <= 0) return;
187
188 /* allocate scale lookup tables */
189 lin_ptr = alloca(dst_clip_w * sizeof(int));
190 row_ptr = alloca(dst_clip_h * sizeof(DATA32 *));
191
192 /* figure out dst jump */
193 //dst_jump = dst_w - dst_clip_w;
194
195 /* figure out dest start ptr */
196 dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w);
197
198 if (mul_col != 0xffffffff)
199 func = evas_common_gfx_func_composite_pixel_color_span_get(src, mul_col, dst, dst_clip_w, render_op);
200 else
201 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, render_op);
202
203 if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h))
204 {
205 ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
206 for (y = 0; y < dst_clip_h; y++)
207 {
208 /* * blend here [clip_w *] ptr -> dst_ptr * */
209 func(ptr, NULL, mul_col, dst_ptr, dst_clip_w);
210
211 ptr += src_w;
212 dst_ptr += dst_w;
213 }
214 }
215 else
216 {
217 /* fill scale tables */
218 for (x = 0; x < dst_clip_w; x++)
219 lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * src_region_w) / dst_region_w) + src_region_x;
220 for (y = 0; y < dst_clip_h; y++)
221 row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h)
222 + src_region_y) * src_w);
223 /* scale to dst */
224 dptr = dst_ptr;
225
226 /* a scanline buffer */
227 buf = alloca(dst_clip_w * sizeof(DATA32));
228 for (y = 0; y < dst_clip_h; y++)
229 {
230 dst_ptr = buf;
231 for (x = 0; x < dst_clip_w; x++)
232 {
233 ptr = row_ptr[y] + lin_ptr[x];
234 *dst_ptr = *ptr;
235 dst_ptr++;
236 }
237 /* * blend here [clip_w *] buf -> dptr * */
238 func(buf, NULL, mul_col, dptr, dst_clip_w);
239
240 dptr += dst_w;
241 }
242 }
243}
244
61static void 245static void
62scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst, 246scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
63 RGBA_Draw_Context *dc, 247 RGBA_Draw_Context *dc,
64 int src_region_x, int src_region_y, 248 int src_region_x, int src_region_y,
65 int src_region_w, int src_region_h, 249 int src_region_w, int src_region_h,
66 int dst_region_x, int dst_region_y, 250 int dst_region_x, int dst_region_y,
67 int dst_region_w, int dst_region_h) 251 int dst_region_w, int dst_region_h)
68{ 252{
69 int x, y; 253 int x, y;
70 int *lin_ptr; 254 int *lin_ptr;
diff --git a/src/lib/evas/common/evas_scale_smooth.c b/src/lib/evas/common/evas_scale_smooth.c
index 9efcc8b575..43e71f4e61 100644
--- a/src/lib/evas/common/evas_scale_smooth.c
+++ b/src/lib/evas/common/evas_scale_smooth.c
@@ -91,17 +91,91 @@ scale_calc_a_points(int *p, int s, int d, int c, int cc)
91 91
92#ifdef BUILD_MMX 92#ifdef BUILD_MMX
93# undef SCALE_FUNC 93# undef SCALE_FUNC
94# define SCALE_FUNC evas_common_scale_rgba_in_to_out_clip_smooth_mmx 94# define SCALE_FUNC _evas_common_scale_rgba_in_to_out_clip_smooth_mmx
95# undef SCALE_USING_MMX 95# undef SCALE_USING_MMX
96# define SCALE_USING_MMX 96# define SCALE_USING_MMX
97# include "evas_scale_smooth_scaler.c" 97# include "evas_scale_smooth_scaler.c"
98#endif 98#endif
99 99
100#undef SCALE_FUNC 100#undef SCALE_FUNC
101#define SCALE_FUNC evas_common_scale_rgba_in_to_out_clip_smooth_c 101#define SCALE_FUNC _evas_common_scale_rgba_in_to_out_clip_smooth_c
102#undef SCALE_USING_MMX 102#undef SCALE_USING_MMX
103#include "evas_scale_smooth_scaler.c" 103#include "evas_scale_smooth_scaler.c"
104 104
105#ifdef BUILD_MMX
106void
107evas_common_scale_rgba_in_to_out_clip_smooth_mmx(RGBA_Image *src, RGBA_Image *dst,
108 RGBA_Draw_Context *dc,
109 int src_region_x, int src_region_y,
110 int src_region_w, int src_region_h,
111 int dst_region_x, int dst_region_y,
112 int dst_region_w, int dst_region_h)
113{
114 int clip_x, clip_y, clip_w, clip_h;
115 DATA32 mul_col;
116
117 if (dc->clip.use)
118 {
119 clip_x = dc->clip.x;
120 clip_y = dc->clip.y;
121 clip_w = dc->clip.w;
122 clip_h = dc->clip.h;
123 }
124 else
125 {
126 clip_x = 0;
127 clip_y = 0;
128 clip_w = dst->cache_entry.w;
129 clip_h = dst->cache_entry.h;
130 }
131
132 mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
133
134 _evas_common_scale_rgba_in_to_out_clip_smooth_mmx
135 (src, dst,
136 clip_x, clip_y, clip_w, clip_h,
137 mul_col, dc->render_op,
138 src_region_x, src_region_y, src_region_w, src_region_h,
139 dst_region_x, dst_region_y, dst_region_w, dst_region_h);
140}
141#endif
142
143void
144evas_common_scale_rgba_in_to_out_clip_smooth_c(RGBA_Image *src, RGBA_Image *dst,
145 RGBA_Draw_Context *dc,
146 int src_region_x, int src_region_y,
147 int src_region_w, int src_region_h,
148 int dst_region_x, int dst_region_y,
149 int dst_region_w, int dst_region_h)
150{
151 int clip_x, clip_y, clip_w, clip_h;
152 DATA32 mul_col;
153
154 if (dc->clip.use)
155 {
156 clip_x = dc->clip.x;
157 clip_y = dc->clip.y;
158 clip_w = dc->clip.w;
159 clip_h = dc->clip.h;
160 }
161 else
162 {
163 clip_x = 0;
164 clip_y = 0;
165 clip_w = dst->cache_entry.w;
166 clip_h = dst->cache_entry.h;
167 }
168
169 mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
170
171 _evas_common_scale_rgba_in_to_out_clip_smooth_mmx
172 (src, dst,
173 clip_x, clip_y, clip_w, clip_h,
174 mul_col, dc->render_op,
175 src_region_x, src_region_y, src_region_w, src_region_h,
176 dst_region_x, dst_region_y, dst_region_w, dst_region_h);
177}
178
105EAPI void 179EAPI void
106evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst, 180evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
107 RGBA_Draw_Context *dc, 181 RGBA_Draw_Context *dc,
@@ -130,6 +204,30 @@ evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
130} 204}
131 205
132EAPI void 206EAPI void
207evas_common_scale_rgba_smooth_draw(RGBA_Image *src, RGBA_Image *dst, int dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32 mul_col, int render_op, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h)
208{
209#ifdef BUILD_MMX
210 int mmx, sse, sse2;
211
212 evas_common_cpu_can_do(&mmx, &sse, &sse2);
213 if (mmx)
214 _evas_common_scale_rgba_in_to_out_clip_smooth_mmx
215 (src, dst,
216 dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h,
217 mul_col, render_op,
218 src_region_x, src_region_y, src_region_w, src_region_h,
219 dst_region_x, dst_region_y, dst_region_w, dst_region_h);
220 else
221#endif
222 _evas_common_scale_rgba_in_to_out_clip_smooth_c
223 (src, dst,
224 dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h,
225 mul_col, render_op,
226 src_region_x, src_region_y, src_region_w, src_region_h,
227 dst_region_x, dst_region_y, dst_region_w, dst_region_h);
228}
229
230EAPI void
133evas_common_scale_rgba_in_to_out_clip_smooth_do(const Cutout_Rects *reuse, 231evas_common_scale_rgba_in_to_out_clip_smooth_do(const Cutout_Rects *reuse,
134 const Eina_Rectangle *clip, 232 const Eina_Rectangle *clip,
135 RGBA_Image *src, RGBA_Image *dst, 233 RGBA_Image *src, RGBA_Image *dst,
diff --git a/src/lib/evas/common/evas_scale_smooth_scaler.c b/src/lib/evas/common/evas_scale_smooth_scaler.c
index 599bfda9fd..a97faee790 100644
--- a/src/lib/evas/common/evas_scale_smooth_scaler.c
+++ b/src/lib/evas/common/evas_scale_smooth_scaler.c
@@ -1,53 +1,34 @@
1void 1void
2SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst, 2SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst, int dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32 mul_col, int render_op, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h)
3 RGBA_Draw_Context *dc,
4 int src_region_x, int src_region_y,
5 int src_region_w, int src_region_h,
6 int dst_region_x, int dst_region_y,
7 int dst_region_w, int dst_region_h)
8{ 3{
9 DATA32 *dst_ptr; 4 DATA32 *dst_ptr;
10 int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h;
11 int src_w, src_h, dst_w, dst_h; 5 int src_w, src_h, dst_w, dst_h;
12 6
13 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))) 7 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
14 return; 8 0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
15 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))) 9 if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h,
16 return; 10 0, 0, src->cache_entry.w, src->cache_entry.h))) return;
17 11
18 src_w = src->cache_entry.w; 12 src_w = src->cache_entry.w;
19 src_h = src->cache_entry.h; 13 src_h = src->cache_entry.h;
20 dst_w = dst->cache_entry.w; 14 dst_w = dst->cache_entry.w;
21 dst_h = dst->cache_entry.h; 15 dst_h = dst->cache_entry.h;
22 16
23 if (dc->clip.use) 17 if (dst_clip_x < 0)
24 { 18 {
25 dst_clip_x = dc->clip.x; 19 dst_clip_w += dst_clip_x;
26 dst_clip_y = dc->clip.y; 20 dst_clip_x = 0;
27 dst_clip_w = dc->clip.w;
28 dst_clip_h = dc->clip.h;
29 if (dst_clip_x < 0)
30 {
31 dst_clip_w += dst_clip_x;
32 dst_clip_x = 0;
33 }
34 if (dst_clip_y < 0)
35 {
36 dst_clip_h += dst_clip_y;
37 dst_clip_y = 0;
38 }
39 if ((dst_clip_w <= 0) || (dst_clip_h <= 0)) return;
40 if ((dst_clip_x + dst_clip_w) > dst_w) dst_clip_w = dst_w - dst_clip_x;
41 if ((dst_clip_y + dst_clip_h) > dst_h) dst_clip_h = dst_h - dst_clip_y;
42 } 21 }
43 else 22 if (dst_clip_y < 0)
44 { 23 {
45 dst_clip_x = 0; 24 dst_clip_h += dst_clip_y;
46 dst_clip_y = 0; 25 dst_clip_y = 0;
47 dst_clip_w = dst_w;
48 dst_clip_h = dst_h;
49 } 26 }
50 27
28 if ((dst_clip_w <= 0) || (dst_clip_h <= 0)) return;
29 if ((dst_clip_x + dst_clip_w) > dst_w) dst_clip_w = dst_w - dst_clip_x;
30 if ((dst_clip_y + dst_clip_h) > dst_h) dst_clip_h = dst_h - dst_clip_y;
31
51 if (dst_clip_x < dst_region_x) 32 if (dst_clip_x < dst_region_x)
52 { 33 {
53 dst_clip_w += dst_clip_x - dst_region_x; 34 dst_clip_w += dst_clip_x - dst_region_x;
@@ -141,7 +122,7 @@ SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst,
141 if (dst_clip_h > 65536) return; 122 if (dst_clip_h > 65536) return;
142 if (dst_region_w > (65536 * 1024)) return; 123 if (dst_region_w > (65536 * 1024)) return;
143 if (dst_region_h > (65536 * 1024)) return; 124 if (dst_region_h > (65536 * 1024)) return;
144 125
145 /* figure out dst jump 126 /* figure out dst jump
146 * NB: Unused currently, so commented out */ 127 * NB: Unused currently, so commented out */
147// dst_jump = dst_w - dst_clip_w; 128// dst_jump = dst_w - dst_clip_w;
diff --git a/src/lib/evas/common/evas_scale_smooth_scaler_down.c b/src/lib/evas/common/evas_scale_smooth_scaler_down.c
index 357eb322ca..e113c0faf4 100644
--- a/src/lib/evas/common/evas_scale_smooth_scaler_down.c
+++ b/src/lib/evas/common/evas_scale_smooth_scaler_down.c
@@ -8,20 +8,20 @@
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 /* some maximum region sizes to avoid insane calc point tables */ 12 /* some maximum region sizes to avoid insane calc point tables */
13 SCALE_CALC_X_POINTS(xpoints, src_region_w, dst_region_w, dst_clip_x - dst_region_x, dst_clip_w); 13 SCALE_CALC_X_POINTS(xpoints, src_region_w, dst_region_w, dst_clip_x - dst_region_x, dst_clip_w);
14 SCALE_CALC_Y_POINTS(ypoints, src_data, src_w, src_region_h, dst_region_h, dst_clip_y - dst_region_y, dst_clip_h); 14 SCALE_CALC_Y_POINTS(ypoints, src_data, src_w, src_region_h, dst_region_h, dst_clip_y - dst_region_y, dst_clip_h);
15 SCALE_CALC_A_POINTS(xapoints, src_region_w, dst_region_w, dst_clip_x - dst_region_x, dst_clip_w); 15 SCALE_CALC_A_POINTS(xapoints, src_region_w, dst_region_w, dst_clip_x - dst_region_x, dst_clip_w);
16 SCALE_CALC_A_POINTS(yapoints, src_region_h, dst_region_h, dst_clip_y - dst_region_y, dst_clip_h); 16 SCALE_CALC_A_POINTS(yapoints, src_region_h, dst_region_h, dst_clip_y - dst_region_y, dst_clip_h);
17 17
18 /* a scanline buffer */ 18 /* a scanline buffer */
19 buf = alloca(dst_clip_w * sizeof(DATA32)); 19 buf = alloca(dst_clip_w * sizeof(DATA32));
20 20
21 if (dc->mul.use) 21 if (mul_col != 0xffffffff)
22 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op); 22 func = evas_common_gfx_func_composite_pixel_color_span_get(src, mul_col, dst, dst_clip_w, render_op);
23 else 23 else
24 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op); 24 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, render_op);
25 /* scaling down vertically */ 25 /* scaling down vertically */
26 if ((dst_region_w >= src_region_w) && 26 if ((dst_region_w >= src_region_w) &&
27 (dst_region_h < src_region_h)) 27 (dst_region_h < src_region_h))
diff --git a/src/lib/evas/common/evas_scale_smooth_scaler_downx.c b/src/lib/evas/common/evas_scale_smooth_scaler_downx.c
index 544b8c271e..6ef45e5f35 100644
--- a/src/lib/evas/common/evas_scale_smooth_scaler_downx.c
+++ b/src/lib/evas/common/evas_scale_smooth_scaler_downx.c
@@ -82,7 +82,7 @@
82 xp++; xapp++; 82 xp++; xapp++;
83 } 83 }
84 84
85 func(buf, NULL, dc->mul.col, dptr, w); 85 func(buf, NULL, mul_col, dptr, w);
86 86
87 pbuf = buf; 87 pbuf = buf;
88 dptr += dst_w; dst_clip_w = w; 88 dptr += dst_w; dst_clip_w = w;
@@ -96,7 +96,7 @@
96#ifdef DIRECT_SCALE 96#ifdef DIRECT_SCALE
97 if ((!src->cache_entry.flags.alpha) && 97 if ((!src->cache_entry.flags.alpha) &&
98 (!dst->cache_entry.flags.alpha) && 98 (!dst->cache_entry.flags.alpha) &&
99 (!dc->mul.use)) 99 (mul_col == 0xffffffff))
100 { 100 {
101 while (dst_clip_h--) 101 while (dst_clip_h--)
102 { 102 {
@@ -155,7 +155,7 @@
155 ((b + (1 << 3)) >> 4)); 155 ((b + (1 << 3)) >> 4));
156 xp++; xapp++; 156 xp++; xapp++;
157 } 157 }
158 158
159 dptr += dst_w; dst_clip_w = w; 159 dptr += dst_w; dst_clip_w = w;
160 yp++; yapp++; 160 yp++; yapp++;
161 xp = xpoints;// + dxx; 161 xp = xpoints;// + dxx;
@@ -220,8 +220,8 @@
220 ((b + (1 << 3)) >> 4)); 220 ((b + (1 << 3)) >> 4));
221 xp++; xapp++; 221 xp++; xapp++;
222 } 222 }
223 223
224 func(buf, NULL, dc->mul.col, dptr, w); 224 func(buf, NULL, mul_col, dptr, w);
225 225
226 pbuf = buf; 226 pbuf = buf;
227 dptr += dst_w; dst_clip_w = w; 227 dptr += dst_w; dst_clip_w = w;
diff --git a/src/lib/evas/common/evas_scale_smooth_scaler_downx_downy.c b/src/lib/evas/common/evas_scale_smooth_scaler_downx_downy.c
index 180d37bca4..d186ce1e2b 100644
--- a/src/lib/evas/common/evas_scale_smooth_scaler_downx_downy.c
+++ b/src/lib/evas/common/evas_scale_smooth_scaler_downx_downy.c
@@ -4,8 +4,8 @@
4 int a, r, g, b, rx, gx, bx, ax; 4 int a, r, g, b, rx, gx, bx, ax;
5 int xap, yap, pos; 5 int xap, yap, pos;
6 //int dyy, dxx; 6 //int dyy, dxx;
7 7
8 DATA32 **yp; 8 DATA32 **yp;
9 int *xp; 9 int *xp;
10 int w = dst_clip_w; 10 int w = dst_clip_w;
11 11
@@ -28,16 +28,16 @@
28 { 28 {
29 Cy = *yapp >> 16; 29 Cy = *yapp >> 16;
30 yap = *yapp & 0xffff; 30 yap = *yapp & 0xffff;
31 31
32 while (dst_clip_w--) 32 while (dst_clip_w--)
33 { 33 {
34 Cx = *xapp >> 16; 34 Cx = *xapp >> 16;
35 xap = *xapp & 0xffff; 35 xap = *xapp & 0xffff;
36 36
37 sptr = *yp + *xp + pos; 37 sptr = *yp + *xp + pos;
38 pix = sptr; 38 pix = sptr;
39 sptr += src_w; 39 sptr += src_w;
40 40
41 ax = (A_VAL(pix) * xap) >> 9; 41 ax = (A_VAL(pix) * xap) >> 9;
42 rx = (R_VAL(pix) * xap) >> 9; 42 rx = (R_VAL(pix) * xap) >> 9;
43 gx = (G_VAL(pix) * xap) >> 9; 43 gx = (G_VAL(pix) * xap) >> 9;
@@ -58,12 +58,12 @@
58 gx += (G_VAL(pix) * i) >> 9; 58 gx += (G_VAL(pix) * i) >> 9;
59 bx += (B_VAL(pix) * i) >> 9; 59 bx += (B_VAL(pix) * i) >> 9;
60 } 60 }
61 61
62 a = (ax * yap) >> 14; 62 a = (ax * yap) >> 14;
63 r = (rx * yap) >> 14; 63 r = (rx * yap) >> 14;
64 g = (gx * yap) >> 14; 64 g = (gx * yap) >> 14;
65 b = (bx * yap) >> 14; 65 b = (bx * yap) >> 14;
66 66
67 for (j = (1 << 14) - yap; j > Cy; j -= Cy) 67 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
68 { 68 {
69 pix = sptr; 69 pix = sptr;
@@ -118,20 +118,20 @@
118 gx += (G_VAL(pix) * i) >> 9; 118 gx += (G_VAL(pix) * i) >> 9;
119 bx += (B_VAL(pix) * i) >> 9; 119 bx += (B_VAL(pix) * i) >> 9;
120 } 120 }
121 121
122 a += (ax * j) >> 14; 122 a += (ax * j) >> 14;
123 r += (rx * j) >> 14; 123 r += (rx * j) >> 14;
124 g += (gx * j) >> 14; 124 g += (gx * j) >> 14;
125 b += (bx * j) >> 14; 125 b += (bx * j) >> 14;
126 } 126 }
127 *pbuf++ = ARGB_JOIN(((a + (1 << 4)) >> 5), 127 *pbuf++ = ARGB_JOIN(((a + (1 << 4)) >> 5),
128 ((r + (1 << 4)) >> 5), 128 ((r + (1 << 4)) >> 5),
129 ((g + (1 << 4)) >> 5), 129 ((g + (1 << 4)) >> 5),
130 ((b + (1 << 4)) >> 5)); 130 ((b + (1 << 4)) >> 5));
131 xp++; xapp++; 131 xp++; xapp++;
132 } 132 }
133 133
134 func(buf, NULL, dc->mul.col, dptr, w); 134 func(buf, NULL, mul_col, dptr, w);
135 135
136 pbuf = buf; 136 pbuf = buf;
137 dptr += dst_w; dst_clip_w = w; 137 dptr += dst_w; dst_clip_w = w;
@@ -145,23 +145,23 @@
145#ifdef DIRECT_SCALE 145#ifdef DIRECT_SCALE
146 if ((!src->cache_entry.flags.alpha) && 146 if ((!src->cache_entry.flags.alpha) &&
147 (!dst->cache_entry.flags.alpha) && 147 (!dst->cache_entry.flags.alpha) &&
148 (!dc->mul.use)) 148 (mul_col == 0xffffffff))
149 { 149 {
150 while (dst_clip_h--) 150 while (dst_clip_h--)
151 { 151 {
152 Cy = *yapp >> 16; 152 Cy = *yapp >> 16;
153 yap = *yapp & 0xffff; 153 yap = *yapp & 0xffff;
154 154
155 pbuf = dptr; 155 pbuf = dptr;
156 while (dst_clip_w--) 156 while (dst_clip_w--)
157 { 157 {
158 Cx = *xapp >> 16; 158 Cx = *xapp >> 16;
159 xap = *xapp & 0xffff; 159 xap = *xapp & 0xffff;
160 160
161 sptr = *yp + *xp + pos; 161 sptr = *yp + *xp + pos;
162 pix = sptr; 162 pix = sptr;
163 sptr += src_w; 163 sptr += src_w;
164 164
165 rx = (R_VAL(pix) * xap) >> 9; 165 rx = (R_VAL(pix) * xap) >> 9;
166 gx = (G_VAL(pix) * xap) >> 9; 166 gx = (G_VAL(pix) * xap) >> 9;
167 bx = (B_VAL(pix) * xap) >> 9; 167 bx = (B_VAL(pix) * xap) >> 9;
@@ -183,7 +183,7 @@
183 r = (rx * yap) >> 14; 183 r = (rx * yap) >> 14;
184 g = (gx * yap) >> 14; 184 g = (gx * yap) >> 14;
185 b = (bx * yap) >> 14; 185 b = (bx * yap) >> 14;
186 186
187 for (j = (1 << 14) - yap; j > Cy; j -= Cy) 187 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
188 { 188 {
189 pix = sptr; 189 pix = sptr;
@@ -205,7 +205,7 @@
205 gx += (G_VAL(pix) * i) >> 9; 205 gx += (G_VAL(pix) * i) >> 9;
206 bx += (B_VAL(pix) * i) >> 9; 206 bx += (B_VAL(pix) * i) >> 9;
207 } 207 }
208 208
209 r += (rx * Cy) >> 14; 209 r += (rx * Cy) >> 14;
210 g += (gx * Cy) >> 14; 210 g += (gx * Cy) >> 14;
211 b += (bx * Cy) >> 14; 211 b += (bx * Cy) >> 14;
@@ -236,9 +236,9 @@
236 g += (gx * j) >> 14; 236 g += (gx * j) >> 14;
237 b += (bx * j) >> 14; 237 b += (bx * j) >> 14;
238 } 238 }
239 *pbuf++ = ARGB_JOIN(0xff, 239 *pbuf++ = ARGB_JOIN(0xff,
240 ((r + (1 << 4)) >> 5), 240 ((r + (1 << 4)) >> 5),
241 ((g + (1 << 4)) >> 5), 241 ((g + (1 << 4)) >> 5),
242 ((b + (1 << 4)) >> 5)); 242 ((b + (1 << 4)) >> 5));
243 xp++; xapp++; 243 xp++; xapp++;
244 } 244 }
@@ -250,22 +250,22 @@
250 } 250 }
251 } 251 }
252 else 252 else
253#endif 253#endif
254 { 254 {
255 while (dst_clip_h--) 255 while (dst_clip_h--)
256 { 256 {
257 Cy = *yapp >> 16; 257 Cy = *yapp >> 16;
258 yap = *yapp & 0xffff; 258 yap = *yapp & 0xffff;
259 259
260 while (dst_clip_w--) 260 while (dst_clip_w--)
261 { 261 {
262 Cx = *xapp >> 16; 262 Cx = *xapp >> 16;
263 xap = *xapp & 0xffff; 263 xap = *xapp & 0xffff;
264 264
265 sptr = *yp + *xp + pos; 265 sptr = *yp + *xp + pos;
266 pix = sptr; 266 pix = sptr;
267 sptr += src_w; 267 sptr += src_w;
268 268
269 rx = (R_VAL(pix) * xap) >> 9; 269 rx = (R_VAL(pix) * xap) >> 9;
270 gx = (G_VAL(pix) * xap) >> 9; 270 gx = (G_VAL(pix) * xap) >> 9;
271 bx = (B_VAL(pix) * xap) >> 9; 271 bx = (B_VAL(pix) * xap) >> 9;
@@ -287,7 +287,7 @@
287 r = (rx * yap) >> 14; 287 r = (rx * yap) >> 14;
288 g = (gx * yap) >> 14; 288 g = (gx * yap) >> 14;
289 b = (bx * yap) >> 14; 289 b = (bx * yap) >> 14;
290 290
291 for (j = (1 << 14) - yap; j > Cy; j -= Cy) 291 for (j = (1 << 14) - yap; j > Cy; j -= Cy)
292 { 292 {
293 pix = sptr; 293 pix = sptr;
@@ -340,14 +340,14 @@
340 g += (gx * j) >> 14; 340 g += (gx * j) >> 14;
341 b += (bx * j) >> 14; 341 b += (bx * j) >> 14;
342 } 342 }
343 *pbuf++ = ARGB_JOIN(0xff, 343 *pbuf++ = ARGB_JOIN(0xff,
344 ((r + (1 << 4)) >> 5), 344 ((r + (1 << 4)) >> 5),
345 ((g + (1 << 4)) >> 5), 345 ((g + (1 << 4)) >> 5),
346 ((b + (1 << 4)) >> 5)); 346 ((b + (1 << 4)) >> 5));
347 xp++; xapp++; 347 xp++; xapp++;
348 } 348 }
349 349
350 func(buf, NULL, dc->mul.col, dptr, w); 350 func(buf, NULL, mul_col, dptr, w);
351 351
352 pbuf = buf; 352 pbuf = buf;
353 dptr += dst_w; dst_clip_w = w; 353 dptr += dst_w; dst_clip_w = w;
diff --git a/src/lib/evas/common/evas_scale_smooth_scaler_downy.c b/src/lib/evas/common/evas_scale_smooth_scaler_downy.c
index d7c10f95fd..7e1c741f2e 100644
--- a/src/lib/evas/common/evas_scale_smooth_scaler_downy.c
+++ b/src/lib/evas/common/evas_scale_smooth_scaler_downy.c
@@ -82,8 +82,8 @@
82 ((b + (1 << 3)) >> 4)); 82 ((b + (1 << 3)) >> 4));
83 xp++; xapp++; 83 xp++; xapp++;
84 } 84 }
85 85
86 func(buf, NULL, dc->mul.col, dptr, w); 86 func(buf, NULL, mul_col, dptr, w);
87 87
88 pbuf = buf; 88 pbuf = buf;
89 dptr += dst_w; dst_clip_w = w; 89 dptr += dst_w; dst_clip_w = w;
@@ -97,7 +97,7 @@
97#ifdef DIRECT_SCALE 97#ifdef DIRECT_SCALE
98 if ((!src->cache_entry.flags.alpha) && 98 if ((!src->cache_entry.flags.alpha) &&
99 (!dst->cache_entry.flags.alpha) && 99 (!dst->cache_entry.flags.alpha) &&
100 (!dc->mul.use)) 100 (mul_col == 0xffffffff))
101 { 101 {
102 while (dst_clip_h--) 102 while (dst_clip_h--)
103 { 103 {
@@ -222,8 +222,8 @@
222 ((b + (1 << 3)) >> 4)); 222 ((b + (1 << 3)) >> 4));
223 xp++; xapp++; 223 xp++; xapp++;
224 } 224 }
225 225
226 func(buf, NULL, dc->mul.col, dptr, w); 226 func(buf, NULL, mul_col, dptr, w);
227 227
228 pbuf = buf; 228 pbuf = buf;
229 dptr += dst_w; dst_clip_w = w; 229 dptr += dst_w; dst_clip_w = w;
diff --git a/src/lib/evas/common/evas_scale_smooth_scaler_noscale.c b/src/lib/evas/common/evas_scale_smooth_scaler_noscale.c
index 1ac1ceb6ec..83835bbc14 100644
--- a/src/lib/evas/common/evas_scale_smooth_scaler_noscale.c
+++ b/src/lib/evas/common/evas_scale_smooth_scaler_noscale.c
@@ -3,14 +3,14 @@
3 RGBA_Gfx_Func func; 3 RGBA_Gfx_Func func;
4 4
5 ptr = src->image.data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x; 5 ptr = src->image.data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
6 if (dc->mul.use) 6 if (mul_col != 0xffffffff)
7 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op); 7 func = evas_common_gfx_func_composite_pixel_color_span_get(src, mul_col, dst, dst_clip_w, render_op);
8 else 8 else
9 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op); 9 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, render_op);
10 10
11 while (dst_clip_h--) 11 while (dst_clip_h--)
12 { 12 {
13 func(ptr, NULL, dc->mul.col, dst_ptr, dst_clip_w); 13 func(ptr, NULL, mul_col, dst_ptr, dst_clip_w);
14 14
15 ptr += src_w; 15 ptr += src_w;
16 dst_ptr += dst_w; 16 dst_ptr += dst_w;
diff --git a/src/lib/evas/common/evas_scale_smooth_scaler_up.c b/src/lib/evas/common/evas_scale_smooth_scaler_up.c
index 2f323bd978..e43e0c7a6c 100644
--- a/src/lib/evas/common/evas_scale_smooth_scaler_up.c
+++ b/src/lib/evas/common/evas_scale_smooth_scaler_up.c
@@ -19,11 +19,11 @@
19 /* a scanline buffer */ 19 /* a scanline buffer */
20 pdst = dst_ptr; // it's been set at (dst_clip_x, dst_clip_y) 20 pdst = dst_ptr; // it's been set at (dst_clip_x, dst_clip_y)
21 pdst_end = pdst + (dst_clip_h * dst_w); 21 pdst_end = pdst + (dst_clip_h * dst_w);
22 if (!dc->mul.use) 22 if (mul_col == 0xffffffff)
23 { 23 {
24 if ((dc->render_op == _EVAS_RENDER_BLEND) && !src->cache_entry.flags.alpha) 24 if ((render_op == _EVAS_RENDER_BLEND) && !src->cache_entry.flags.alpha)
25 { direct_scale = 1; buf_step = dst->cache_entry.w; } 25 { direct_scale = 1; buf_step = dst->cache_entry.w; }
26 else if (dc->render_op == _EVAS_RENDER_COPY) 26 else if (render_op == _EVAS_RENDER_COPY)
27 { 27 {
28 direct_scale = 1; buf_step = dst->cache_entry.w; 28 direct_scale = 1; buf_step = dst->cache_entry.w;
29 if (src->cache_entry.flags.alpha) 29 if (src->cache_entry.flags.alpha)
@@ -33,10 +33,10 @@
33 if (!direct_scale) 33 if (!direct_scale)
34 { 34 {
35 buf = alloca(dst_clip_w * sizeof(DATA32)); 35 buf = alloca(dst_clip_w * sizeof(DATA32));
36 if (dc->mul.use) 36 if (mul_col != 0xffffffff)
37 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op); 37 func = evas_common_gfx_func_composite_pixel_color_span_get(src, mul_col, dst, dst_clip_w, render_op);
38 else 38 else
39 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op); 39 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, render_op);
40 } 40 }
41 else 41 else
42 buf = pdst; 42 buf = pdst;
@@ -99,7 +99,7 @@
99 } 99 }
100 /* * blend here [clip_w *] buf -> dptr * */ 100 /* * blend here [clip_w *] buf -> dptr * */
101 if (!direct_scale) 101 if (!direct_scale)
102 func(buf, NULL, dc->mul.col, pdst, dst_clip_w); 102 func(buf, NULL, mul_col, pdst, dst_clip_w);
103 103
104 pdst += dst_w; 104 pdst += dst_w;
105 psrc += src_w; 105 psrc += src_w;
@@ -149,7 +149,7 @@
149 } 149 }
150 /* * blend here [clip_w *] buf -> dptr * */ 150 /* * blend here [clip_w *] buf -> dptr * */
151 if (!direct_scale) 151 if (!direct_scale)
152 func(buf, NULL, dc->mul.col, pdst, dst_clip_w); 152 func(buf, NULL, mul_col, pdst, dst_clip_w);
153 pdst += dst_w; 153 pdst += dst_w;
154 syy += dsyy; 154 syy += dsyy;
155 buf += buf_step; 155 buf += buf_step;
@@ -223,7 +223,7 @@
223 } 223 }
224 /* * blend here [clip_w *] buf -> dptr * */ 224 /* * blend here [clip_w *] buf -> dptr * */
225 if (!direct_scale) 225 if (!direct_scale)
226 func(buf, NULL, dc->mul.col, pdst, dst_clip_w); 226 func(buf, NULL, mul_col, pdst, dst_clip_w);
227 227
228 pdst += dst_w; 228 pdst += dst_w;
229 syy += dsyy; 229 syy += dsyy;