Evas filters: Add basic support for clip in blend

Right now, clip is used only when blending RGBA surfaces.
This commit is contained in:
Jean-Philippe Andre 2013-12-10 16:20:45 +09:00
parent a0634dc04e
commit a5abbf784e
4 changed files with 9 additions and 2 deletions

View File

@ -2163,7 +2163,7 @@ evas_object_text_render(Evas_Object *eo_obj EINA_UNUSED,
}
// FIXME: This final blend is not necessary. Needs to be removed.
evas_filter_command_blend_add(filter, filter_ctx, outbuf, targetbuf,
evas_filter_command_blend_add(filter, context, outbuf, targetbuf,
X + x, Y + y);
ENFN->context_free(ENDT, filter_ctx);

View File

@ -745,6 +745,8 @@ evas_filter_command_blend_add(Evas_Filter_Context *ctx, void *drawctx,
cmd->draw.ox = ox;
cmd->draw.oy = oy;
cmd->draw.render_op = ENFN->context_render_op_get(ENDT, drawctx);
ENFN->context_clip_get(ENDT, drawctx, &cmd->draw.clipx, &cmd->draw.clipy,
&cmd->draw.clipw, &cmd->draw.cliph);
return cmd->id;
}

View File

@ -54,6 +54,7 @@ _filter_blend_cpu_alpha(Evas_Filter_Command *cmd)
}
_clip_to_target(&sx, &sy, sw, sh, ox, oy, dw, dh, &dx, &dy, &rows, &cols);
// FIXME/TODO: Clip to context clip
if (cols <= 0 || rows <= 0)
return EINA_TRUE;
@ -91,6 +92,8 @@ _filter_blend_cpu_rgba(Evas_Filter_Command *cmd)
cmd->ENFN->context_color_set(cmd->ENDT, drawctx, cmd->draw.R, cmd->draw.G,
cmd->draw.B, cmd->draw.A);
cmd->ENFN->context_render_op_set(cmd->ENDT, drawctx, cmd->draw.render_op);
cmd->ENFN->context_clip_set(cmd->ENDT, drawctx, cmd->draw.clipx,
cmd->draw.clipy, cmd->draw.clipw, cmd->draw.cliph);
cmd->ENFN->image_draw(cmd->ENDT, drawctx, out, in,
0, 0, w, h, // src
@ -141,6 +144,7 @@ _filter_blend_cpu_mask_rgba(Evas_Filter_Command *cmd)
}
_clip_to_target(&sx, &sy, sw, sh, ox, oy, dw, dh, &dx, &dy, &rows, &cols);
// FIXME/TODO: Clip to context clip
if (cols <= 0 || rows <= 0)
return EINA_TRUE;
@ -181,6 +185,7 @@ _filter_blend_cpu_rgba2alpha(Evas_Filter_Command *cmd)
dstdata = out->mask.data;
_clip_to_target(&sx, &sy, sw, sh, ox, oy, dw, dh, &dx, &dy, &rows, &cols);
// FIXME/TODO: Clip to context clip
if (cols <= 0 || rows <= 0)
return EINA_TRUE;

View File

@ -100,7 +100,7 @@ struct _Evas_Filter_Command
int render_op;
int R, G, B, A;
int ox, oy;
// TODO: Add clip
int clipx, clipy, clipw, cliph;
} draw;
};