summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_filter_mixin.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-03-17 11:24:10 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-04-14 11:26:43 +0900
commit1336b2d9e05f2c6fafe109af49ea56739fe77fe3 (patch)
tree8f15b9dbf98664934c3b3076dce2e0b867c816c2 /src/lib/evas/canvas/evas_filter_mixin.c
parente52a04ef8f9bc977f695b084f6312c7537fbc58a (diff)
downloadefl-1336b2d9e05f2c6fafe109af49ea56739fe77fe3.tar.gz
evas filters: Expand snapshot regions by blur radius
When using a snapshot object we have access to exactly all the pixels below it inside the snapshot surface. So, in order to produce a nice blur, it is necessary to expand this snapshot and then clip it otherwise the edges will look a bit ugly. Unfortunately, there are still places where blurs didn't look so good, as objects below an opaque region would never get rendered into the snapshot object. So the edges, inside a snapshot object, around an opaque region would have blur artifacts. This fixes that by shrinking the cutout regions by the radius of the filter. Eg for blur this is the blur radius. The test case in elm_test can exhibit this fix very clearly: a red glow would be visible around the opaque rectangle, but with these changes we instead see the blurry edges of the objects below the rectangle.
Diffstat (limited to 'src/lib/evas/canvas/evas_filter_mixin.c')
-rw-r--r--src/lib/evas/canvas/evas_filter_mixin.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c
index a0d3b3ece6..636451d8d2 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -741,4 +741,22 @@ _evas_filter_obscured_region_set(Evas_Object_Protected_Data *obj,
FCOW_END(fcow, pd);
}
+void
+_evas_filter_radius_get(Evas_Object_Protected_Data *obj, int *l, int *r, int *t, int *b)
+{
+ Evas_Filter_Padding pad = {};
+ Evas_Filter_Data *pd;
+
+ pd = efl_data_scope_get(obj->object, MY_CLASS);
+ if (!pd->data || !pd->data->chain) goto end;
+
+ evas_filter_program_padding_get(pd->data->chain, NULL, &pad);
+
+end:
+ if (l) *l = pad.l;
+ if (r) *r = pad.r;
+ if (t) *t = pad.t;
+ if (b) *b = pad.b;
+}
+
#include "canvas/efl_canvas_filter_internal.eo.c"