forked from enlightenment/efl
evas/render - refactoring. split off a bunch of internal logic to a seprate function.
This commit is contained in:
parent
df7b19090a
commit
04f87ab237
|
@ -975,6 +975,61 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_render_mapped_context_clip_set(Evas_Public_Data *e, Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *ctx, Evas_Proxy_Render_Data *proxy_render_data, int off_x, int off_y)
|
||||
{
|
||||
int x, y, w, h;
|
||||
Eina_Bool proxy_src_clip = EINA_TRUE;
|
||||
|
||||
if (proxy_render_data) proxy_src_clip = proxy_render_data->source_clip;
|
||||
|
||||
if (proxy_src_clip)
|
||||
{
|
||||
x = obj->cur->cache.clip.x;
|
||||
y = obj->cur->cache.clip.y;
|
||||
w = obj->cur->cache.clip.w;
|
||||
h = obj->cur->cache.clip.h;
|
||||
|
||||
RECTS_CLIP_TO_RECT(x, y, w, h,
|
||||
obj->cur->clipper->cur->cache.clip.x,
|
||||
obj->cur->clipper->cur->cache.clip.y,
|
||||
obj->cur->clipper->cur->cache.clip.w,
|
||||
obj->cur->clipper->cur->cache.clip.h);
|
||||
|
||||
e->engine.func->context_clip_set(e->engine.data.output,
|
||||
ctx, x + off_x, y + off_y, w, h);
|
||||
}
|
||||
else
|
||||
{
|
||||
//FIXME: Consider to clip by the proxy clipper.
|
||||
if (proxy_render_data->eo_src != eo_obj)
|
||||
{
|
||||
x = obj->cur->clipper->cur->geometry.x + off_x;
|
||||
y = obj->cur->clipper->cur->geometry.y + off_y;
|
||||
w = obj->cur->clipper->cur->geometry.w;
|
||||
h = obj->cur->clipper->cur->geometry.h;
|
||||
e->engine.func->context_clip_set(e->engine.data.output, ctx, x, y,
|
||||
w, h);
|
||||
}
|
||||
else
|
||||
{
|
||||
Evas_Object_Protected_Data *proxy =
|
||||
proxy_render_data->proxy_obj;
|
||||
if (proxy->cur->clipper)
|
||||
{
|
||||
x = proxy->cur->clipper->cur->geometry.x +
|
||||
off_x;
|
||||
y = proxy->cur->clipper->cur->geometry.y +
|
||||
off_y;
|
||||
w = proxy->cur->clipper->cur->geometry.w;
|
||||
h = proxy->cur->clipper->cur->geometry.h;
|
||||
e->engine.func->context_clip_set(e->engine.data.output, ctx,
|
||||
x, y, w, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
|
||||
Evas_Object_Protected_Data *obj, void *context,
|
||||
|
@ -1301,54 +1356,11 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
|
|||
|
||||
if (obj->cur->clipper)
|
||||
{
|
||||
int x, y, w, h;
|
||||
|
||||
if (_evas_render_has_map(eo_obj, obj))
|
||||
evas_object_clip_recalc(obj);
|
||||
|
||||
if (proxy_src_clip)
|
||||
{
|
||||
x = obj->cur->cache.clip.x + off_x;
|
||||
y = obj->cur->cache.clip.y + off_y;
|
||||
w = obj->cur->cache.clip.w;
|
||||
h = obj->cur->cache.clip.h;
|
||||
|
||||
RECTS_CLIP_TO_RECT(x, y, w, h,
|
||||
obj->cur->clipper->cur->cache.clip.x + off_x,
|
||||
obj->cur->clipper->cur->cache.clip.y + off_y,
|
||||
obj->cur->clipper->cur->cache.clip.w,
|
||||
obj->cur->clipper->cur->cache.clip.h);
|
||||
|
||||
e->engine.func->context_clip_set(e->engine.data.output,
|
||||
ctx, x, y, w, h);
|
||||
}
|
||||
else
|
||||
{
|
||||
//FIXME: Consider to clip by the proxy clipper.
|
||||
if (proxy_render_data->eo_src != eo_obj)
|
||||
{
|
||||
x = obj->cur->clipper->cur->geometry.x + off_x;
|
||||
y = obj->cur->clipper->cur->geometry.y + off_y;
|
||||
w = obj->cur->clipper->cur->geometry.w;
|
||||
h = obj->cur->clipper->cur->geometry.h;
|
||||
e->engine.func->context_clip_set(e->engine.data.output, ctx, x, y, w, h);
|
||||
}
|
||||
else
|
||||
{
|
||||
Evas_Object_Protected_Data *proxy =
|
||||
proxy_render_data->proxy_obj;
|
||||
if (proxy->cur->clipper)
|
||||
{
|
||||
x = proxy->cur->clipper->cur->geometry.x +
|
||||
off_x;
|
||||
y = proxy->cur->clipper->cur->geometry.y +
|
||||
off_y;
|
||||
w = proxy->cur->clipper->cur->geometry.w;
|
||||
h = proxy->cur->clipper->cur->geometry.h;
|
||||
e->engine.func->context_clip_set(e->engine.data.output, ctx, x, y, w, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
_evas_render_mapped_context_clip_set(e, eo_obj, obj, ctx,
|
||||
proxy_render_data,
|
||||
off_x, off_y);
|
||||
}
|
||||
obj->func->render(eo_obj, obj, e->engine.data.output, ctx,
|
||||
surface, off_x, off_y, EINA_FALSE);
|
||||
|
|
Loading…
Reference in New Issue