summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_scale_sample.c
diff options
context:
space:
mode:
authorBrett Nash <nash@nash.id.au>2011-04-06 05:38:38 +0000
committerBrett Nash <nash@nash.id.au>2011-04-06 05:38:38 +0000
commitb96d2273347560cb415ffb2df3b059dc2229dd50 (patch)
tree6253ca2e3ff8f920036572e87322ba20244a135c /legacy/evas/src/lib/engines/common/evas_scale_sample.c
parenta5d83e3cbe92df04e13e5f59b4c0885615bfd169 (diff)
Masking: Push a bit more arbitrary clipping
This seems to have got lost in my big messup before. This pushes enough of mask/arbitrary clip to be somewhat useful. I need to push a little more soon for it to be 100% happy, but this is useful level. SVN revision: 58373
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_scale_sample.c25
1 files changed, 23 insertions, 2 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 c6fa9f21c1..1ee1960649 100644
--- a/legacy/evas/src/lib/engines/common/evas_scale_sample.c
+++ b/legacy/evas/src/lib/engines/common/evas_scale_sample.c
@@ -94,6 +94,8 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
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 src_w, src_h, dst_w, dst_h; 95 int src_w, src_h, dst_w, dst_h;
96 RGBA_Gfx_Func func; 96 RGBA_Gfx_Func func;
97 RGBA_Image *maskobj;
98 DATA8 *mask = NULL;
97 99
98 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))) 100 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)))
99 return; 101 return;
@@ -235,7 +237,20 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
235 /* figure out dest start ptr */ 237 /* figure out dest start ptr */
236 dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w); 238 dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w);
237 239
238 if (dc->mul.use) 240 if (dc->mask.mask)
241 {
242 func = evas_common_gfx_func_composite_pixel_mask_span_get(src, dst, dst_clip_w, dc->render_op);
243 maskobj = dc->mask.mask;
244 mask = maskobj->mask.mask;
245 if (1 || dst_region_w > src_region_w || dst_region_h > src_region_h){
246 printf("Mask w/h: %d/%d\n",maskobj->cache_entry.w,
247 maskobj->cache_entry.h);
248 printf("Warning: Unscaled mask (%d/%d) // (%d/%d)\n",
249 dst_region_w,src_region_w,
250 dst_region_h,src_region_h);
251 }
252 }
253 else if (dc->mul.use)
239 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op); 254 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
240 else 255 else
241 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op); 256 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op);
@@ -246,14 +261,20 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
246 for (y = 0; y < dst_clip_h; y++) 261 for (y = 0; y < dst_clip_h; y++)
247 { 262 {
248 /* * blend here [clip_w *] ptr -> dst_ptr * */ 263 /* * blend here [clip_w *] ptr -> dst_ptr * */
264 if (mask)
265 {
266 mask += dst_clip_x - dc->mask.x;
267 mask += (dst_clip_y - dc->mask.y) * maskobj->cache_entry.w;
268 }
249#ifdef EVAS_SLI 269#ifdef EVAS_SLI
250 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y) 270 if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
251#endif 271#endif
252 { 272 {
253 func(ptr, NULL, dc->mul.col, dst_ptr, dst_clip_w); 273 func(ptr, mask, dc->mul.col, dst_ptr, dst_clip_w);
254 } 274 }
255 ptr += src_w; 275 ptr += src_w;
256 dst_ptr += dst_w; 276 dst_ptr += dst_w;
277 if (mask) mask += maskobj->cache_entry.w;
257 } 278 }
258 } 279 }
259 else 280 else