evas: fix clipping issue with pipe rendering.
SVN revision: 73322
This commit is contained in:
parent
a0141e0afd
commit
a99bf2c9b6
|
@ -382,9 +382,13 @@ evas_common_font_draw_do(const Cutout_Rects *reuse, const Eina_Rectangle *clip,
|
||||||
|
|
||||||
if (!reuse)
|
if (!reuse)
|
||||||
{
|
{
|
||||||
evas_common_draw_context_set_clip(dc, clip->x, clip->y, clip->w, clip->h);
|
evas_common_draw_context_clip_clip(dc,
|
||||||
|
clip->x, clip->y,
|
||||||
|
clip->w, clip->h);
|
||||||
evas_common_font_draw_internal(dst, dc, x, y, text_props,
|
evas_common_font_draw_internal(dst, dc, x, y, text_props,
|
||||||
func, clip->x, clip->y, clip->w, clip->h,
|
func,
|
||||||
|
dc->clip.x, dc->clip.y,
|
||||||
|
dc->clip.w, dc->clip.h,
|
||||||
im_w, im_h);
|
im_w, im_h);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
@ -393,7 +397,7 @@ evas_common_font_draw_do(const Cutout_Rects *reuse, const Eina_Rectangle *clip,
|
||||||
{
|
{
|
||||||
r = reuse->rects + i;
|
r = reuse->rects + i;
|
||||||
|
|
||||||
EINA_RECTANGLE_SET(&area, r->x, r->y, r->w, r->h);
|
EINA_RECTANGLE_SET(&area, r->x, r->y, r->w - 1, r->h - 1);
|
||||||
if (!eina_rectangle_intersection(&area, clip)) continue ;
|
if (!eina_rectangle_intersection(&area, clip)) continue ;
|
||||||
evas_common_draw_context_set_clip(dc, area.x, area.y, area.w, area.h);
|
evas_common_draw_context_set_clip(dc, area.x, area.y, area.w, area.h);
|
||||||
evas_common_font_draw_internal(dst, dc, x, y, text_props,
|
evas_common_font_draw_internal(dst, dc, x, y, text_props,
|
||||||
|
@ -405,7 +409,6 @@ evas_common_font_draw_do(const Cutout_Rects *reuse, const Eina_Rectangle *clip,
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
evas_common_font_draw_prepare_cutout(Cutout_Rects *reuse, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Gfx_Func *func)
|
evas_common_font_draw_prepare_cutout(Cutout_Rects *reuse, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Gfx_Func *func)
|
||||||
{
|
{
|
||||||
int ext_x, ext_y, ext_w, ext_h;
|
|
||||||
int im_w, im_h;
|
int im_w, im_h;
|
||||||
|
|
||||||
im_w = dst->cache_entry.w;
|
im_w = dst->cache_entry.w;
|
||||||
|
@ -413,43 +416,13 @@ evas_common_font_draw_prepare_cutout(Cutout_Rects *reuse, RGBA_Image *dst, RGBA_
|
||||||
|
|
||||||
*func = evas_common_gfx_func_composite_mask_color_span_get(dc->col.col, dst, 1, dc->render_op);
|
*func = evas_common_gfx_func_composite_mask_color_span_get(dc->col.col, dst, 1, dc->render_op);
|
||||||
|
|
||||||
ext_x = 0; ext_y = 0; ext_w = im_w; ext_h = im_h;
|
evas_common_draw_context_clip_clip(dc, 0, 0, im_w, im_h);
|
||||||
if (dc->clip.use)
|
if (dc->clip.w <= 0) return EINA_FALSE;
|
||||||
{
|
if (dc->clip.h <= 0) return EINA_FALSE;
|
||||||
ext_x = dc->clip.x;
|
|
||||||
ext_y = dc->clip.y;
|
|
||||||
ext_w = dc->clip.w;
|
|
||||||
ext_h = dc->clip.h;
|
|
||||||
if (ext_x < 0)
|
|
||||||
{
|
|
||||||
ext_w += ext_x;
|
|
||||||
ext_x = 0;
|
|
||||||
}
|
|
||||||
if (ext_y < 0)
|
|
||||||
{
|
|
||||||
ext_h += ext_y;
|
|
||||||
ext_y = 0;
|
|
||||||
}
|
|
||||||
if ((ext_x + ext_w) > im_w)
|
|
||||||
ext_w = im_w - ext_x;
|
|
||||||
if ((ext_y + ext_h) > im_h)
|
|
||||||
ext_h = im_h - ext_y;
|
|
||||||
}
|
|
||||||
if (ext_w <= 0) return EINA_FALSE;
|
|
||||||
if (ext_h <= 0) return EINA_FALSE;
|
|
||||||
|
|
||||||
if (dc->cutout.rects)
|
if (dc->cutout.rects)
|
||||||
{
|
{
|
||||||
evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
|
reuse = evas_common_draw_context_apply_cutouts(dc, reuse);
|
||||||
/* our clip is 0 size.. abort */
|
|
||||||
if ((dc->clip.w > 0) && (dc->clip.h > 0))
|
|
||||||
{
|
|
||||||
reuse = evas_common_draw_context_apply_cutouts(dc, reuse);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return EINA_FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
|
@ -287,14 +287,12 @@ evas_common_pipe_rectangle_draw_do(RGBA_Image *dst, const RGBA_Pipe_Op *op, cons
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
evas_common_pipe_rectangle_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op)
|
evas_common_pipe_rectangle_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op)
|
||||||
{
|
{
|
||||||
RGBA_Draw_Context context;
|
|
||||||
Cutout_Rects *recycle;
|
Cutout_Rects *recycle;
|
||||||
Thinfo *info = data;
|
Thinfo *info = data;
|
||||||
Eina_Bool r;
|
Eina_Bool r;
|
||||||
|
|
||||||
recycle = evas_pipe_cutout_rects_pop(info);
|
recycle = evas_pipe_cutout_rects_pop(info);
|
||||||
memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
|
r = evas_common_rectangle_draw_prepare(recycle, dst, &(op->context),
|
||||||
r = evas_common_rectangle_draw_prepare(recycle, dst, &context,
|
|
||||||
op->op.rect.x, op->op.rect.y,
|
op->op.rect.x, op->op.rect.y,
|
||||||
op->op.rect.w, op->op.rect.h);
|
op->op.rect.w, op->op.rect.h);
|
||||||
if (recycle->active) op->rects = recycle;
|
if (recycle->active) op->rects = recycle;
|
||||||
|
@ -436,14 +434,13 @@ evas_common_pipe_text_draw_do(RGBA_Image *dst, const RGBA_Pipe_Op *op, const RGB
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
evas_common_pipe_text_draw_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op)
|
evas_common_pipe_text_draw_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op)
|
||||||
{
|
{
|
||||||
RGBA_Draw_Context context;
|
|
||||||
Cutout_Rects *recycle;
|
Cutout_Rects *recycle;
|
||||||
Thinfo *info = data;
|
Thinfo *info = data;
|
||||||
Eina_Bool r;
|
Eina_Bool r;
|
||||||
|
|
||||||
recycle = evas_pipe_cutout_rects_pop(info);
|
recycle = evas_pipe_cutout_rects_pop(info);
|
||||||
memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
|
r = evas_common_font_draw_prepare_cutout(recycle, dst, &(op->context),
|
||||||
r = evas_common_font_draw_prepare_cutout(recycle, dst, &context, &(op->op.text.func));
|
&(op->op.text.func));
|
||||||
if (recycle->active) op->rects = recycle;
|
if (recycle->active) op->rects = recycle;
|
||||||
else evas_pipe_cutout_rects_push(info, recycle);
|
else evas_pipe_cutout_rects_push(info, recycle);
|
||||||
|
|
||||||
|
@ -485,14 +482,14 @@ evas_common_pipe_op_image_free(RGBA_Pipe_Op *op)
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
evas_common_pipe_op_image_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op)
|
evas_common_pipe_op_image_prepare(void *data, RGBA_Image *dst, RGBA_Pipe_Op *op)
|
||||||
{
|
{
|
||||||
RGBA_Draw_Context context;
|
|
||||||
Cutout_Rects *recycle;
|
Cutout_Rects *recycle;
|
||||||
Thinfo *info = data;
|
Thinfo *info = data;
|
||||||
Eina_Bool r;
|
Eina_Bool r;
|
||||||
|
|
||||||
recycle = evas_pipe_cutout_rects_pop(info);
|
recycle = evas_pipe_cutout_rects_pop(info);
|
||||||
memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
|
r = evas_common_scale_rgba_in_to_out_clip_prepare(recycle,
|
||||||
r = evas_common_scale_rgba_in_to_out_clip_prepare(recycle, op->op.image.src, dst, &(context),
|
op->op.image.src, dst,
|
||||||
|
&(op->context),
|
||||||
op->op.image.dx, op->op.image.dy,
|
op->op.image.dx, op->op.image.dy,
|
||||||
op->op.image.dw, op->op.image.dh);
|
op->op.image.dw, op->op.image.dh);
|
||||||
if (recycle->active) op->rects = recycle;
|
if (recycle->active) op->rects = recycle;
|
||||||
|
|
|
@ -80,7 +80,9 @@ evas_common_rectangle_draw_do(const Cutout_Rects *reuse,
|
||||||
|
|
||||||
if (!reuse)
|
if (!reuse)
|
||||||
{
|
{
|
||||||
evas_common_draw_context_set_clip(dc, clip->x, clip->y, clip->w, clip->h);
|
evas_common_draw_context_clip_clip(dc,
|
||||||
|
clip->x, clip->y,
|
||||||
|
clip->w, clip->h);
|
||||||
rectangle_draw_internal(dst, dc, x, y, w, h);
|
rectangle_draw_internal(dst, dc, x, y, w, h);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ evas_common_scale_rgba_in_to_out_clip_sample_do(const Cutout_Rects *reuse,
|
||||||
|
|
||||||
if (!reuse)
|
if (!reuse)
|
||||||
{
|
{
|
||||||
evas_common_draw_context_set_clip(dc, clip->x, clip->y, clip->w, clip->h);
|
evas_common_draw_context_clip_clip(dc, clip->x, clip->y, clip->w, clip->h);
|
||||||
scale_rgba_in_to_out_clip_sample_internal(src, dst, dc,
|
scale_rgba_in_to_out_clip_sample_internal(src, dst, dc,
|
||||||
src_region_x, src_region_y,
|
src_region_x, src_region_y,
|
||||||
src_region_w, src_region_h,
|
src_region_w, src_region_h,
|
||||||
|
|
|
@ -551,7 +551,7 @@ evas_common_scale_rgba_in_to_out_clip_smooth_do(const Cutout_Rects *reuse,
|
||||||
# endif
|
# endif
|
||||||
if (!reuse)
|
if (!reuse)
|
||||||
{
|
{
|
||||||
evas_common_draw_context_set_clip(dc, clip->x, clip->y, clip->w, clip->h);
|
evas_common_draw_context_clip_clip(dc, clip->x, clip->y, clip->w, clip->h);
|
||||||
# ifdef BUILD_MMX
|
# ifdef BUILD_MMX
|
||||||
if (mmx)
|
if (mmx)
|
||||||
evas_common_scale_rgba_in_to_out_clip_smooth_mmx(src, dst, dc,
|
evas_common_scale_rgba_in_to_out_clip_smooth_mmx(src, dst, dc,
|
||||||
|
|
Loading…
Reference in New Issue