summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_scale_sample.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-04-23 02:02:45 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-04-23 02:02:45 +0000
commitfa309e5069c84a47fa9510c7b9962bd07b9ee17a (patch)
tree16585d30fdef96e2d60e8e39aa207ab1b57cf902 /legacy/evas/src/lib/engines/common/evas_scale_sample.c
parent8cca4234c46ebb442fd152aae51044c8aef1a55e (diff)
nash -> i fixed your mask rendering. interesting you only mask *IF*
you have 1:1 scaling. you could do this with scaled imaged (and unscaled masks) with ease. both smooth and nearest. SVN revision: 58838
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_sample.c34
1 files changed, 22 insertions, 12 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 6feb8e646e..54b8e92dc7 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_sample.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_sample.c
@@ -92,6 +92,7 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
92 DATA32 *ptr, *dst_ptr, *src_data, *dst_data; 92 DATA32 *ptr, *dst_ptr, *src_data, *dst_data;
93 int dst_jump; 93 int dst_jump;
94 int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h; 94 int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h;
95 int m_clip_x = 0, m_clip_y = 0, m_clip_w = 0, m_clip_h = 0, mdx = 0, mdy = 0;
95 int src_w, src_h, dst_w, dst_h; 96 int src_w, src_h, dst_w, dst_h;
96 RGBA_Gfx_Func func; 97 RGBA_Gfx_Func func;
97 RGBA_Image *maskobj = NULL; 98 RGBA_Image *maskobj = NULL;
@@ -139,6 +140,21 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
139 dst_clip_h = dst_h; 140 dst_clip_h = dst_h;
140 } 141 }
141 142
143 if (dc->mask.mask)
144 {
145 m_clip_x = dc->mask.x;
146 m_clip_y = dc->mask.y;
147 m_clip_w = dc->mask.mask->cache_entry.w;
148 m_clip_h = dc->mask.mask->cache_entry.h;
149 RECTS_CLIP_TO_RECT(m_clip_x, m_clip_y, m_clip_w, m_clip_h,
150 dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h);
151 if ((m_clip_w <= 0) || (m_clip_h <= 0)) return;
152 dst_clip_x = m_clip_x;
153 dst_clip_y = m_clip_y;
154 dst_clip_w = m_clip_w;
155 dst_clip_h = m_clip_h;
156 }
157
142 if (dst_clip_x < dst_region_x) 158 if (dst_clip_x < dst_region_x)
143 { 159 {
144 dst_clip_w += dst_clip_x - dst_region_x; 160 dst_clip_w += dst_clip_x - dst_region_x;
@@ -283,21 +299,15 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
283#endif 299#endif
284 { 300 {
285 ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x; 301 ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
302 if (mask)
303 {
304 mdx = (m_clip_x - dc->mask.x) + (m_clip_x - dst_clip_x);
305 mdy = (m_clip_y - dc->mask.y) + (m_clip_y - dst_clip_y);
306 mask += mdx + (mdy * maskobj->cache_entry.w);
307 }
286 for (y = 0; y < dst_clip_h; y++) 308 for (y = 0; y < dst_clip_h; y++)
287 { 309 {
288 /* * blend here [clip_w *] ptr -> dst_ptr * */ 310 /* * blend here [clip_w *] ptr -> dst_ptr * */
289 if (mask)
290 {
291 // nash: problem here. normally dst_clip_x == dc->mask.x
292 // but then... at some point they cease to be equal
293 // and thus you add a negative value to mask here
294 // in fact... u simply don't handle the mask being
295 // disjoint from the object. now maybe the test in
296 // expedite has a bug where it moves the mask img
297 // wrongly - but... i can see this code is fragile
298 mask += dst_clip_x - dc->mask.x;
299 mask += (dst_clip_y - dc->mask.y) * maskobj->cache_entry.w;
300 }
301#ifdef EVAS_SLI 311#ifdef EVAS_SLI
302 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y) 312 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
303#endif 313#endif