summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_scale_sample.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-05 13:52:59 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-05 13:52:59 +0000
commita332d1c86984c380c1e8d94db12d28b9b71b167f (patch)
tree5bc25177cd8cfc383461871b15e631c701460308 /src/lib/evas/common/evas_scale_sample.c
parent3604cc2f4f4ebda49d2f4a87cb4f0ff6d92e8f88 (diff)
efl/evas: remove mask of non-rectangle objects.
it was broken and mostly disabled, so now we do remove it in the hope who does that next time, does it properly. SVN revision: 80252
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_scale_sample.c66
1 files changed, 3 insertions, 63 deletions
diff --git a/src/lib/evas/common/evas_scale_sample.c b/src/lib/evas/common/evas_scale_sample.c
index 9a94f904ea..5a11af8a6d 100644
--- a/src/lib/evas/common/evas_scale_sample.c
+++ b/src/lib/evas/common/evas_scale_sample.c
@@ -72,11 +72,8 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
72 DATA32 **row_ptr; 72 DATA32 **row_ptr;
73 DATA32 *ptr, *dst_ptr, *src_data, *dst_data; 73 DATA32 *ptr, *dst_ptr, *src_data, *dst_data;
74 int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h; 74 int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h;
75 int m_clip_x = 0, m_clip_y = 0, m_clip_w = 0, m_clip_h = 0, mdx = 0, mdy = 0;
76 int src_w, src_h, dst_w, dst_h; 75 int src_w, src_h, dst_w, dst_h;
77 RGBA_Gfx_Func func; 76 RGBA_Gfx_Func func;
78 RGBA_Image *maskobj = NULL;
79 DATA8 *mask = NULL;
80 77
81 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))) 78 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)))
82 return; 79 return;
@@ -120,21 +117,6 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
120 dst_clip_h = dst_h; 117 dst_clip_h = dst_h;
121 } 118 }
122 119
123 if (dc->mask.mask)
124 {
125 m_clip_x = dc->mask.x;
126 m_clip_y = dc->mask.y;
127 m_clip_w = dc->mask.mask->cache_entry.w;
128 m_clip_h = dc->mask.mask->cache_entry.h;
129 RECTS_CLIP_TO_RECT(m_clip_x, m_clip_y, m_clip_w, m_clip_h,
130 dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h);
131 if ((m_clip_w <= 0) || (m_clip_h <= 0)) return;
132 dst_clip_x = m_clip_x;
133 dst_clip_y = m_clip_y;
134 dst_clip_w = m_clip_w;
135 dst_clip_h = m_clip_h;
136 }
137
138 if (dst_clip_x < dst_region_x) 120 if (dst_clip_x < dst_region_x)
139 { 121 {
140 dst_clip_w += dst_clip_x - dst_region_x; 122 dst_clip_w += dst_clip_x - dst_region_x;
@@ -233,22 +215,7 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
233 /* figure out dest start ptr */ 215 /* figure out dest start ptr */
234 dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w); 216 dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w);
235 217
236 if (dc->mask.mask) 218 if (dc->mul.use)
237 {
238 func = evas_common_gfx_func_composite_pixel_mask_span_get(src, dst, dst_clip_w, dc->render_op);
239 maskobj = dc->mask.mask;
240 mask = maskobj->mask.mask;
241/*
242 if (1 || dst_region_w > src_region_w || dst_region_h > src_region_h){
243 printf("Mask w/h: %d/%d\n",maskobj->cache_entry.w,
244 maskobj->cache_entry.h);
245 printf("Warning: Unscaled mask (%d/%d) // (%d/%d)\n",
246 dst_region_w,src_region_w,
247 dst_region_h,src_region_h);
248 }
249 */
250 }
251 else if (dc->mul.use)
252 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op); 219 func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
253 else 220 else
254 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op); 221 func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op);
@@ -257,8 +224,7 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
257 { 224 {
258#ifdef HAVE_PIXMAN 225#ifdef HAVE_PIXMAN
259# ifdef PIXMAN_IMAGE_SCALE_SAMPLE 226# ifdef PIXMAN_IMAGE_SCALE_SAMPLE
260 if ((src->pixman.im) && (dst->pixman.im) && (!dc->mask.mask) && 227 if ((src->pixman.im) && (dst->pixman.im) && ((!dc->mul.use) ||
261 ((!dc->mul.use) ||
262 ((dc->mul.use) && (dc->mul.col == 0xffffffff))) && 228 ((dc->mul.use) && (dc->mul.col == 0xffffffff))) &&
263 ((dc->render_op == _EVAS_RENDER_COPY) || 229 ((dc->render_op == _EVAS_RENDER_COPY) ||
264 (dc->render_op == _EVAS_RENDER_BLEND))) 230 (dc->render_op == _EVAS_RENDER_BLEND)))
@@ -276,44 +242,18 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
276 dst_clip_x, dst_clip_y, 242 dst_clip_x, dst_clip_y,
277 dst_clip_w, dst_clip_h); 243 dst_clip_w, dst_clip_h);
278 } 244 }
279 else if ((src->pixman.im) && (dst->pixman.im) &&
280 (dc->mask.mask) && (dc->mask.mask->pixman.im) &&
281 ((dc->render_op == _EVAS_RENDER_COPY) ||
282 (dc->render_op == _EVAS_RENDER_BLEND)))
283 {
284 // In case of pixel and color operation.
285 pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
286 if (dc->render_op == _EVAS_RENDER_BLEND)
287 op = PIXMAN_OP_OVER;
288
289 pixman_image_composite(op,
290 src->pixman.im, dc->mask.mask->pixman.im,
291 dst->pixman.im,
292 (dst_clip_x - dst_region_x) + src_region_x,
293 (dst_clip_y - dst_region_y) + src_region_y,
294 0, 0,
295 dst_clip_x, dst_clip_y,
296 dst_clip_w, dst_clip_h);
297 }
298 else 245 else
299# endif 246# endif
300#endif 247#endif
301 { 248 {
302 ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x; 249 ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
303 if (mask)
304 {
305 mdx = (m_clip_x - dc->mask.x) + (m_clip_x - dst_clip_x);
306 mdy = (m_clip_y - dc->mask.y) + (m_clip_y - dst_clip_y);
307 mask += mdx + (mdy * maskobj->cache_entry.w);
308 }
309 for (y = 0; y < dst_clip_h; y++) 250 for (y = 0; y < dst_clip_h; y++)
310 { 251 {
311 /* * blend here [clip_w *] ptr -> dst_ptr * */ 252 /* * blend here [clip_w *] ptr -> dst_ptr * */
312 func(ptr, mask, dc->mul.col, dst_ptr, dst_clip_w); 253 func(ptr, NULL, dc->mul.col, dst_ptr, dst_clip_w);
313 254
314 ptr += src_w; 255 ptr += src_w;
315 dst_ptr += dst_w; 256 dst_ptr += dst_w;
316 if (mask) mask += maskobj->cache_entry.w;
317 } 257 }
318 } 258 }
319 } 259 }