summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_scale_smooth_scaler.c
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/common/evas_scale_smooth_scaler.c
parent6ea27233227ee92afb21497a50f5224336f2489b (diff)
evas/common: Prepare soil to land scaling code for threaded render
SVN revision: 81188
Diffstat (limited to 'src/lib/evas/common/evas_scale_smooth_scaler.c')
-rw-r--r--src/lib/evas/common/evas_scale_smooth_scaler.c51
1 files changed, 16 insertions, 35 deletions
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;