From a332d1c86984c380c1e8d94db12d28b9b71b167f Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Wed, 5 Dec 2012 13:52:59 +0000 Subject: [PATCH] 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 --- src/lib/evas/canvas/evas_clip.c | 13 +--- src/lib/evas/canvas/evas_render.c | 15 +--- src/lib/evas/common/evas_draw.h | 2 - src/lib/evas/common/evas_draw_main.c | 49 ------------ src/lib/evas/common/evas_line_main.c | 89 +++------------------- src/lib/evas/common/evas_polygon_main.c | 10 +-- src/lib/evas/common/evas_scale_sample.c | 66 +--------------- .../evas/common/evas_scale_smooth_scaler_noscale.c | 34 ++------- src/lib/evas/include/evas_common.h | 9 --- src/lib/evas/include/evas_inline.x | 1 - src/lib/evas/include/evas_private.h | 4 - .../evas/engines/gl_common/evas_gl_context.c | 15 ---- src/modules/evas/engines/gl_common/evas_gl_image.c | 36 +-------- src/modules/evas/engines/gl_x11/evas_engine.c | 15 ---- .../evas/engines/software_generic/evas_engine.c | 48 ------------ 15 files changed, 25 insertions(+), 381 deletions(-) diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c index fbeb719..e56a10b 100644 --- a/src/lib/evas/canvas/evas_clip.c +++ b/src/lib/evas/canvas/evas_clip.c @@ -290,17 +290,10 @@ _clip_set(Eo *eo_obj, void *_pd, va_list *list) /* If it's NOT a rectangle set the mask bits too */ /* FIXME: Optmz ths chck */ - if (clip->type == o_rect_type) - obj->cur.mask = NULL; - else + if (clip->type != o_rect_type) { - void *engdata; - obj->cur.mask = eo_clip; - engdata = clip->func->engine_data_get(eo_clip); - /* FIXME: Images only */ - clip->layer->evas->engine.func->image_mask_create( - clip->layer->evas->engine.data.output, - engdata); + ERR("Not supported clipping to type '%s', just rectangles.", + clip->type); } evas_object_change(eo_clip, clip); evas_object_change(eo_obj, obj); diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index f5b3bda..85f6be5 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1625,20 +1625,7 @@ evas_render_updates_internal(Evas *eo_e, obj->cur.cache.clip.w, obj->cur.cache.clip.h); } - if (obj->cur.mask) - { - Evas_Object_Protected_Data *cur_mask = eo_data_get(obj->cur.mask, EVAS_OBJ_CLASS); - e->engine.func->context_mask_set(e->engine.data.output, - e->engine.data.context, - cur_mask->func->engine_data_get(obj->cur.mask), - cur_mask->cur.geometry.x + off_x, - cur_mask->cur.geometry.y + off_y, - cur_mask->cur.geometry.w, - cur_mask->cur.geometry.h); - } - else - e->engine.func->context_mask_unset(e->engine.data.output, - e->engine.data.context); + e->engine.func->context_clip_set(e->engine.data.output, e->engine.data.context, x, y, w, h); diff --git a/src/lib/evas/common/evas_draw.h b/src/lib/evas/common/evas_draw.h index 6599d54..3f01a75 100644 --- a/src/lib/evas/common/evas_draw.h +++ b/src/lib/evas/common/evas_draw.h @@ -17,8 +17,6 @@ EAPI void evas_common_draw_context_unset_clip (RGBA_D EAPI void evas_common_draw_context_set_color (RGBA_Draw_Context *dc, int r, int g, int b, int a); EAPI void evas_common_draw_context_set_multiplier (RGBA_Draw_Context *dc, int r, int g, int b, int a); EAPI void evas_common_draw_context_unset_multiplier (RGBA_Draw_Context *dc); -EAPI void evas_common_draw_context_set_mask (RGBA_Draw_Context *dc, RGBA_Image *im, int x, int y, int w, int h); -EAPI void evas_common_draw_context_unset_mask (RGBA_Draw_Context *dc); EAPI Cutout_Rects *evas_common_draw_context_cutouts_new (void); EAPI void evas_common_draw_context_cutouts_free (Cutout_Rects* rects); EAPI void evas_common_draw_context_cutouts_del (Cutout_Rects* rects, int idx); diff --git a/src/lib/evas/common/evas_draw_main.c b/src/lib/evas/common/evas_draw_main.c index 28b54cd..bfed3e4 100644 --- a/src/lib/evas/common/evas_draw_main.c +++ b/src/lib/evas/common/evas_draw_main.c @@ -174,55 +174,6 @@ evas_common_draw_context_unset_multiplier(RGBA_Draw_Context *dc) dc->mul.use = 0; } -EAPI void -evas_common_draw_context_set_mask(RGBA_Draw_Context *dc, RGBA_Image *mask, int x, int y, int w, int h) -{ - dc->mask.mask = mask; - dc->mask.x = x; - dc->mask.y = y; - dc->mask.w = w; - dc->mask.h = h; - -#ifdef HAVE_PIXMAN - if (mask->pixman.im) - pixman_image_unref(mask->pixman.im); - - if (mask->cache_entry.flags.alpha) - { - mask->pixman.im = pixman_image_create_bits(PIXMAN_a8r8g8b8, w, h, - (uint32_t *)mask->mask.mask, - w * 4); - } - else - { - mask->pixman.im = pixman_image_create_bits(PIXMAN_x8r8g8b8, w, h, - (uint32_t *)mask->mask.mask, - w * 4); - } -#endif - -} - -EAPI void -evas_common_draw_context_unset_mask(RGBA_Draw_Context *dc) -{ - dc->mask.mask = NULL; - -#ifdef HAVE_PIXMAN - RGBA_Image *mask; - mask = (RGBA_Image *)dc->mask.mask; - - if (mask && mask->pixman.im) - { - pixman_image_unref(mask->pixman.im); - mask->pixman.im = NULL; - } -#endif -} - - - - EAPI void evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w, int h) diff --git a/src/lib/evas/common/evas_line_main.c b/src/lib/evas/common/evas_line_main.c index 51f851b..baea395 100644 --- a/src/lib/evas/common/evas_line_main.c +++ b/src/lib/evas/common/evas_line_main.c @@ -200,17 +200,10 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i p = dst->image.data + (dstw * y0) + x0; #ifdef HAVE_PIXMAN # ifdef PIXMAN_LINE - if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (!dc->mask.mask)) + if ((dst->pixman.im) && (dc->col.pixman_color_image)) pixman_image_composite(op, dc->col.pixman_color_image, NULL, dst->pixman.im, x0, y0, 0, 0, x0, y0, len, 1); - else if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (dc->mask.mask)) - pixman_image_composite(op, dc->col.pixman_color_image, - dc->mask.mask->pixman.im, - dst->pixman.im, - x0, y0, 0, 0, x0, y0, len, 1); else # endif #endif @@ -237,16 +230,10 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i p = dst->image.data + (dstw * y0) + x0; #ifdef HAVE_PIXMAN # ifdef PIXMAN_LINE - if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (!dc->mask.mask)) + if ((dst->pixman.im) && (dc->col.pixman_color_image)) pixman_image_composite(op, dc->col.pixman_color_image, NULL, dst->pixman.im, x0, y0, 0, 0, x0, y0, 1, len); - else if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (dc->mask.mask)) - pixman_image_composite(op, dc->col.pixman_color_image, - dc->mask.mask->pixman.im, dst->pixman.im, - x0, y0, 0, 0, x0, y0, 1, len); else # endif #endif @@ -347,23 +334,13 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i { #ifdef HAVE_PIXMAN # ifdef PIXMAN_LINE - if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (!dc->mask.mask)) + if ((dst->pixman.im) && (dc->col.pixman_color_image)) pixman_image_composite(op, dc->col.pixman_color_image, NULL, dst->pixman.im, pixman_x_position, pixman_y_position, 0, 0, pixman_x_position, pixman_y_position, 1, 1); - else if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (dc->mask.mask)) - pixman_image_composite(op, dc->col.pixman_color_image, - dc->mask.mask->pixman.im, - dst->pixman.im, - pixman_x_position, - pixman_y_position, 0, 0, - pixman_x_position, - pixman_y_position, 1, 1); else # endif #endif @@ -621,19 +598,11 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, { #ifdef HAVE_PIXMAN # ifdef PIXMAN_LINE - if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (!dc->mask.mask)) + if ((dst->pixman.im) && (dc->col.pixman_color_image)) pixman_image_composite(op, dc->col.pixman_color_image, NULL, dst->pixman.im, pix_x, pix_y, 0, 0, pix_x, pix_y, 1, 1); - else if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (dc->mask.mask)) - pixman_image_composite(op, dc->col.pixman_color_image, - dc->mask.mask->pixman.im, - dst->pixman.im, - pix_x, pix_y, 0, 0, - pix_x, pix_y, 1, 1); else # endif #endif @@ -685,19 +654,11 @@ next_x: { #ifdef HAVE_PIXMAN # ifdef PIXMAN_LINE - if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (!dc->mask.mask)) + if ((dst->pixman.im) && (dc->col.pixman_color_image)) pixman_image_composite(op, dc->col.pixman_color_image, NULL, dst->pixman.im, pix_x, pix_y, 0, 0, pix_x, pix_y, 1, 1); - else if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (dc->mask.mask)) - pixman_image_composite(op, dc->col.pixman_color_image, - dc->mask.mask->pixman.im, - dst->pixman.im, - pix_x, pix_y, 0, 0, - pix_x, pix_y, 1, 1); else # endif #endif @@ -828,20 +789,12 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1, (uint32_t *)&alpha_data_buffer, 4); - if ((dst->pixman.im) && (dc->col.pixman_color_image ) && - (!dc->mask.mask)) + if ((dst->pixman.im) && (dc->col.pixman_color_image)) pixman_image_composite(PIXMAN_OP_OVER, dc->col.pixman_color_image, aa_mask_image, dst->pixman.im, pix_x, pix_y, 0, 0, pix_x, pix_y, 1, 1); - else if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (dc->mask.mask) ) - pixman_image_composite(op, dc->col.pixman_color_image, - dc->mask.mask->pixman.im, - dst->pixman.im, - pix_x, pix_y, 0, 0, - pix_x, pix_y, 1, 1); else # endif #endif @@ -860,20 +813,12 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1, (uint32_t *)&alpha_data_buffer, 4); - if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (!dc->mask.mask)) + if ((dst->pixman.im) && (dc->col.pixman_color_image)) pixman_image_composite(PIXMAN_OP_OVER, dc->col.pixman_color_image, aa_mask_image, dst->pixman.im, pix_x, pix_y + 1, 0, 0, pix_x, pix_y + 1, 1, 1); - else if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (dc->mask.mask)) - pixman_image_composite(op, dc->col.pixman_color_image, - dc->mask.mask->pixman.im, - dst->pixman.im, - pix_x, pix_y + 1, 0, 0, - pix_x, pix_y + 1, 1, 1); else # endif #endif @@ -937,20 +882,12 @@ next_x: alpha_data_buffer = 255 - aa; aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1, (uint32_t *)&alpha_data_buffer, 4); - if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (!dc->mask.mask)) + if ((dst->pixman.im) && (dc->col.pixman_color_image)) pixman_image_composite(PIXMAN_OP_OVER, dc->col.pixman_color_image, aa_mask_image, dst->pixman.im, pix_x, pix_y, 0, 0, pix_x, pix_y, 1, 1); - else if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (dc->mask.mask)) - pixman_image_composite(op, dc->col.pixman_color_image, - dc->mask.mask->pixman.im, - dst->pixman.im, - pix_x, pix_y, 0, 0, - pix_x, pix_y, 1, 1); else # endif #endif @@ -970,20 +907,12 @@ next_x: aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1, (uint32_t *)&alpha_data_buffer, 4); - if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (!dc->mask.mask)) + if ((dst->pixman.im) && (dc->col.pixman_color_image)) pixman_image_composite(PIXMAN_OP_OVER, dc->col.pixman_color_image, aa_mask_image, dst->pixman.im, pix_x + 1, pix_y, 0, 0, pix_x + 1, pix_y, 1, 1); - else if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (dc->mask.mask)) - pixman_image_composite(op, dc->col.pixman_color_image, - dc->mask.mask->pixman.im, - dst->pixman.im, - pix_x + 1, pix_y, 0, 0, - pix_x + 1, pix_y, 1, 1); else # endif #endif diff --git a/src/lib/evas/common/evas_polygon_main.c b/src/lib/evas/common/evas_polygon_main.c index f6c79c8..f82d245 100644 --- a/src/lib/evas/common/evas_polygon_main.c +++ b/src/lib/evas/common/evas_polygon_main.c @@ -289,19 +289,11 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po #ifdef HAVE_PIXMAN # ifdef PIXMAN_POLY - if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (!dc->mask.mask)) + if ((dst->pixman.im) && (dc->col.pixman_color_image)) pixman_image_composite(op, dc->col.pixman_color_image, NULL, dst->pixman.im, span->x, span->y, 0, 0, span->x, span->y, span->w, 1); - else if ((dst->pixman.im) && (dc->col.pixman_color_image) && - (dc->mask.mask)) - pixman_image_composite(op, dc->col.pixman_color_image, - dc->mask.mask->pixman.im, - dst->pixman.im, - span->x, span->y, 0, 0, - span->x, span->y, span->w, 1); else # endif #endif diff --git a/src/lib/evas/common/evas_scale_sample.c b/src/lib/evas/common/evas_scale_sample.c index 9a94f90..5a11af8 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, DATA32 **row_ptr; DATA32 *ptr, *dst_ptr, *src_data, *dst_data; int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h; - int m_clip_x = 0, m_clip_y = 0, m_clip_w = 0, m_clip_h = 0, mdx = 0, mdy = 0; int src_w, src_h, dst_w, dst_h; RGBA_Gfx_Func func; - RGBA_Image *maskobj = NULL; - DATA8 *mask = NULL; 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))) return; @@ -120,21 +117,6 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst, dst_clip_h = dst_h; } - if (dc->mask.mask) - { - m_clip_x = dc->mask.x; - m_clip_y = dc->mask.y; - m_clip_w = dc->mask.mask->cache_entry.w; - m_clip_h = dc->mask.mask->cache_entry.h; - RECTS_CLIP_TO_RECT(m_clip_x, m_clip_y, m_clip_w, m_clip_h, - dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h); - if ((m_clip_w <= 0) || (m_clip_h <= 0)) return; - dst_clip_x = m_clip_x; - dst_clip_y = m_clip_y; - dst_clip_w = m_clip_w; - dst_clip_h = m_clip_h; - } - if (dst_clip_x < dst_region_x) { 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, /* figure out dest start ptr */ dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w); - if (dc->mask.mask) - { - func = evas_common_gfx_func_composite_pixel_mask_span_get(src, dst, dst_clip_w, dc->render_op); - maskobj = dc->mask.mask; - mask = maskobj->mask.mask; -/* - if (1 || dst_region_w > src_region_w || dst_region_h > src_region_h){ - printf("Mask w/h: %d/%d\n",maskobj->cache_entry.w, - maskobj->cache_entry.h); - printf("Warning: Unscaled mask (%d/%d) // (%d/%d)\n", - dst_region_w,src_region_w, - dst_region_h,src_region_h); - } - */ - } - else if (dc->mul.use) + if (dc->mul.use) func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op); else 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, { #ifdef HAVE_PIXMAN # ifdef PIXMAN_IMAGE_SCALE_SAMPLE - if ((src->pixman.im) && (dst->pixman.im) && (!dc->mask.mask) && - ((!dc->mul.use) || + if ((src->pixman.im) && (dst->pixman.im) && ((!dc->mul.use) || ((dc->mul.use) && (dc->mul.col == 0xffffffff))) && ((dc->render_op == _EVAS_RENDER_COPY) || (dc->render_op == _EVAS_RENDER_BLEND))) @@ -276,44 +242,18 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst, dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h); } - else if ((src->pixman.im) && (dst->pixman.im) && - (dc->mask.mask) && (dc->mask.mask->pixman.im) && - ((dc->render_op == _EVAS_RENDER_COPY) || - (dc->render_op == _EVAS_RENDER_BLEND))) - { - // In case of pixel and color operation. - pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY - if (dc->render_op == _EVAS_RENDER_BLEND) - op = PIXMAN_OP_OVER; - - pixman_image_composite(op, - src->pixman.im, dc->mask.mask->pixman.im, - dst->pixman.im, - (dst_clip_x - dst_region_x) + src_region_x, - (dst_clip_y - dst_region_y) + src_region_y, - 0, 0, - dst_clip_x, dst_clip_y, - dst_clip_w, dst_clip_h); - } else # endif #endif { ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x; - if (mask) - { - mdx = (m_clip_x - dc->mask.x) + (m_clip_x - dst_clip_x); - mdy = (m_clip_y - dc->mask.y) + (m_clip_y - dst_clip_y); - mask += mdx + (mdy * maskobj->cache_entry.w); - } for (y = 0; y < dst_clip_h; y++) { /* * blend here [clip_w *] ptr -> dst_ptr * */ - func(ptr, mask, dc->mul.col, dst_ptr, dst_clip_w); + func(ptr, NULL, dc->mul.col, dst_ptr, dst_clip_w); ptr += src_w; dst_ptr += dst_w; - if (mask) mask += maskobj->cache_entry.w; } } } diff --git a/src/lib/evas/common/evas_scale_smooth_scaler_noscale.c b/src/lib/evas/common/evas_scale_smooth_scaler_noscale.c index 4f7d06b..1ac1ceb 100644 --- a/src/lib/evas/common/evas_scale_smooth_scaler_noscale.c +++ b/src/lib/evas/common/evas_scale_smooth_scaler_noscale.c @@ -1,43 +1,19 @@ { DATA32 *ptr; RGBA_Gfx_Func func; - RGBA_Image *maskobj; - DATA8 *mask = NULL; ptr = src->image.data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x; - if (dc->mask.mask) - { - func = evas_common_gfx_func_composite_pixel_mask_span_get(NULL, NULL, dst_clip_w, dc->render_op); - maskobj = dc->mask.mask; - mask = maskobj->mask.mask; - } - else if (dc->mul.use) + if (dc->mul.use) func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op); else func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op); - if (mask) - { - // mask += dst_clip_x - dc->mask.x; - // mask += (dst_clip_y - dc->mask.y) * maskobj->cache_entry.w; - while (dst_clip_h--) - { - func(ptr, mask, dc->mul.col, dst_ptr, dst_clip_w); - - ptr += src_w; - dst_ptr += dst_w; - mask += maskobj->cache_entry.w; - } - } - else + while (dst_clip_h--) { - while (dst_clip_h--) - { - func(ptr, NULL, dc->mul.col, dst_ptr, dst_clip_w); + func(ptr, NULL, dc->mul.col, dst_ptr, dst_clip_w); - ptr += src_w; - dst_ptr += dst_w; - } + ptr += src_w; + dst_ptr += dst_w; } } diff --git a/src/lib/evas/include/evas_common.h b/src/lib/evas/include/evas_common.h index 349598b..1795ca9 100644 --- a/src/lib/evas/include/evas_common.h +++ b/src/lib/evas/include/evas_common.h @@ -680,10 +680,6 @@ struct _RGBA_Draw_Context int x, y, w, h; Eina_Bool use : 1; } clip; - struct { - int x, y, w, h; - RGBA_Image *mask; - } mask; Cutout_Rects cutout; struct { struct { @@ -798,11 +794,6 @@ struct _RGBA_Image } image; struct { - DATA8 *mask; - Eina_Bool dirty: 1; - } mask; - - struct { LK(lock); Eina_List *list; unsigned long long orig_usage; diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x index 8d72291..bea9a6d 100644 --- a/src/lib/evas/include/evas_inline.x +++ b/src/lib/evas/include/evas_inline.x @@ -66,7 +66,6 @@ evas_object_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { if (obj->is_smart) return 0; /* If a mask: Assume alpha */ - if (obj->cur.mask) return 0; if (obj->cur.cache.clip.a == 255) { if (obj->func->is_opaque) diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index de5903f..8f0e14d 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -498,7 +498,6 @@ struct _Evas_Object_Protected_Data Evas_Map *map; Evas_Object_Protected_Data *clipper; Evas_Object *eo_clipper; - Evas_Object *mask; Evas_Object *map_parent; double scale; Evas_Coord_Rectangle geometry; @@ -774,8 +773,6 @@ struct _Evas_Func void (*context_clip_clip) (void *data, void *context, int x, int y, int w, int h); void (*context_clip_unset) (void *data, void *context); int (*context_clip_get) (void *data, void *context, int *x, int *y, int *w, int *h); - void (*context_mask_set) (void *data, void *context, void *mask, int x, int y, int w, int h); - void (*context_mask_unset) (void *data, void *context); void (*context_color_set) (void *data, void *context, int r, int g, int b, int a); int (*context_color_get) (void *data, void *context, int *r, int *g, int *b, int *a); void (*context_multiplier_set) (void *data, void *context, int r, int g, int b, int a); @@ -820,7 +817,6 @@ struct _Evas_Func void (*image_colorspace_set) (void *data, void *image, int cspace); int (*image_colorspace_get) (void *data, void *image); Eina_Bool (*image_can_region_get) (void *data, void *image); - void (*image_mask_create) (void *data, void *image); void *(*image_native_set) (void *data, void *image, void *native); void *(*image_native_get) (void *data, void *image); diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index 1b7c5b0..e55f3bd 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -1326,21 +1326,6 @@ evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc, GLuint prog = gc->shared->shader[SHADER_RECT].prog; int pn = 0; - if (gc->dc->mask.mask) - { - RGBA_Draw_Context *dc; - dc = gc->dc; - Evas_GL_Image *im; - im = (void *)dc->mask.mask; - evas_gl_common_context_font_push(gc, im->tex, - x - dc->mask.x, - y - dc->mask.y, - dc->mask.w, dc->mask.h, - x, y, w, h, - r, g, b, a); - return; - } - if (a < 255) blend = 1; if (gc->dc->render_op == EVAS_RENDER_COPY) blend = 0; diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c index 8289ed9..2e453c5 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_image.c +++ b/src/modules/evas/engines/gl_common/evas_gl_image.c @@ -686,10 +686,8 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, { static Cutout_Rects *rects = NULL; RGBA_Draw_Context *dc; - Evas_GL_Image *imm; int r, g, b, a; double ssx, ssy, ssw, ssh; - double mssx, mssy, mssw, mssh; Cutout_Rect *rct; int c, cx, cy, cw, ch; int i; @@ -700,7 +698,6 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, if (sw < 1) sw = 1; if (sh < 1) sh = 1; dc = gc->dc; - imm = (Evas_GL_Image *)dc->mask.mask; if (dc->mul.use) { a = (dc->mul.col >> 24) & 0xff; @@ -719,11 +716,6 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, evas_gl_common_rect_draw(gc, dx, dy, dw, dh); return; } - if (imm) - { - evas_gl_common_image_update(gc, imm); - if (!imm->tex) imm = NULL; /* Turn of mask on error */ - } if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) || (im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL)) @@ -735,7 +727,6 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, nv12 = 1; im->tex->im = im; - if (imm) imm->tex->im = imm; if ((!gc->dc->cutout.rects) || ((gc->shared->info.tune.cutout.max > 0) && (gc->dc->cutout.active > gc->shared->info.tune.cutout.max))) @@ -743,14 +734,13 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, if (gc->dc->clip.use) { int nx, ny, nw, nh; - double scalex,scaley; nx = dx; ny = dy; nw = dw; nh = dh; RECTS_CLIP_TO_RECT(nx, ny, nw, nh, gc->dc->clip.x, gc->dc->clip.y, gc->dc->clip.w, gc->dc->clip.h); if ((nw < 1) || (nh < 1)) return; - if ((!imm) && (nx == dx) && (ny == dy) && (nw == dw) && (nh == dh)) + if ((nx == dx) && (ny == dy) && (nw == dw) && (nh == dh)) { if (yuv) evas_gl_common_context_yuv_push(gc, @@ -788,28 +778,8 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, ssy = (double)sy + ((double)(sh * (ny - dy)) / (double)(dh)); ssw = ((double)sw * (double)(nw)) / (double)(dw); ssh = ((double)sh * (double)(nh)) / (double)(dh); - if (imm) - { - /* Correct ones here */ - scalex = imm->w / (double)dc->mask.w; - scaley = imm->h / (double)dc->mask.h; - mssx = scalex * (nx - dc->mask.x); - mssy = scaley * (ny - dc->mask.y); - mssw = scalex * nw; - mssh = scaley * nh; - - /* No yuv + imm I'm afraid */ - evas_gl_common_context_image_mask_push(gc, - im->tex, - imm->tex, - ssx, ssy, ssw, ssh, - mssx, mssy, mssw, mssh, - //dc->mask.x, dc->mask.y, dc->mask.w, dc->mask.h, - nx, ny, nw, nh, - r, g, b, a, - smooth); - } - else if (yuv) + + if (yuv) evas_gl_common_context_yuv_push(gc, im->tex, ssx, ssy, ssw, ssh, diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index 653a750..dc538b5 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -1372,20 +1372,6 @@ eng_image_colorspace_get(void *data EINA_UNUSED, void *image) return im->cs.space; } -static void -eng_image_mask_create(void *data EINA_UNUSED, void *image) -{ - Evas_GL_Image *im; - - if (!image) return; - im = image; - if (!im->im->image.data) - evas_cache_image_load_data(&im->im->cache_entry); - if (!im->tex) - im->tex = evas_gl_common_texture_new(im->gc, im->im); -} - - static void * eng_image_alpha_set(void *data, void *image, int has_alpha) { @@ -2941,7 +2927,6 @@ module_open(Evas_Module *em) ORD(image_colorspace_set); ORD(image_colorspace_get); ORD(image_can_region_get); - ORD(image_mask_create); ORD(image_native_set); ORD(image_native_get); diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index c91f8b7..6dd2201 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -369,25 +369,6 @@ eng_context_multiplier_get(void *data EINA_UNUSED, void *context, int *r, int *g } static void -eng_context_mask_set(void *data EINA_UNUSED, void *context, void *mask, int x, int y, int w, int h) -{ - evas_common_draw_context_set_mask(context, mask, x, y, w, h); -} - -static void -eng_context_mask_unset(void *data EINA_UNUSED, void *context) -{ - evas_common_draw_context_unset_mask(context); -} -/* -static void * -eng_context_mask_get(void *data EINA_UNUSED, void *context) -{ - return ((RGBA_Draw_Context *)context)->mask.mask; -} -*/ - -static void eng_context_cutout_add(void *data EINA_UNUSED, void *context, int x, int y, int w, int h) { evas_common_draw_context_add_cutout(context, x, y, w, h); @@ -531,32 +512,6 @@ eng_image_can_region_get(void *data EINA_UNUSED, void *image) return ((Evas_Image_Load_Func*) im->info.loader)->do_region; } -static void -eng_image_mask_create(void *data EINA_UNUSED, void *image) -{ - RGBA_Image *im; - int sz; - uint8_t *dst,*end; - uint32_t *src; - - if (!image) return; - im = image; - if (im->mask.mask && !im->mask.dirty) return; - - if (im->mask.mask) free(im->mask.mask); - sz = im->cache_entry.w * im->cache_entry.h; - im->mask.mask = malloc(sz); - dst = im->mask.mask; - if (!im->image.data) - evas_cache_image_load_data(&im->cache_entry); - src = (void*) im->image.data; - if (!src) return; - for (end = dst + sz ; dst < end ; dst ++, src ++) - *dst = *src >> 24; - im->mask.dirty = 0; -} - - static void * eng_image_alpha_set(void *data EINA_UNUSED, void *image, int has_alpha) { @@ -1713,8 +1668,6 @@ static Evas_Func func = eng_context_clip_clip, eng_context_clip_unset, eng_context_clip_get, - eng_context_mask_set, - eng_context_mask_unset, eng_context_color_set, eng_context_color_get, eng_context_multiplier_set, @@ -1759,7 +1712,6 @@ static Evas_Func func = eng_image_colorspace_set, eng_image_colorspace_get, eng_image_can_region_get, - eng_image_mask_create, eng_image_native_set, eng_image_native_get, /* image cache funcs */ -- 2.7.4