jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ab89dc401c12e550880065dfe092f3e53aa201ac
commit ab89dc401c12e550880065dfe092f3e53aa201ac Author: Jean-Philippe Andre <jp.an...@samsung.com> Date: Fri Feb 27 15:57:36 2015 +0900 Evas masking: Check fill properties to consider image as filled Edje may not set the filled flag on an image even if its fill properties make it fill the whole object. For masking, it can then be considered as a filled image. --- src/lib/evas/canvas/evas_render.c | 47 ++++++++++++++-------- .../evas/engines/gl_common/evas_gl_context.c | 2 +- src/modules/evas/engines/gl_common/evas_gl_image.c | 7 ++-- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index c7facab..32c989e 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1824,24 +1824,39 @@ evas_render_mask_subrender(Evas_Public_Data *evas, EINA_COW_WRITE_BEGIN(evas_object_mask_cow, mask->mask, Evas_Object_Mask_Data, mdata) mdata->redraw = EINA_FALSE; - if (is_image && !prev_mask && mask->func->engine_data_get && - ENFN->image_scaled_update && evas_object_image_filled_get(mask->object)) + if (is_image) { - /* Fast path (for GL) that avoids creating a map surface, render the - * scaled image in it, when the shaders can just scale on the fly. */ - Eina_Bool smooth = evas_object_image_smooth_scale_get(mask->object); - void *original = mask->func->engine_data_get(mask->object); - void *scaled = ENFN->image_scaled_update - (ENDT, mdata->surface, original, w, h, smooth, EINA_TRUE, EVAS_COLORSPACE_GRY8); - if (scaled) + Eina_Bool filled = EINA_FALSE; + + if (evas_object_image_filled_get(mask->object)) + filled = EINA_TRUE; + else { - done = EINA_TRUE; - if (mdata->surface && (mdata->surface != scaled)) - ENFN->image_map_surface_free(ENDT, mdata->surface); - mdata->surface = scaled; - mdata->w = w; - mdata->h = h; - mdata->is_alpha = (ENFN->image_colorspace_get(ENDT, scaled) == EVAS_COLORSPACE_GRY8); + int fx, fy, fw, fh; + evas_object_image_fill_get(mask->object, &fx, &fy, &fw, &fh); + if ((fx == 0) && (fy == 0) && (fw == w) && (fh == h)) + filled = EINA_TRUE; + } + + if (filled & !prev_mask && mask->func->engine_data_get && + ENFN->image_scaled_update) + { + /* Fast path (for GL) that avoids creating a map surface, render the + * scaled image in it, when the shaders can just scale on the fly. */ + Eina_Bool smooth = evas_object_image_smooth_scale_get(mask->object); + void *original = mask->func->engine_data_get(mask->object); + void *scaled = ENFN->image_scaled_update + (ENDT, mdata->surface, original, w, h, smooth, EINA_TRUE, EVAS_COLORSPACE_GRY8); + if (scaled) + { + done = EINA_TRUE; + if (mdata->surface && (mdata->surface != scaled)) + ENFN->image_map_surface_free(ENDT, mdata->surface); + mdata->surface = scaled; + mdata->w = w; + mdata->h = h; + mdata->is_alpha = (ENFN->image_colorspace_get(ENDT, scaled) == EVAS_COLORSPACE_GRY8); + } } } 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 771f8b8..ff9ff26 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -3293,7 +3293,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc) if (shared->info.anisotropic > 0.0) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic); #endif - if (gc->pipe[i].array.mask_smooth) // (gc->pipe[i].shader.smooth) + if (gc->pipe[i].array.mask_smooth) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 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 c897bd2..f4efb18 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_image.c +++ b/src/modules/evas/engines/gl_common/evas_gl_image.c @@ -691,7 +691,10 @@ evas_gl_common_image_free(Evas_GL_Image *im) if (im->references > 0) return; if (im->scaled.origin) - evas_gl_common_image_free(im->scaled.origin); + { + evas_gl_common_image_free(im->scaled.origin); + im->scaled.origin = NULL; + } if (im->native.func.free) im->native.func.free(im->native.func.data, im); @@ -931,8 +934,6 @@ evas_gl_common_image_map_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int r, g, b, a; int c, cx, cy, cw, ch; - dc = gc->dc; - if (dc->mul.use) { a = (dc->mul.col >> 24) & 0xff; --