forked from enlightenment/efl
evas/proxy rendering - optimize proxy rendering.
re-render proxies if sources are changed. this patch increases the proxy rendering up to 2x.
This commit is contained in:
parent
5f4ae9abeb
commit
627beaae71
|
@ -3322,8 +3322,8 @@ _proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_proxy, Evas
|
||||||
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS);
|
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS);
|
||||||
Evas_Object_Protected_Data *source;
|
Evas_Object_Protected_Data *source;
|
||||||
void *ctx;
|
void *ctx;
|
||||||
/* Evas_Object *eo_obj2, *clip;*/
|
|
||||||
int w, h;
|
int w, h;
|
||||||
|
Eina_Bool src_redraw = EINA_FALSE;
|
||||||
|
|
||||||
if (!eo_source) return;
|
if (!eo_source) return;
|
||||||
source = eo_data_scope_get(eo_source, EVAS_OBJ_CLASS);
|
source = eo_data_scope_get(eo_source, EVAS_OBJ_CLASS);
|
||||||
|
@ -3353,37 +3353,47 @@ _proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_proxy, Evas
|
||||||
if (!proxy_write->surface) goto end;
|
if (!proxy_write->surface) goto end;
|
||||||
proxy_write->w = w;
|
proxy_write->w = w;
|
||||||
proxy_write->h = h;
|
proxy_write->h = h;
|
||||||
|
src_redraw = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = e->engine.func->context_new(e->engine.data.output);
|
if (!src_redraw)
|
||||||
e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, 0, 0);
|
src_redraw = evas_object_smart_changed_get(eo_source);
|
||||||
e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_RENDER_COPY);
|
|
||||||
e->engine.func->rectangle_draw(e->engine.data.output, ctx,
|
|
||||||
proxy_write->surface, 0, 0, w, h,
|
|
||||||
do_async);
|
|
||||||
e->engine.func->context_free(e->engine.data.output, ctx);
|
|
||||||
|
|
||||||
ctx = e->engine.func->context_new(e->engine.data.output);
|
if (src_redraw)
|
||||||
|
{
|
||||||
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
||||||
|
e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0,
|
||||||
|
0, 0);
|
||||||
|
e->engine.func->context_render_op_set(e->engine.data.output, ctx,
|
||||||
|
EVAS_RENDER_COPY);
|
||||||
|
e->engine.func->rectangle_draw(e->engine.data.output, ctx,
|
||||||
|
proxy_write->surface, 0, 0, w, h,
|
||||||
|
do_async);
|
||||||
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
||||||
|
|
||||||
Eina_Bool source_clip;
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
||||||
eo_do(eo_proxy, evas_obj_image_source_clip_get(&source_clip));
|
|
||||||
|
|
||||||
Evas_Proxy_Render_Data proxy_render_data = {
|
Eina_Bool source_clip;
|
||||||
.eo_proxy = eo_proxy,
|
eo_do(eo_proxy, evas_obj_image_source_clip_get(&source_clip));
|
||||||
.proxy_obj = proxy_obj,
|
|
||||||
.eo_src = eo_source,
|
Evas_Proxy_Render_Data proxy_render_data = {
|
||||||
.source_clip = source_clip
|
.eo_proxy = eo_proxy,
|
||||||
};
|
.proxy_obj = proxy_obj,
|
||||||
evas_render_mapped(e, eo_source, source, ctx, proxy_write->surface,
|
.eo_src = eo_source,
|
||||||
-source->cur->geometry.x,
|
.source_clip = source_clip
|
||||||
-source->cur->geometry.y,
|
};
|
||||||
1, 0, 0, e->output.w, e->output.h, &proxy_render_data
|
evas_render_mapped(e, eo_source, source, ctx, proxy_write->surface,
|
||||||
|
-source->cur->geometry.x,
|
||||||
|
-source->cur->geometry.y,
|
||||||
|
1, 0, 0, e->output.w, e->output.h,
|
||||||
|
&proxy_render_data
|
||||||
#ifdef REND_DBG
|
#ifdef REND_DBG
|
||||||
, 1
|
, 1
|
||||||
#endif
|
#endif
|
||||||
, do_async);
|
, do_async);
|
||||||
|
|
||||||
e->engine.func->context_free(e->engine.data.output, ctx);
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
||||||
|
}
|
||||||
proxy_write->surface = e->engine.func->image_dirty_region
|
proxy_write->surface = e->engine.func->image_dirty_region
|
||||||
(e->engine.data.output, proxy_write->surface, 0, 0, w, h);
|
(e->engine.data.output, proxy_write->surface, 0, 0, w, h);
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue