forked from enlightenment/efl
parent
0e6b42e9b1
commit
f7b637ca03
|
@ -624,8 +624,8 @@ gaussian_filter(Evas_Filter_Info *filter, RGBA_Image *src, RGBA_Image *dst)
|
||||||
|
|
||||||
if (!in) return EINA_FALSE;
|
if (!in) return EINA_FALSE;
|
||||||
|
|
||||||
nw = w + 2 * blur->radius;
|
nw = w + (2 * blur->radius);
|
||||||
nh = h + 2 * blur->radius;
|
nh = h + (2 * blur->radius);
|
||||||
|
|
||||||
out = dst->image.data;
|
out = dst->image.data;
|
||||||
if (!out) return EINA_FALSE;
|
if (!out) return EINA_FALSE;
|
||||||
|
|
|
@ -2010,24 +2010,24 @@ image_filter_draw_under_recurse(Evas *e, Evas_Object *obj, Evas_Object *stop,
|
||||||
|
|
||||||
if (!evas_object_is_visible(obj)) return;
|
if (!evas_object_is_visible(obj)) return;
|
||||||
obj->pre_render_done = 1;
|
obj->pre_render_done = 1;
|
||||||
ctx = e->engine.func->context_new(output);
|
ctx = e->engine.func->context_new(output);
|
||||||
|
|
||||||
if (obj->smart.smart)
|
if (obj->smart.smart)
|
||||||
{
|
{
|
||||||
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2){
|
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
|
||||||
|
{
|
||||||
if (obj2 == stop) return;
|
if (obj2 == stop) return;
|
||||||
image_filter_draw_under_recurse(e, obj2, stop, output, surface, ctx, x,y);
|
image_filter_draw_under_recurse(e, obj2, stop, output, surface,
|
||||||
}
|
ctx, x, y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
obj->func->render(obj, output, ctx, surface,x,y);
|
obj->func->render(obj, output, ctx, surface,x,y);
|
||||||
}
|
}
|
||||||
e->engine.func->context_free(output, ctx);
|
e->engine.func->context_free(output, ctx);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Draw all visible objects intersecting an object which are _beneath_ it.
|
* Draw all visible objects intersecting an object which are _beneath_ it.
|
||||||
*/
|
*/
|
||||||
|
@ -2035,7 +2035,7 @@ static void
|
||||||
image_filter_draw_under(Evas *e, Evas_Object *stop, void *output, void *ctx, void *surface, int dx, int dy)
|
image_filter_draw_under(Evas *e, Evas_Object *stop, void *output, void *ctx, void *surface, int dx, int dy)
|
||||||
{
|
{
|
||||||
Evas_Layer *lay;
|
Evas_Layer *lay;
|
||||||
int x,y;
|
int x, y;
|
||||||
|
|
||||||
x = stop->cur.geometry.x - dx;
|
x = stop->cur.geometry.x - dx;
|
||||||
y = stop->cur.geometry.y - dy;
|
y = stop->cur.geometry.y - dy;
|
||||||
|
@ -2048,15 +2048,12 @@ image_filter_draw_under(Evas *e, Evas_Object *stop, void *output, void *ctx, voi
|
||||||
if (obj->delete_me) continue;
|
if (obj->delete_me) continue;
|
||||||
if (obj == stop) return;
|
if (obj == stop) return;
|
||||||
/* FIXME: Do bounding box check */
|
/* FIXME: Do bounding box check */
|
||||||
|
image_filter_draw_under_recurse(e, obj, stop, output, ctx,
|
||||||
image_filter_draw_under_recurse(e, obj, stop, output, ctx, surface,
|
surface, -x, -y);
|
||||||
-x, -y);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e->engine.func->image_dirty_region(output, surface, 0, 0, 300, 300);
|
e->engine.func->image_dirty_region(output, surface, 0, 0, 300, 300);
|
||||||
e->engine.func->output_flush(output);
|
e->engine.func->output_flush(output);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2067,7 +2064,7 @@ image_filter_draw_under(Evas *e, Evas_Object *stop, void *output, void *ctx, voi
|
||||||
Filtered_Image *
|
Filtered_Image *
|
||||||
image_filter_update(Evas *e, Evas_Object *obj, void *src, int imagew, int imageh, int *outw, int *outh)
|
image_filter_update(Evas *e, Evas_Object *obj, void *src, int imagew, int imageh, int *outw, int *outh)
|
||||||
{
|
{
|
||||||
int w,h;
|
int w, h;
|
||||||
void *ctx;
|
void *ctx;
|
||||||
Evas_Filter_Info *info;
|
Evas_Filter_Info *info;
|
||||||
void *surface;
|
void *surface;
|
||||||
|
@ -2100,14 +2097,14 @@ image_filter_update(Evas *e, Evas_Object *obj, void *src, int imagew, int imageh
|
||||||
if (info->mode == EVAS_FILTER_MODE_BELOW)
|
if (info->mode == EVAS_FILTER_MODE_BELOW)
|
||||||
{
|
{
|
||||||
void *subsurface;
|
void *subsurface;
|
||||||
int disw,dish;
|
int disw, dish;
|
||||||
int dx,dy;
|
int dx, dy;
|
||||||
disw = obj->cur.geometry.w;
|
disw = obj->cur.geometry.w;
|
||||||
dish = obj->cur.geometry.h;
|
dish = obj->cur.geometry.h;
|
||||||
dx = (imagew - w) >> 1;
|
dx = (imagew - w) >> 1;
|
||||||
dy = (imageh - h) >> 1;
|
dy = (imageh - h) >> 1;
|
||||||
subsurface = e->engine.func->image_map_surface_new(
|
subsurface = e->engine.func->image_map_surface_new
|
||||||
e->engine.data.output, imagew, imageh, 1);
|
(e->engine.data.output, imagew, imageh, 1);
|
||||||
ctx = e->engine.func->context_new(e->engine.data.output);
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
||||||
e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 255, 0, 255);
|
e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 255, 0, 255);
|
||||||
e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_RENDER_COPY);
|
e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_RENDER_COPY);
|
||||||
|
@ -2115,14 +2112,14 @@ image_filter_update(Evas *e, Evas_Object *obj, void *src, int imagew, int imageh
|
||||||
subsurface, 0, 0, imagew, imageh);
|
subsurface, 0, 0, imagew, imageh);
|
||||||
|
|
||||||
image_filter_draw_under(e, obj, e->engine.data.output, ctx,
|
image_filter_draw_under(e, obj, e->engine.data.output, ctx,
|
||||||
subsurface, dx, dy);
|
subsurface, dx, dy);
|
||||||
|
|
||||||
e->engine.func->context_free(e->engine.data.output, ctx);
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
||||||
|
|
||||||
ctx = e->engine.func->context_new(e->engine.data.output);
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
||||||
|
|
||||||
e->engine.func->image_draw_filtered(e->engine.data.output,
|
e->engine.func->image_draw_filtered(e->engine.data.output,
|
||||||
ctx, surface, subsurface, info);
|
ctx, surface, subsurface, info);
|
||||||
|
|
||||||
e->engine.func->context_free(e->engine.data.output, ctx);
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
||||||
|
|
||||||
|
@ -2133,11 +2130,12 @@ image_filter_update(Evas *e, Evas_Object *obj, void *src, int imagew, int imageh
|
||||||
{
|
{
|
||||||
ctx = e->engine.func->context_new(e->engine.data.output);
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
||||||
e->engine.func->image_draw_filtered(e->engine.data.output,
|
e->engine.func->image_draw_filtered(e->engine.data.output,
|
||||||
ctx, surface, src, info);
|
ctx, surface, src, info);
|
||||||
e->engine.func->context_free(e->engine.data.output, ctx);
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
e->engine.func->image_dirty_region(e->engine.data.output, surface, 0,0,w,h);
|
e->engine.func->image_dirty_region(e->engine.data.output, surface,
|
||||||
|
0, 0, w, h);
|
||||||
if (outw) *outw = w;
|
if (outw) *outw = w;
|
||||||
if (outh) *outh = h;
|
if (outh) *outh = h;
|
||||||
return e->engine.func->image_filtered_save(src, surface,
|
return e->engine.func->image_filtered_save(src, surface,
|
||||||
|
@ -2145,7 +2143,6 @@ image_filter_update(Evas *e, Evas_Object *obj, void *src, int imagew, int imageh
|
||||||
obj->filter->len);
|
obj->filter->len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
evas_object_image_unload(Evas_Object *obj, Eina_Bool dirty)
|
evas_object_image_unload(Evas_Object *obj, Eina_Bool dirty)
|
||||||
{
|
{
|
||||||
|
@ -2466,7 +2463,7 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su
|
||||||
else if (obj->filter->cached)
|
else if (obj->filter->cached)
|
||||||
{
|
{
|
||||||
obj->layer->evas->engine.func->image_filtered_free
|
obj->layer->evas->engine.func->image_filtered_free
|
||||||
(o->engine_data, obj->filter->cached);
|
(o->engine_data, obj->filter->cached);
|
||||||
}
|
}
|
||||||
if (!fi)
|
if (!fi)
|
||||||
fi = image_filter_update(obj->layer->evas, obj, pixels,
|
fi = image_filter_update(obj->layer->evas, obj, pixels,
|
||||||
|
|
Loading…
Reference in New Issue