summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_sample.c30
1 files changed, 8 insertions, 22 deletions
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 c8aef859a6..b505450f9e 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_sample.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_sample.c
@@ -225,24 +225,21 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
225 if (dst_clip_h <= 0) return; 225 if (dst_clip_h <= 0) return;
226 226
227 /* allocate scale lookup tables */ 227 /* allocate scale lookup tables */
228 lin_ptr = malloc(dst_clip_w * sizeof(int)); 228 lin_ptr = alloca(dst_clip_w * sizeof(int));
229 if (!lin_ptr) goto no_lin_ptr; 229 row_ptr = alloca(dst_clip_h * sizeof(DATA32 *));
230 row_ptr = malloc(dst_clip_h * sizeof(DATA32 *));
231 if (!row_ptr) goto no_row_ptr;
232 230
233 /* figure out dst jump */ 231 /* figure out dst jump */
234 dst_jump = dst_w - dst_clip_w; 232 dst_jump = dst_w - dst_clip_w;
235 233
236 /* figure out dest start ptr */ 234 /* figure out dest start ptr */
237 dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w); 235 dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w);
238 236
239 if (dc->mul.use) 237 if (dc->mul.use)
240 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op); 238 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
241 else 239 else
242 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op); 240 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op);
243 241
244 if ((dst_region_w == src_region_w) && 242 if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h))
245 (dst_region_h == src_region_h))
246 { 243 {
247 ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x; 244 ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
248 for (y = 0; y < dst_clip_h; y++) 245 for (y = 0; y < dst_clip_h; y++)
@@ -273,8 +270,8 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
273 (!(dst->flags & RGBA_IMAGE_HAS_ALPHA)) && 270 (!(dst->flags & RGBA_IMAGE_HAS_ALPHA)) &&
274 (!dc->mul.use)) 271 (!dc->mul.use))
275 { 272 {
276 for (y = 0; y < dst_clip_h; y++) 273 for (y = 0; y < dst_clip_h; y++)
277 { 274 {
278#ifdef EVAS_SLI 275#ifdef EVAS_SLI
279 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y) 276 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
280#endif 277#endif
@@ -295,8 +292,6 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
295 { 292 {
296 /* a scanline buffer */ 293 /* a scanline buffer */
297 buf = alloca(dst_clip_w * sizeof(DATA32)); 294 buf = alloca(dst_clip_w * sizeof(DATA32));
298 if (!buf) goto no_buf;
299
300 for (y = 0; y < dst_clip_h; y++) 295 for (y = 0; y < dst_clip_h; y++)
301 { 296 {
302#ifdef EVAS_SLI 297#ifdef EVAS_SLI
@@ -317,15 +312,6 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
317 } 312 }
318 } 313 }
319 } 314 }
320
321 no_buf:
322 /* free scale tables */
323 free(row_ptr);
324 no_row_ptr:
325 free(lin_ptr);
326
327 //_WIN32_WCE
328 no_lin_ptr: ;
329} 315}
330#else 316#else
331#ifdef BUILD_SCALE_SMOOTH 317#ifdef BUILD_SCALE_SMOOTH