[E-devel] Announcing: GL-accelerated blurs!

2017-04-13 Thread Jean-Philippe André
Hello,


Some of you may already know it, but I've recently been working on
accelerating evas filters with GL shaders. In particular I focused on the
blur filter.

I have now merged my work in master (for 1.20) and it is thus possible to
apply blur filters to your enlightenment's window borders.

I'm interested in your feedback, if something doesn't work, if you observe
a memory leak, crash, etc... but also in the overall performance as I could
only test on a limited set of hardware.


Preview video:
https://www.youtube.com/watch?v=ZnJlpPgJivY


Here's a patch for the theme:
https://phab.enlightenment.org/F895504


Best regards,

-- 
Jean-Philippe André
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] master 45/53: evas filters: Prevent redraws when obscure changed

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b5a5f61cd6ea35f47b247542fece63463f21fad1

commit b5a5f61cd6ea35f47b247542fece63463f21fad1
Author: Jean-Philippe Andre 
Date:   Tue Apr 4 10:25:05 2017 +0900

evas filters: Prevent redraws when obscure changed

If the obscured area in a snapshot object changes a lot, do
not try to keep track of it forever. Instead, redraw the filter
over the entire object region, without obscure.

This fixes a performance issue when an opaque window is moved
above a fixed transparent window (the latter has a snapshot with
blur filter).
---
 src/lib/evas/canvas/evas_filter_mixin.c | 32 +++-
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index 1bae8c6..1ac5e1c 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -13,6 +13,12 @@
 
 #define FCOW_BEGIN(_pd) ({ Evas_Object_Filter_Data *_fcow = 
eina_cow_write(evas_object_filter_cow, (const Eina_Cow_Data**)&(_pd->data)); 
_state_check(_fcow); _fcow; })
 #define FCOW_END(_fcow, _pd) eina_cow_done(evas_object_filter_cow, (const 
Eina_Cow_Data**)&(_pd->data), _fcow, EINA_TRUE)
+#define FCOW_WRITE(pd, name, value) do { \
+   if (pd->data->name != (value)) { \
+ fcow = FCOW_BEGIN(pd); \
+ fcow->name = (value); \
+ FCOW_END(fcow, pd); \
+   }} while (0)
 
 typedef struct _Evas_Filter_Data Evas_Filter_Data;
 typedef struct _Evas_Filter_Post_Render_Data Evas_Filter_Post_Render_Data;
@@ -40,6 +46,7 @@ struct _Evas_Object_Filter_Data
   } next;
   double   pos;
} state;
+   int  obscured_changes;
Eina_Boolchanged : 1;
Eina_Boolinvalid : 1; // Code parse failed
Eina_Boolasync : 1;
@@ -844,11 +851,12 @@ Eina_Bool
 _evas_filter_obscured_regions_set(Evas_Object_Protected_Data *obj, const 
Eina_Tiler *tiler)
 {
Evas_Object_Filter_Data *fcow;
-   Eina_Rectangle prev, rect = {}, empty = {};
+   Eina_Rectangle prev, rect = {};
Eina_Rectangle *r;
Evas_Filter_Data *pd;
Eina_Iterator *it;
-   Eina_Bool was_empty;
+   Eina_Bool was_empty, redraw = EINA_FALSE;
+   int obscured_changes = 0;
int area = 0;
 
// TODO: Can we handle more than one opaque region?
@@ -870,15 +878,29 @@ 
_evas_filter_obscured_regions_set(Evas_Object_Protected_Data *obj, const Eina_Ti
eina_iterator_free(it);
 
prev = pd->data->prev_obscured;
-   if (!pd->data->changed && !memcmp(, , sizeof(prev)))
- was_empty = EINA_TRUE;
+   if (!pd->data->changed && (!prev.w || !prev.h))
+ {
+was_empty = EINA_TRUE;
+obscured_changes = 0;
+ }
else if (memcmp(, , sizeof(rect)))
  {
 fcow = FCOW_BEGIN(pd);
 fcow->obscured = rect;
+obscured_changes = fcow->obscured_changes + 1;
+if (obscured_changes > 2)
+  {
+ // Reset obscure as it changes too much
+ memset(>obscured, 0, sizeof(fcow->obscured));
+ obscured_changes = 0;
+ redraw = EINA_TRUE;
+  }
 FCOW_END(fcow, pd);
  }
 
+   FCOW_WRITE(pd, obscured_changes, obscured_changes);
+   if (redraw) return EINA_TRUE;
+
// Snapshot objects need to be redrawn if the padding has increased
if ((pd->data->prev_padding.l < pd->data->padding.l) ||
(pd->data->prev_padding.r < pd->data->padding.r) ||
@@ -887,7 +909,7 @@ 
_evas_filter_obscured_regions_set(Evas_Object_Protected_Data *obj, const Eina_Ti
  return EINA_TRUE;
 
// Snapshot objects need to be redrawn if the obscured region has shrank
-   if (!was_empty && !_evas_eina_rectangle_inside(, >data->obscured))
+   if (!was_empty && !_evas_eina_rectangle_inside(>data->obscured, ))
  return EINA_TRUE;
 
return EINA_FALSE;

-- 




[EGIT] [core/efl] master 47/53: evas filters: Fix artifacts when scaling up & down

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5467d1eb3eb90126c042e105b93d500f7cf8b323

commit 5467d1eb3eb90126c042e105b93d500f7cf8b323
Author: Jean-Philippe Andre 
Date:   Tue Apr 4 18:51:34 2017 +0900

evas filters: Fix artifacts when scaling up & down

An odd-sized image scaled down by 2 was losing 1 pixel during the
downscale, and it was not restored after scaling up. The same
happened with downscaling by 4 except the effect was even more
visible.

This meant that a moving snapshot with a large blur would trigger
some really ugly sampling issues if the content below was precise
(such a text).
---
 src/lib/evas/filters/evas_filter.c |  4 ++-
 .../engines/gl_generic/filters/gl_filter_blend.c   | 40 --
 2 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index c9ce182..2500590 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -725,7 +725,9 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
 
 if (down_x > 1 && down_y > 1)
   {
- tmp = evas_filter_temporary_buffer_get(ctx, ctx->w / down_x, 
ctx->h / down_y,
+ tmp = evas_filter_temporary_buffer_get(ctx,
+ceil(ctx->w / down_x),
+ceil(ctx->h / down_y),
 in->alpha_only, EINA_TRUE);
  if (!tmp) goto fail;
 
diff --git a/src/modules/evas/engines/gl_generic/filters/gl_filter_blend.c 
b/src/modules/evas/engines/gl_generic/filters/gl_filter_blend.c
index ad846ba..5f6c84e 100644
--- a/src/modules/evas/engines/gl_generic/filters/gl_filter_blend.c
+++ b/src/modules/evas/engines/gl_generic/filters/gl_filter_blend.c
@@ -163,6 +163,7 @@ _gl_filter_blend(Render_Engine_GL_Generic *re, 
Evas_Filter_Command *cmd)
Evas_Engine_GL_Context *gc;
Evas_GL_Image *image, *surface;
RGBA_Draw_Context *dc_save;
+   int src_w, src_h, dst_w, dst_h;
 
DEBUG_TIME_BEGIN();
 
@@ -182,12 +183,45 @@ _gl_filter_blend(Render_Engine_GL_Generic *re, 
Evas_Filter_Command *cmd)
evas_common_draw_context_set_multiplier(gc->dc, cmd->draw.R, cmd->draw.G, 
cmd->draw.B, cmd->draw.A);
gc->dc->render_op = _gfx_to_evas_render_op(cmd->draw.rop);
 
-   // FIXME: Maybe need to clear buffer in case of COPY mode?
+   // FIXME: Maybe need to clear buffer in case of COPY mode with an offset?
+
+   if ((cmd->draw.fillmode == EVAS_FILTER_FILL_MODE_STRETCH_XY) &&
+   ((image->w != surface->w) || (image->h != surface->h)))
+ {
+int scale_w, scale_h;
+
+if ((image->w >= surface->w) ||
+(image->h >= surface->h))
+  {
+ scale_w = image->w / surface->w;
+ scale_h = image->h / surface->h;
+ src_w = ((image->w + (scale_w - 1)) / scale_w) * scale_w;
+ src_h = ((image->h + (scale_h - 1)) / scale_h) * scale_h;
+ dst_w = surface->w;
+ dst_h = surface->h;
+  }
+else
+  {
+ scale_w = surface->w / image->w;
+ scale_h = surface->h / image->h;
+ src_w = image->w;
+ src_h = image->h;
+ dst_w = ((surface->w + (scale_w - 1)) / scale_w) * scale_w;
+ dst_h = ((surface->h + (scale_h - 1)) / scale_h) * scale_h;
+  }
+ }
+   else
+ {
+src_w = image->w;
+src_h = image->h;
+dst_w = surface->w;
+dst_h = surface->h;
+ }
 
DBG("blend %d @%p -> %d @%p", cmd->input->id, cmd->input->buffer,
cmd->output->id, cmd->output->buffer);
-   _mapped_blend(gc, image, cmd->draw.fillmode, 0, 0, image->w, image->h,
- cmd->draw.ox, cmd->draw.oy, cmd->output->w, cmd->output->h);
+   _mapped_blend(gc, image, cmd->draw.fillmode, 0, 0, src_w, src_h,
+ cmd->draw.ox, cmd->draw.oy, dst_w, dst_h);
 
evas_common_draw_context_free(gc->dc);
gc->dc = dc_save;

-- 




[EGIT] [core/efl] master 22/53: evas filters: Use obscured region in box blur (SW)

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e52a04ef8f9bc977f695b084f6312c7537fbc58a

commit e52a04ef8f9bc977f695b084f6312c7537fbc58a
Author: Jean-Philippe Andre 
Date:   Wed Mar 15 14:51:51 2017 +0900

evas filters: Use obscured region in box blur (SW)

Box blur is used by the default blur (in 2 or 3 passes) so it
is one of the most important and cpu-consuming filters in the
software engine.
---
 .../filters/blur/blur_box_alpha_.c |  20 ++--
 .../filters/blur/blur_box_alpha_i386.c |  18 ++-
 .../filters/blur/blur_box_alpha_neon.c |  18 ++-
 .../filters/blur/blur_box_alpha_sse3.c |  18 ++-
 .../software_generic/filters/blur/blur_box_rgba_.c |  37 +++---
 .../filters/blur/blur_box_rgba_i386.c  |  18 ++-
 .../filters/blur/blur_box_rgba_neon.c  |  18 ++-
 .../filters/blur/blur_box_rgba_sse3.c  |  18 ++-
 .../software_generic/filters/evas_filter_blur.c| 132 -
 .../filters/evas_filter_transform.c|   4 +-
 10 files changed, 186 insertions(+), 115 deletions(-)

diff --git 
a/src/modules/evas/engines/software_generic/filters/blur/blur_box_alpha_.c 
b/src/modules/evas/engines/software_generic/filters/blur/blur_box_alpha_.c
index ba7ceeb..2f8e300 100644
--- a/src/modules/evas/engines/software_generic/filters/blur/blur_box_alpha_.c
+++ b/src/modules/evas/engines/software_generic/filters/blur/blur_box_alpha_.c
@@ -7,12 +7,14 @@
 #include "evas_filter_private.h"
 
 static inline void
-_box_blur_alpha_horiz_step(const DATA8* restrict const srcdata,
-   DATA8* restrict const dstdata,
+_box_blur_alpha_horiz_step(const uint8_t* restrict srcdata, int src_stride 
EINA_UNUSED,
+   uint8_t* restrict dstdata, int dst_stride 
EINA_UNUSED,
const int* restrict const radii,
-   const int len,
-   const int loops)
+   Eina_Rectangle region)
 {
+   const int len = region.w;
+   const int loops = region.h;
+
const DATA8* restrict src;
DATA8* restrict dst;
DATA8* restrict span1;
@@ -126,16 +128,18 @@ _box_blur_alpha_horiz_step(const DATA8* restrict const 
srcdata,
 // ATTENTION: Make sure the below code's inner loop is the SAME as above.
 
 static inline void
-_box_blur_alpha_vert_step(const DATA8* restrict const srcdata,
-  DATA8* restrict const dstdata,
+_box_blur_alpha_vert_step(const uint8_t* restrict srcdata, int src_stride  
EINA_UNUSED,
+  uint8_t* restrict dstdata, int dst_stride 
EINA_UNUSED,
   const int* restrict const radii,
-  const int len,
-  const int loops)
+  Eina_Rectangle region)
 {
/* Note: This function tries to optimize cache hits by working on
 * contiguous horizontal spans.
 */
 
+   const int len = region.h;
+   const int loops = region.w;
+
const int step = loops;
DATA8* restrict src;
DATA8* restrict dst;
diff --git 
a/src/modules/evas/engines/software_generic/filters/blur/blur_box_alpha_i386.c 
b/src/modules/evas/engines/software_generic/filters/blur/blur_box_alpha_i386.c
index 1664431..194268e 100644
--- 
a/src/modules/evas/engines/software_generic/filters/blur/blur_box_alpha_i386.c
+++ 
b/src/modules/evas/engines/software_generic/filters/blur/blur_box_alpha_i386.c
@@ -1,25 +1,23 @@
 #ifdef BUILD_MMX
 
 static inline void
-_box_blur_alpha_horiz_step_mmx(const DATA8* restrict const srcdata,
-   DATA8* restrict const dstdata,
+_box_blur_alpha_horiz_step_mmx(const uint8_t* restrict src, int src_stride,
+   uint8_t* restrict dst, int dst_stride,
const int* restrict const radii,
-   const int len,
-   const int loops)
+   Eina_Rectangle region)
 {
// TODO: implement optimized code here and remove the following line:
-   _box_blur_alpha_horiz_step(srcdata, dstdata, radii, len, loops);
+   _box_blur_alpha_horiz_step(src, src_stride, dst, dst_stride, radii, region);
 }
 
 static inline void
-_box_blur_alpha_vert_step_mmx(const DATA8* restrict const srcdata,
-  DATA8* restrict const dstdata,
+_box_blur_alpha_vert_step_mmx(const uint8_t* restrict src, int src_stride,
+  uint8_t* restrict dst, int dst_stride,
   const int* restrict const radii,
-  const int len,
-  const int loops)
+  Eina_Rectangle region)
 {
// TODO: implement optimized code here and remove the following line:
-   _box_blur_alpha_vert_step(srcdata, dstdata, radii, len, 

[EGIT] [core/efl] master 18/53: elm_test: Add a test case for evas snapshot

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=096af26dd6e2101043bed0e3a9d570b1a0c3c18d

commit 096af26dd6e2101043bed0e3a9d570b1a0c3c18d
Author: Jean-Philippe Andre 
Date:   Fri Feb 10 15:26:53 2017 +0900

elm_test: Add a test case for evas snapshot

This showcases the object (not a widget) and will be the basis
for a necessary optimization patch.
---
 src/Makefile_Elementary.am  |   1 +
 src/bin/elementary/test.c   |   2 +
 src/bin/elementary/test_evas_snapshot.c | 136 
 3 files changed, 139 insertions(+)

diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 0f6973c..f7f0016 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -763,6 +763,7 @@ bin/elementary/test_entry_anchor.c \
 bin/elementary/test_entry_anchor2.c \
 bin/elementary/test_events.c \
 bin/elementary/test_evas_mask.c \
+bin/elementary/test_evas_snapshot.c \
 bin/elementary/test_external.c \
 bin/elementary/test_fileselector_button.c \
 bin/elementary/test_fileselector.c \
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index eaac07b..be0797d 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -307,6 +307,7 @@ void test_efl_ui_text(void *data, Evas_Object *obj, void 
*event_info);
 void test_efl_ui_text_label(void *data, Evas_Object *obj, void *event_info);
 void test_evas_mask(void *data, Edje_Object *obj, void *event_info);
 void test_gfx_filters(void *data, Evas_Object *obj, void *event_info);
+void test_evas_snapshot(void *data, Evas_Object *obj, void *event_info);
 
 Evas_Object *win, *tbx; // TODO: refactoring
 void *tt;
@@ -1022,6 +1023,7 @@ add_tests:
//--//
ADD_TEST(NULL, "Evas", "Masking", test_evas_mask);
ADD_TEST(NULL, "Evas", "Gfx Filters", test_gfx_filters);
+   ADD_TEST(NULL, "Evas", "Snapshot", test_evas_snapshot);
 
//--//
ADD_TEST(NULL, "Widgets Disable/Enable", "Box", test_box_disable);
diff --git a/src/bin/elementary/test_evas_snapshot.c 
b/src/bin/elementary/test_evas_snapshot.c
new file mode 100644
index 000..8389b61
--- /dev/null
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -0,0 +1,136 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include 
+
+#define GRID_SIZE 10
+
+static const char *images[] = { "plant_01.jpg", "rock_01.jpg",
+"rock_02.jpg", "sky_01.jpg", "sky_04.jpg",
+"wood_01.jpg", "fire.gif" };
+
+static const int rnd[] = {
+   3, 86, 81, 36, 38, 8, 65, 53, 93, 40, 71, 74, 90, 95, 88, 4, 96, 73, 14, 52,
+   83, 77, 51, 13, 79, 15, 59, 99, 100, 31, 27, 24, 97, 34, 28, 58, 84, 92, 18,
+   50, 22, 62, 12, 7, 17, 56, 2, 47, 75, 85, 42, 89, 80, 57, 44, 49, 5, 45, 54,
+   68, 76, 70, 11, 69, 64, 30, 55, 29, 39, 60, 82, 63, 94, 43, 19, 26, 35, 21,
+   67, 91, 46, 72, 33, 87, 10, 9, 41, 66, 37, 32, 78, 20, 23, 48, 6, 1, 25, 16,
+   61, 98,
+};
+
+static const char *filter =
+  "padding_set {0}"
+  "fill { color = '#0123' }"
+  "blur { 5 }"
+  "print ('Evaluating filter: ' .. input.width .. 'x' .. input.height)"
+  ;
+
+static inline Eo *
+_image_create(Eo *win, const char *path)
+{
+   return efl_add(EFL_UI_IMAGE_CLASS, win,
+  efl_file_set(efl_added, path, NULL),
+  efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
+  efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0),
+  efl_gfx_size_hint_min_set(efl_added, 20, 20),
+  efl_gfx_visible_set(efl_added, 1));
+}
+
+static void
+_anim_toggle(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+   Eina_Iterator *it;
+   Eo *win = data;
+   Eo *grid, *o;
+
+   grid = efl_key_wref_get(win, "grid");
+   it = efl_content_iterate(grid);
+   EINA_ITERATOR_FOREACH(it, o)
+ {
+if (efl_player_playable_get(o))
+  efl_player_play_set(o, !efl_player_play_get(o));
+ }
+   eina_iterator_free(it);
+}
+
+static void
+_close(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+   Eo *win = data;
+
+   efl_del(win);
+}
+
+void
+test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_UNUSED)
+{
+   Eo *win, *grid, *o, *snap;
+   const char *path;
+
+   win = efl_add(EFL_UI_WIN_STANDARD_CLASS, NULL,
+ efl_text_set(efl_added, "Evas Snapshot"),
+ efl_ui_win_autodel_set(efl_added, 1));
+
+   grid = efl_add(EFL_UI_GRID_CLASS, win,
+  efl_pack_padding_set(efl_added, 5, 5, 1),
+  efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
+  efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0));
+   efl_content_set(win, grid);
+
+   // Objects below the snapshot
+   for (int c = 0; c < GRID_SIZE; c++)
+ for (int r = 0; r < GRID_SIZE; r++)
+   {
+  int id = rnd[((r * 

[EGIT] [core/efl] master 32/53: evas filters: Reduce one log level

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7407a0d073a57e66f6ab68069780026b56bf7b39

commit 7407a0d073a57e66f6ab68069780026b56bf7b39
Author: Jean-Philippe Andre 
Date:   Wed Mar 22 19:21:24 2017 +0900

evas filters: Reduce one log level
---
 src/modules/evas/engines/software_generic/filters/evas_filter_bump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/src/modules/evas/engines/software_generic/filters/evas_filter_bump.c 
b/src/modules/evas/engines/software_generic/filters/evas_filter_bump.c
index 0e4a800..769ed41 100644
--- a/src/modules/evas/engines/software_generic/filters/evas_filter_bump.c
+++ b/src/modules/evas/engines/software_generic/filters/evas_filter_bump.c
@@ -137,7 +137,7 @@ _bump_map_cpu_alpha_alpha(Evas_Filter_Command *cmd)
lxy = sin(fabs(zangle * M_PI / 180.));
lx = (int) (40.f * (lxy + 1.0) * cos(xyangle * M_PI / 180.));
ly = (int) (40.f * (lxy + 1.0) * sin(xyangle * M_PI / 180.));
-   INF("Using light vector (%d,%d)", lx, ly);
+   XDBG("Using light vector (%d,%d)", lx, ly);
 
// Generate light table
phong = malloc(256 * 256 * sizeof(*phong));

-- 




[EGIT] [core/efl] master 09/53: evas: Rename software filter function type

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=190d84e84ba571d964ee826032c3ef93c42bef0d

commit 190d84e84ba571d964ee826032c3ef93c42bef0d
Author: Jean-Philippe Andre 
Date:   Tue Jan 17 22:15:09 2017 +0900

evas: Rename software filter function type

From Evas_Filter_Apply_Func to Software_Filter_Func.
Also fix include dir for out-of-tree builds of non-static sw generic.
---
 src/Makefile_Evas.am|  1 +
 src/lib/evas/filters/evas_filter.c  |  1 -
 src/lib/evas/include/evas_filter.h  |  1 -
 src/modules/evas/engines/software_generic/evas_engine.c |  6 +++---
 .../software_generic/filters/evas_engine_filter.h   | 17 +
 .../software_generic/filters/evas_filter_blend.c|  2 +-
 .../engines/software_generic/filters/evas_filter_blur.c |  4 ++--
 .../engines/software_generic/filters/evas_filter_bump.c |  2 +-
 .../software_generic/filters/evas_filter_curve.c|  2 +-
 .../software_generic/filters/evas_filter_displace.c |  2 +-
 .../engines/software_generic/filters/evas_filter_fill.c |  2 +-
 .../engines/software_generic/filters/evas_filter_mask.c |  2 +-
 .../software_generic/filters/evas_filter_transform.c|  2 +-
 13 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index d6dcd9c..7bea8c3 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -672,6 +672,7 @@ modules_evas_engines_software_generic_module_la_CPPFLAGS = 
-I$(top_builddir)/src
 -I$(top_srcdir)/src/lib/evas/include \
 -I$(top_srcdir)/src/lib/evas/cserve2 \
 -I$(top_srcdir)/src/lib/evas/filters \
+-I$(top_builddir)/src/lib/evas/canvas \
 -I$(top_builddir)/src/modules/evas/engines/software_generic \
 @EVAS_CFLAGS@
 modules_evas_engines_software_generic_module_la_LIBADD = @USE_EVAS_LIBS@
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index b8b993e..d00aa44 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -1495,7 +1495,6 @@ static Eina_Bool
 _filter_command_run(Evas_Filter_Command *cmd)
 {
Evas_Filter_Support support = EVAS_FILTER_SUPPORT_NONE;
-   Evas_Filter_Apply_Func func = NULL;
 
EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->output, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, EINA_FALSE);
diff --git a/src/lib/evas/include/evas_filter.h 
b/src/lib/evas/include/evas_filter.h
index 0c87af2..cfea9bd 100644
--- a/src/lib/evas/include/evas_filter.h
+++ b/src/lib/evas/include/evas_filter.h
@@ -44,7 +44,6 @@ typedef enum _Evas_Filter_Bump_Flags Evas_Filter_Bump_Flags;
 typedef enum _Evas_Filter_Fill_Mode Evas_Filter_Fill_Mode;
 typedef enum _Evas_Filter_Transform_Flags Evas_Filter_Transform_Flags;
 
-typedef Eina_Bool (* Evas_Filter_Apply_Func) (Evas_Filter_Command *cmd);
 typedef void (* Evas_Filter_Cb) (Evas_Filter_Context *ctx, void *data, 
Eina_Bool success);
 
 #define EVAS_FILTER_BUFFER_RGBA  EINA_FALSE
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c 
b/src/modules/evas/engines/software_generic/evas_engine.c
index 84c8937..4ccec9b 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -4620,10 +4620,10 @@ eng_ector_end(void *data EINA_UNUSED, void *context 
EINA_UNUSED, Ector_Surface *
 
 ////
 
-static Evas_Filter_Apply_Func
+static Software_Filter_Func
 _gfx_filter_func_get(Evas_Filter_Command *cmd)
 {
-   Evas_Filter_Apply_Func func = NULL;
+   Software_Filter_Func func = NULL;
 
switch (cmd->mode)
  {
@@ -4653,7 +4653,7 @@ eng_gfx_filter_supports(void *data EINA_UNUSED, 
Evas_Filter_Command *cmd)
 static Eina_Bool
 eng_gfx_filter_process(void *data EINA_UNUSED, Evas_Filter_Command *cmd)
 {
-   Evas_Filter_Apply_Func func;
+   Software_Filter_Func func;
 
func = _gfx_filter_func_get(cmd);
EINA_SAFETY_ON_NULL_RETURN_VAL(func, EINA_FALSE);
diff --git 
a/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h 
b/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
index 9d67574..f8bfebd 100644
--- a/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
+++ b/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
@@ -4,13 +4,14 @@
 #include "evas_filter_private.h"
 #include "draw.h"
 
-Evas_Filter_Apply_Func eng_filter_blend_func_get(Evas_Filter_Command *cmd);
-Evas_Filter_Apply_Func eng_filter_blur_func_get(Evas_Filter_Command *cmd);
-Evas_Filter_Apply_Func eng_filter_bump_func_get(Evas_Filter_Command *cmd);
-Evas_Filter_Apply_Func eng_filter_curve_func_get(Evas_Filter_Command *cmd);
-Evas_Filter_Apply_Func eng_filter_displace_func_get(Evas_Filter_Command *cmd);
-Evas_Filter_Apply_Func eng_filter_fill_func_get(Evas_Filter_Command *cmd);
-Evas_Filter_Apply_Func 

[EGIT] [core/efl] master 39/53: evas gl: Make sure a deleted image can't be the target

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e7eb97f3b076e4d51752d3bdb1e68528d5140872

commit e7eb97f3b076e4d51752d3bdb1e68528d5140872
Author: Jean-Philippe Andre 
Date:   Thu Mar 30 10:26:24 2017 +0900

evas gl: Make sure a deleted image can't be the target

If we delete the image that was the target surface for gl
rendering, a crash would occur on the next render cycle.
Unlikely but not impossible to trigger from app side.

@fix
---
 src/modules/evas/engines/gl_common/evas_gl_image.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c 
b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 4a89ff6..d1feacf 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -769,6 +769,9 @@ evas_gl_common_image_free(Evas_GL_Image *im)
im->references--;
if (im->references > 0) return;
 
+   if (im->gc && (im->gc->pipe[0].shader.surface == im))
+ evas_gl_common_context_target_surface_set(im->gc, im->gc->def_surface);
+
if (im->fglyph)
  {
 im->gc->font_glyph_images = 
eina_list_remove(im->gc->font_glyph_images, im);

-- 




[EGIT] [core/efl] master 36/53: evas filters: Force redraw of snapshot if cutout shrank

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=530399acdea9406f5eaaf32463f3c90ca62b7905

commit 530399acdea9406f5eaaf32463f3c90ca62b7905
Author: Jean-Philippe Andre 
Date:   Thu Mar 23 15:55:41 2017 +0900

evas filters: Force redraw of snapshot if cutout shrank

The situation is clearly visible in the Snapshot test case:
increase the radius and a red glow would appear. This is because
the snapshot object was not marked as needing redraw and so had
no pixels under the opaque rectangle.
---
 src/lib/evas/canvas/evas_filter_mixin.c | 70 ++---
 src/lib/evas/canvas/evas_render.c   | 51 +---
 src/lib/evas/include/evas_inline.x  | 12 ++
 src/lib/evas/include/evas_private.h |  2 +-
 4 files changed, 79 insertions(+), 56 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index f3ed146..1a74cd8 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -27,6 +27,7 @@ struct _Evas_Object_Filter_Data
Eina_Hash   *sources; // Evas_Filter_Proxy_Binding
Eina_Inlist *data; // Evas_Filter_Data_Binding
Eina_Rectangle   prev_obscured, obscured;
+   Evas_Filter_Padding  prev_padding, padding;
void*output;
struct {
   struct {
@@ -283,36 +284,31 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 if (!pd->data->chain)
   {
  Evas_Filter_Program *pgm;
+ Eina_Bool invalid;
 
  pgm = evas_filter_program_new(pd->data->name, alpha);
  evas_filter_program_source_set_all(pgm, pd->data->sources);
  evas_filter_program_data_set_all(pgm, pd->data->data);
  _evas_filter_state_set_internal(pgm, pd);
- if (!evas_filter_program_parse(pgm, pd->data->code))
+ invalid = !evas_filter_program_parse(pgm, pd->data->code);
+ if (invalid)
{
   ERR("Filter program parsing failed");
   evas_filter_program_del(pgm);
-
-  if (!pd->data->invalid)
-{
-   fcow = FCOW_BEGIN(pd);
-   fcow->invalid = EINA_TRUE;
-   FCOW_END(fcow, pd);
-}
-
-  return EINA_FALSE;
+  pgm = NULL;
}
  fcow = FCOW_BEGIN(pd);
+ if (!invalid) evas_filter_program_padding_get(pgm, NULL, 
>padding);
  fcow->chain = pgm;
- fcow->invalid = EINA_FALSE;
+ fcow->invalid = invalid;
  FCOW_END(fcow, pd);
+ if (invalid) return EINA_FALSE;
   }
 else if (previous && !pd->data->changed)
   {
- Eina_Bool redraw;
+ Eina_Bool redraw = EINA_TRUE;
 
- redraw = _evas_filter_state_set_internal(pd->data->chain, pd);
- if (redraw)
+ if (_evas_filter_state_set_internal(pd->data->chain, pd))
DBG("Filter redraw by state change!");
  else if (obj->changed)
DBG("Filter redraw by object content change!");
@@ -441,6 +437,8 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 fcow->changed = EINA_FALSE;
 fcow->async = do_async;
 fcow->prev_obscured = fcow->obscured;
+fcow->prev_padding = fcow->padding;
+fcow->padding = pad;
 fcow->invalid = EINA_FALSE;
 FCOW_END(fcow, pd);
 
@@ -470,6 +468,7 @@ 
_efl_canvas_filter_internal_efl_gfx_filter_filter_program_set(Eo *eo_obj, Evas_F
Evas_Object_Protected_Data *obj;
Evas_Filter_Program *pgm = NULL;
Evas_Object_Filter_Data *fcow;
+   Eina_Bool invalid = pd->data->invalid;
Eina_Bool alpha;
 
obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -494,16 +493,21 @@ 
_efl_canvas_filter_internal_efl_gfx_filter_filter_program_set(Eo *eo_obj, Evas_F
evas_filter_program_source_set_all(pgm, fcow->sources);
evas_filter_program_data_set_all(pgm, fcow->data);
_evas_filter_state_set_internal(pgm, pd);
-   if (!evas_filter_program_parse(pgm, code))
+   invalid = !evas_filter_program_parse(pgm, code);
+   if (invalid)
  {
 ERR("Parsing failed!");
 evas_filter_program_del(pgm);
 pgm = NULL;
  }
+   else
+ {
+evas_filter_program_padding_get(pgm, NULL, >padding);
+ }
 }
   fcow->chain = pgm;
   fcow->changed = EINA_TRUE;
-  fcow->invalid = (pgm == NULL);
+  fcow->invalid = invalid;
   eina_stringshare_replace(>code, code);
}
FCOW_END(fcow, pd);
@@ -526,6 +530,7 @@ 

[EGIT] [core/efl] master 25/53: elm_test: Add slider to control blur radius

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=513d6866286194cd1e411ca44d8faecf4b48f369

commit 513d6866286194cd1e411ca44d8faecf4b48f369
Author: Jean-Philippe Andre 
Date:   Mon Mar 20 19:57:56 2017 +0900

elm_test: Add slider to control blur radius
---
 src/bin/elementary/test_evas_snapshot.c | 30 +++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/src/bin/elementary/test_evas_snapshot.c 
b/src/bin/elementary/test_evas_snapshot.c
index d2e8786..94d6e16 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -21,7 +21,7 @@ static const int rnd[] = {
 static const char *filter =
   "padding_set {0}"
   "fill { color = 'red' }"
-  "blur { 5 }"
+  "blur { radius }"
   "print ('Evaluating filter: ' .. input.width .. 'x' .. input.height)"
   ;
 
@@ -54,6 +54,18 @@ _anim_toggle(void *data, const Efl_Event *ev EINA_UNUSED)
 }
 
 static void
+_radius_set(void *data, const Efl_Event *ev)
+{
+   char buf[128];
+   Eo *win = data;
+   Eo *snap;
+
+   snap = efl_key_wref_get(win, "snap");
+   sprintf(buf, "tonumber(%d)", (int) elm_slider_value_get(ev->object));
+   efl_gfx_filter_data_set(snap, "radius", buf, EINA_TRUE);
+}
+
+static void
 _close(void *data, const Efl_Event *ev EINA_UNUSED)
 {
Eo *win = data;
@@ -93,6 +105,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *e
// Snapshot
snap = efl_add(EFL_CANVAS_SNAPSHOT_CLASS, win,
   efl_gfx_filter_program_set(efl_added, filter, "filter"),
+  efl_gfx_filter_data_set(efl_added, "radius", "tonumber(5)", 
EINA_TRUE),
   efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
   efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0),
   efl_pack_grid(grid, efl_added, 1, 1, GRID_SIZE - 2, 
GRID_SIZE - 2),
@@ -118,11 +131,22 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object 
*obj EINA_UNUSED, void *e
efl_pack_grid(grid, o, 0, 0, GRID_SIZE, GRID_SIZE);
 
// Controls
+   efl_add(ELM_SLIDER_CLASS, win,
+   elm_object_text_set(efl_added, "Blur radius: "),
+   elm_slider_min_max_set(efl_added, 0, 64),
+   elm_slider_value_set(efl_added, 5),
+   elm_slider_unit_format_set(efl_added, "%.0f px"),
+   efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
+   efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
+   efl_pack_grid(grid, efl_added, 0, GRID_SIZE, GRID_SIZE, 1),
+   efl_event_callback_add(efl_added, ELM_SLIDER_EVENT_CHANGED, 
_radius_set, win),
+   efl_gfx_visible_set(efl_added, 1));
+
efl_add(ELM_BUTTON_CLASS, win,
efl_text_set(efl_added, "Toggle animation"),
efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
-   efl_pack_grid(grid, efl_added, 0, GRID_SIZE, (GRID_SIZE + 1) / 2, 
1),
+   efl_pack_grid(grid, efl_added, 0, GRID_SIZE + 1, (GRID_SIZE + 1) / 
2, 1),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, 
_anim_toggle, win),
efl_gfx_visible_set(efl_added, 1));
 
@@ -130,7 +154,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *e
efl_text_set(efl_added, "Close"),
efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
-   efl_pack_grid(grid, efl_added, (GRID_SIZE + 1) / 2, GRID_SIZE, 
(GRID_SIZE + 1) / 2, 1),
+   efl_pack_grid(grid, efl_added, (GRID_SIZE + 1) / 2, GRID_SIZE + 1, 
(GRID_SIZE + 1) / 2, 1),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _close, 
win),
efl_gfx_visible_set(efl_added, 1));
 

-- 




[EGIT] [core/efl] master 44/53: evas filters: Enable down scaling with GL blur

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fc92a1c0f6380021dfb8d0199b44252463d536db

commit fc92a1c0f6380021dfb8d0199b44252463d536db
Author: Jean-Philippe Andre 
Date:   Mon Apr 3 21:24:07 2017 +0900

evas filters: Enable down scaling with GL blur

This dramatically improves the performance and now seems
to give acceptable results. Eventually we need a quality flag
in order to enable this or not. Alternatively, "gaussian" blur
mode would skip this optimization, while "default" would trigger
it.
---
 src/lib/evas/filters/evas_filter.c | 41 --
 .../engines/gl_generic/filters/gl_filter_blur.c| 22 +++-
 2 files changed, 43 insertions(+), 20 deletions(-)

diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 270c79f..e5391f2 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -711,35 +711,38 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
dx_in = in;
dy_out = out;
 
-#if 0
+#if 1
if (type == EVAS_FILTER_BLUR_DEFAULT)
  {
 int down_x = 1, down_y = 1;
 
 /* For now, disable scaling - testing perfect gaussian blur until it's
  * ready: */
-down_x = MAX((1 << evas_filter_smallest_pow2_larger_than(dx / 2) / 2), 
1);
-down_y = MAX((1 << evas_filter_smallest_pow2_larger_than(dy / 2) / 2), 
1);
+down_x = 1 << evas_filter_smallest_pow2_larger_than(dx / 2) / 2;
+down_y = 1 << evas_filter_smallest_pow2_larger_than(dy / 2) / 2;
+if (down_x > 4) down_x = 4;
+if (down_y > 4) down_y = 4;
 
+if (down_x > 1 && down_y > 1)
+  {
+ tmp = evas_filter_temporary_buffer_get(ctx, ctx->w / down_x, 
ctx->h / down_y,
+in->alpha_only, EINA_TRUE);
+ if (!tmp) goto fail;
 
-tmp = evas_filter_temporary_buffer_get(ctx, ctx->w / down_x, ctx->h / 
down_y,
-   in->alpha_only, EINA_TRUE);
-if (!tmp) goto fail;
+ dx = rx / down_x;
+ dy = ry / down_y;
 
-// FIXME: Fix logic here. This is where the smarts are! Now it's dumb.
-dx = rx / down_x;
-dy = ry / down_y;
+ XDBG("Add GL downscale %d (%dx%d) -> %d (%dx%d)", in->id, in->w, 
in->h, tmp->id, tmp->w, tmp->h);
+ cmd = _command_new(ctx, EVAS_FILTER_MODE_BLEND, in, NULL, tmp);
+ if (!cmd) goto fail;
+ cmd->draw.fillmode = EVAS_FILTER_FILL_MODE_STRETCH_XY;
+ dx_in = tmp;
 
-XDBG("Add GL downscale %d (%dx%d) -> %d (%dx%d)", in->id, in->w, 
in->h, tmp->id, tmp->w, tmp->h);
-cmd = _command_new(ctx, EVAS_FILTER_MODE_BLEND, in, NULL, tmp);
-if (!cmd) goto fail;
-cmd->draw.fillmode = EVAS_FILTER_FILL_MODE_STRETCH_XY;
-dx_in = tmp;
-
-tmp = evas_filter_temporary_buffer_get(ctx, ctx->w / down_x, ctx->h / 
down_y,
-   in->alpha_only, EINA_TRUE);
-if (!tmp) goto fail;
-dy_out = tmp;
+ tmp = evas_filter_temporary_buffer_get(ctx, ctx->w / down_x, 
ctx->h / down_y,
+in->alpha_only, EINA_TRUE);
+ if (!tmp) goto fail;
+ dy_out = tmp;
+  }
  }
 #endif
 
diff --git a/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c 
b/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c
index 8c78f8c..98faa3a 100644
--- a/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c
+++ b/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c
@@ -111,6 +111,21 @@ _rect(int x, int y, int w, int h, int maxw, int maxh)
 #define S_RECT(_x, _y, _w, _h) _rect(_x, _y, _w, _h, s_w, s_h)
 #define D_RECT(_x, _y, _w, _h) _rect(_x, _y, _w, _h, d_w, d_h)
 
+static inline void
+_output_scale_get(Evas_Filter_Context *ctx, Evas_Filter_Command *cmd,
+  double *scale_x, double *scale_y)
+{
+   Evas_Filter_Buffer *fb;
+   Eina_List *li;
+
+   EINA_LIST_FOREACH(ctx->buffers, li, fb)
+ if (fb->id == EVAS_FILTER_BUFFER_OUTPUT_ID)
+   {
+  *scale_x = (double) cmd->output->w / (double) fb->w;
+  *scale_y = (double) cmd->output->h / (double) fb->h;
+   }
+}
+
 static Eina_Bool
 _gl_filter_blur(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd)
 {
@@ -119,7 +134,7 @@ _gl_filter_blur(Render_Engine_GL_Generic *re, 
Evas_Filter_Command *cmd)
RGBA_Draw_Context *dc_save;
Eina_Bool horiz;
double sx, sy, sw, sh, ssx, ssy, ssw, ssh, dx, dy, dw, dh, radius;
-   double s_w, s_h, d_w, d_h;
+   double s_w, s_h, d_w, d_h, scale_x, scale_y;
Eina_Rectangle s_ob, d_ob, s_region[4], d_region[4];
int nx, ny, nw, nh, regions, count = 0;
double *weights, *offsets;
@@ -171,7 +186,12 @@ 

[EGIT] [core/efl] master 29/53: evas filters: Optimize GL blur with interpolation

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ebeead46817bd79caed668d9b5456f7fc1079d17

commit ebeead46817bd79caed668d9b5456f7fc1079d17
Author: Jean-Philippe Andre 
Date:   Tue Mar 21 19:06:05 2017 +0900

evas filters: Optimize GL blur with interpolation

This optimizes the GL blur algorithm by reducing the number of
texel fetches (roughly half the number of before this patch). This
works by exploiting GL's interpolation capabilities.
---
 .../evas/engines/gl_common/evas_gl_common.h|  2 +-
 .../evas/engines/gl_common/evas_gl_context.c   | 45 ++
 .../engines/gl_common/shader/evas_gl_shaders.x | 49 +++-
 .../evas/engines/gl_common/shader/fragment.glsl| 53 --
 .../engines/gl_generic/filters/gl_filter_blur.c| 52 +++--
 5 files changed, 120 insertions(+), 81 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h 
b/src/modules/evas/engines/gl_common/evas_gl_common.h
index 3dcc558..4ff249a 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -652,7 +652,7 @@ void  
evas_gl_common_filter_displace_push(Evas_Engine_GL_Context *gc
 void  evas_gl_common_filter_curve_push(Evas_Engine_GL_Context *gc, 
Evas_GL_Texture *tex,
int x, int y, int w, int h, 
const uint8_t *points, int channel);
 void  evas_gl_common_filter_blur_push(Evas_Engine_GL_Context *gc, 
Evas_GL_Texture *tex, double sx, double sy, double sw, double sh,
-  double dx, double dy, double 
dw, double dh, GLfloat *values, GLfloat *offsets, int count,
+  double dx, double dy, double 
dw, double dh, const double * const values, const double * const offsets, int 
count,
   Eina_Bool horiz);
 
 int   evas_gl_common_shader_program_init(Evas_GL_Shared *shared);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c 
b/src/modules/evas/engines/gl_common/evas_gl_context.c
index c19492d..72e65a6 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -3432,7 +3432,8 @@ evas_gl_common_filter_blur_push(Evas_Engine_GL_Context 
*gc,
 Evas_GL_Texture *tex,
 double sx, double sy, double sw, double sh,
 double dx, double dy, double dw, double dh,
-GLfloat *values, GLfloat *offsets, int count,
+const double * const weights,
+const double * const offsets, int count,
 Eina_Bool horiz)
 {
double ox1, oy1, ox2, oy2, ox3, oy3, ox4, oy4, pw, ph;
@@ -3444,6 +3445,7 @@ evas_gl_common_filter_blur_push(Evas_Engine_GL_Context 
*gc,
Eina_Bool blend = EINA_TRUE;
Eina_Bool smooth = EINA_TRUE;
Shader_Type type = horiz ? SHD_FILTER_BLUR_X : SHD_FILTER_BLUR_Y;
+   GLuint *map_tex_data;
GLuint map_tex;
double sum;
 
@@ -3492,21 +3494,44 @@ evas_gl_common_filter_blur_push(Evas_Engine_GL_Context 
*gc,
pipe_region_expand(gc, pn, dx, dy, dw, dh);
PIPE_GROW(gc, pn, 6);
 
-   sum = values[0];
-   for (int k = 1; k < count; k++)
- sum += 2.0 * values[k];
+   /* Convert double data to RGBA pixel data.
+*
+* We are not using GL_FLOAT or GL_DOUBLE because:
+* - It's not as portable (needs extensions),
+* - GL_DOUBLE didn't work during my tests (dunno why),
+* - GL_FLOAT didn't seem to carry the proper precision all the way to
+*   the fragment shader,
+* - Real data buffers are not available in GLES 2.0,
+* - GL_RGBA is 100% portable.
+*/
+   map_tex_data = alloca(2 * count * sizeof(*map_tex_data));
+   for (int k = 0; k < count; k++)
+ {
+GLuint val;
+
+if (k == 0) sum = weights[k];
+else sum += 2.0 * weights[k];
+
+// Weight is always > 0.0 and < 255.0 by maths
+val = (GLuint) (weights[k] * 256.0 * 256.0 * 256.0);
+map_tex_data[k] = val;
+
+// Offset is always in [0.0 , 1.0] by definition
+val = (GLuint) (offsets[k] * 256.0 * 256.0 * 256.0);
+map_tex_data[k + count] = val;
+ }
 
-   // Synchronous upload of Nx1 RGBA texture (FIXME: no reuse)
+   // Synchronous upload of Nx2 RGBA texture (FIXME: no reuse)
glGenTextures(1, _tex);
glBindTexture(GL_TEXTURE_2D, map_tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, 

[EGIT] [core/efl] master 19/53: evas: Optimize redraws of snapshot objects

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a6951397f619d5f5c2491ec75f26b2facae476ff

commit a6951397f619d5f5c2491ec75f26b2facae476ff
Author: Jean-Philippe Andre 
Date:   Fri Feb 10 16:08:58 2017 +0900

evas: Optimize redraws of snapshot objects

If anything in the canvas needs redraw and a snapshot object
happens to intersect with the update region then it was redrawn,
even if all objects below it hadn't changed. This has an insane
performance impact when you apply a blur filter on the snapshot
object. Walking the object list will always be cheaper than
rendering the snapshot!

Note: Added a FIXME comment and forced clean_them to be true
because some odd behaviour happens when breaking with GDB and
the array snapshot_objects keeps growing at each frame (I guess
only if we miss a frame or something like that).
---
 src/lib/evas/canvas/evas_object_image.c | 11 +++---
 src/lib/evas/canvas/evas_render.c   | 39 +
 src/lib/evas/include/evas_private.h |  2 +-
 3 files changed, 44 insertions(+), 8 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_image.c 
b/src/lib/evas/canvas/evas_object_image.c
index 641e8a4..a3f7e48 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -3567,9 +3567,9 @@ _evas_object_image_video_overlay_do(Evas_Object *eo_obj)
 }
 
 void *
-_evas_object_image_surface_get(Evas_Object *eo, Evas_Object_Protected_Data 
*obj)
+_evas_object_image_surface_get(Evas_Object_Protected_Data *obj, Eina_Bool 
create)
 {
-   Evas_Image_Data *pd = efl_data_scope_get(eo, MY_CLASS);
+   Evas_Image_Data *pd = obj->private_data;
 
if (pd->engine_data &&
(pd->cur->image.w == obj->cur->geometry.w) &&
@@ -3577,7 +3577,12 @@ _evas_object_image_surface_get(Evas_Object *eo, 
Evas_Object_Protected_Data *obj)
  return pd->engine_data;
 
if (pd->engine_data)
- ENFN->image_free(ENDT, pd->engine_data);
+ {
+ENFN->image_free(ENDT, pd->engine_data);
+pd->engine_data = NULL;
+ }
+
+   if (!create) return pd->engine_data;
 
// FIXME: alpha forced to 1 for now, need to figure out Evas alpha here
EINA_COW_IMAGE_STATE_WRITE_BEGIN(pd, state_write)
diff --git a/src/lib/evas/canvas/evas_render.c 
b/src/lib/evas/canvas/evas_render.c
index 5de9847..a13c693 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -2738,6 +2738,31 @@ _is_obj_in_rect(Evas_Object *eo_obj, 
Evas_Object_Protected_Data *obj,
 #endif
 
 static Eina_Bool
+_snapshot_needs_redraw(Evas_Public_Data *evas, Evas_Object_Protected_Data 
*snap)
+{
+   const int x = snap->cur->geometry.x;
+   const int y = snap->cur->geometry.y;
+   const int w = snap->cur->geometry.w;
+   const int h = snap->cur->geometry.h;
+   Evas_Object_Protected_Data *obj;
+   Evas_Active_Entry *ent;
+   void *surface;
+
+   surface = _evas_object_image_surface_get(snap, EINA_FALSE);
+   if (!surface) return EINA_TRUE;
+
+   EINA_INARRAY_FOREACH(>active_objects, ent)
+ {
+obj = ent->obj;
+if (obj == snap) break;
+if (!obj->is_smart && obj->changed &&
+evas_object_is_in_output_rect(obj->object, obj, x, y, w, h))
+  return EINA_TRUE;
+ }
+   return EINA_FALSE;
+}
+
+static Eina_Bool
 evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *evas,
   void *surface, void *context,
   Evas_Object_Protected_Data *top,
@@ -3089,7 +3114,7 @@ evas_render_updates_internal(Evas *eo_e,
  {
 for (i = 0; i < e->snapshot_objects.count; i++)
   {
- obj = (Evas_Object_Protected_Data 
*)eina_array_data_get(>snapshot_objects, i);
+ obj = eina_array_data_get(>snapshot_objects, i);
 
  if (evas_object_is_visible(obj->object, obj))
ENFN->output_redraws_rect_add(ENDT,
@@ -3173,7 +3198,7 @@ evas_render_updates_internal(Evas *eo_e,
{
   Eina_Rectangle output, cr, ur;
 
-  obj = (Evas_Object_Protected_Data 
*)eina_array_data_get(>snapshot_objects, j);
+  obj = eina_array_data_get(>snapshot_objects, j);
 
   EINA_RECTANGLE_SET(,
  obj->cur->geometry.x,
@@ -3182,7 +3207,8 @@ evas_render_updates_internal(Evas *eo_e,
  obj->cur->geometry.h);
   EINA_RECTANGLE_SET(, ux, uy, uw, uh);
 
-  if (eina_rectangle_intersection(, ))
+  if (eina_rectangle_intersection(, ) &&
+  _snapshot_needs_redraw(evas, obj))
 {
void *pseudo_canvas;
unsigned int restore_offset = offset;
@@ -3191,7 +3217,7 @@ evas_render_updates_internal(Evas *eo_e,

[EGIT] [core/efl] master 16/53: evas filter: Implement blur filter in pure GL

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5bce7120f1c2b15ee23a874e4910316569a435c8

commit 5bce7120f1c2b15ee23a874e4910316569a435c8
Author: Jean-Philippe Andre 
Date:   Wed Jan 25 18:06:29 2017 +0900

evas filter: Implement blur filter in pure GL

Wait a second though, this implementation is not only incomplete
(no support for box vs. gaussian blur), it's also insanely bad in
terms of performance. Small radii may work fine, but at least blurs
render properly in GL with this patch (no more glReadPixels!).

The shader needs a lot of love, including in particular:
- support for 1D box blur single pass
- support for 1D gaussian (or sine) blur
- use linear interpolation and N-tap filters
- separation of 2D blur in two passes (high-level logic)
- potentially separation of large 1D blurs in 2 or more passes
  knowing that 2sigma == sigma + sigma when it comes to the gaussian
  bell curve.
---
 src/Makefile_Evas.am   |   1 +
 src/bin/elementary/test_gfx_filters.c  |   2 +
 src/lib/evas/filters/evas_filter.c |  30 -
 .../evas/engines/gl_common/evas_gl_common.h|   4 +-
 .../evas/engines/gl_common/evas_gl_context.c   | 145 ++---
 .../evas/engines/gl_common/evas_gl_shader.c|   9 +-
 .../engines/gl_common/shader/evas_gl_shaders.x |  71 +-
 .../evas/engines/gl_common/shader/fragment.glsl|  69 ++
 .../evas/engines/gl_common/shader/vertex.glsl  |  14 +-
 src/modules/evas/engines/gl_generic/evas_engine.c  |   2 +-
 .../engines/gl_generic/filters/gl_engine_filter.h  |   2 +-
 .../engines/gl_generic/filters/gl_filter_blur.c|  63 +
 12 files changed, 382 insertions(+), 30 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index b270f76..5345b9d 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -844,6 +844,7 @@ modules/evas/engines/gl_generic/evas_ector_gl_buffer.c \
 modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c \
 modules/evas/engines/gl_generic/filters/gl_engine_filter.h \
 modules/evas/engines/gl_generic/filters/gl_filter_blend.c \
+modules/evas/engines/gl_generic/filters/gl_filter_blur.c \
 modules/evas/engines/gl_generic/filters/gl_filter_curve.c \
 modules/evas/engines/gl_generic/filters/gl_filter_displace.c \
 modules/evas/engines/gl_generic/filters/gl_filter_fill.c \
diff --git a/src/bin/elementary/test_gfx_filters.c 
b/src/bin/elementary/test_gfx_filters.c
index d67f616..94036c3 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -47,6 +47,8 @@ static const Filter_Image images_anim[] = {
 /* builtin filter examples */
 static const Filter templates[] = {
{ "Custom", NULL, NULL },
+   { "BLUR",
+ "blur { 15, color = 'darkblue' }", NULL },
{ "Simple blend",
  "blend { color = 'darkblue' }", NULL },
{ "Black shadow",
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index b343b91..bb761f3 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -548,11 +548,6 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, 
void *drawctx,
Eina_Bool override;
DATA32 color;
 
-   // Note (SW engine):
-   // The basic blur operation overrides the pixels in the target buffer,
-   // only supports one direction (X or Y) and no offset. As a consequence
-   // most cases require intermediate work buffers.
-
EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(drawctx, NULL);
 
@@ -570,8 +565,6 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void 
*drawctx,
out = _filter_buffer_get(ctx, outbuf);
EINA_SAFETY_ON_FALSE_GOTO(out, fail);
 
-   if (in == out) out->dirty = EINA_FALSE;
-
ENFN->context_color_get(ENDT, drawctx, , , , );
color = ARGB_JOIN(A, R, G, B);
if (!color)
@@ -580,6 +573,29 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, 
void *drawctx,
 return _command_new(ctx, EVAS_FILTER_MODE_SKIP, NULL, NULL, NULL);
  }
 
+   if (ctx->gl)
+ {
+// GL engine: single pass!
+XDBG("Add GL blur %d -> %d (%dx%d px)", in->id, out->id, dx, dy);
+cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, in, NULL, out);
+if (!cmd) goto fail;
+cmd->blur.type = type;
+cmd->blur.dx = dx;
+cmd->blur.dy = dy;
+cmd->blur.count = count;
+cmd->draw.ox = ox;
+cmd->draw.oy = oy;
+DRAW_COLOR_SET(R, G, B, A);
+return cmd;
+ }
+
+   // Note (SW engine):
+   // The basic blur operation overrides the pixels in the target buffer,
+   // only supports one direction (X or Y) and no offset. As a consequence
+   // most cases require intermediate work buffers.
+
+   if (in == out) out->dirty = EINA_FALSE;
+
render_op = 

[EGIT] [core/efl] master 43/53: evas filters: Avoid creating input buffer for images

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=293438111c9a7cdb711f19411a4c5343ed04f0ca

commit 293438111c9a7cdb711f19411a4c5343ed04f0ca
Author: Jean-Philippe Andre 
Date:   Mon Apr 3 15:34:10 2017 +0900

evas filters: Avoid creating input buffer for images

When the filtered object is an image, without borders, map,
fill info or anything of this sort, then the filter input
buffer is really just a copy of the original image. We can
skip that to save on memory usage and pixel fetches.
---
 src/lib/evas/canvas/evas_object_image.c | 43 +
 src/lib/evas/filters/evas_filter.c  | 38 ++---
 src/lib/evas/include/evas_filter.h  |  1 +
 3 files changed, 79 insertions(+), 3 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_image.c 
b/src/lib/evas/canvas/evas_object_image.c
index 94feded..0205ed6 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1719,6 +1719,35 @@ 
_efl_canvas_image_internal_efl_canvas_filter_internal_filter_state_prepare(
state->scale = obj->cur->scale;
 }
 
+static inline Eina_Bool
+_image_has_border(Evas_Object_Protected_Data *obj EINA_UNUSED, Evas_Image_Data 
*o)
+{
+   return o->cur->border.l || o->cur->border.r || o->cur->border.t ||
+ o->cur->border.b || (o->cur->border.fill == 0);
+}
+
+static inline Eina_Bool
+_image_has_map(Evas_Object_Protected_Data *obj, Evas_Image_Data *o EINA_UNUSED)
+{
+   return ((obj->map->cur.map) && (obj->map->cur.map->count > 3) && 
(obj->map->cur.usemap));
+}
+
+static inline Eina_Bool
+_image_is_filled(Evas_Object_Protected_Data *obj, Evas_Image_Data *o)
+{
+   if (o->filled) return EINA_TRUE;
+   return !o->cur->fill.x && !o->cur->fill.y &&
+ (o->cur->fill.w == obj->cur->geometry.w) &&
+ (o->cur->fill.h == obj->cur->geometry.h);
+}
+
+static inline Eina_Bool
+_image_is_scaled(Evas_Object_Protected_Data *obj, Evas_Image_Data *o)
+{
+   return ((obj->cur->geometry.w != o->cur->image.w) ||
+   (obj->cur->geometry.h != o->cur->image.h));
+}
+
 EOLIAN static Eina_Bool
 _efl_canvas_image_internal_efl_canvas_filter_internal_filter_input_render(
   Eo *eo_obj, Evas_Image_Data *o, void *_filter, void *context EINA_UNUSED,
@@ -1728,12 +1757,26 @@ 
_efl_canvas_image_internal_efl_canvas_filter_internal_filter_input_render(
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
Evas_Filter_Context *filter = _filter;
void *surface, *output, *ctx;
+   Eina_Bool ok;
int W, H;
 
W = obj->cur->geometry.w;
H = obj->cur->geometry.h;
output = ENDT;
 
+   // FIXME: In GL we could use the image even if scaled
+   if (!_image_has_border(obj, o) && !_image_has_map(obj, o) && 
_image_is_filled(obj, o)
+   && !_image_is_scaled(obj, o))
+ {
+int imagew, imageh, uvw, uvh;
+
+surface = _evas_image_pixels_get(eo_obj, obj, output, NULL, NULL, x, y,
+ , , , , 
EINA_FALSE, EINA_FALSE);
+
+ok = evas_filter_buffer_backing_set(filter, 
EVAS_FILTER_BUFFER_INPUT_ID, surface);
+if (ok) return EINA_TRUE;
+ }
+
surface = evas_filter_buffer_backing_get(filter, 
EVAS_FILTER_BUFFER_INPUT_ID, EINA_TRUE);
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
 
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index f08926e..270c79f 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -365,8 +365,11 @@ 
evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx)
  continue;
   }
 
-render |= (fb->id == EVAS_FILTER_BUFFER_INPUT_ID);
-render |= fb->is_render || fb->transient;
+// Skip input buffer, allocate it in input render phase
+if (fb->id == EVAS_FILTER_BUFFER_INPUT_ID)
+  continue;
+
+render = fb->is_render || fb->transient;
 draw |= (fb->id == EVAS_FILTER_BUFFER_OUTPUT_ID);
 
 fb->buffer = _ector_buffer_create(fb, render, draw);
@@ -510,6 +513,9 @@ evas_filter_buffer_backing_get(Evas_Filter_Context *ctx, 
int bufid, Eina_Bool re
fb = _filter_buffer_get(ctx, bufid);
if (!fb) return NULL;
 
+   if (!fb->buffer)
+ evas_filter_buffer_backing_set(ctx, bufid, NULL);
+
if (render)
  return evas_ector_buffer_render_image_get(fb->buffer); // ref++
else
@@ -517,6 +523,32 @@ evas_filter_buffer_backing_get(Evas_Filter_Context *ctx, 
int bufid, Eina_Bool re
 }
 
 Eina_Bool
+evas_filter_buffer_backing_set(Evas_Filter_Context *ctx, int bufid,
+   void *engine_buffer)
+{
+   Evas_Filter_Buffer *fb;
+
+   fb = _filter_buffer_get(ctx, bufid);
+   if (!fb) return EINA_FALSE;
+
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(!fb->buffer, EINA_FALSE);
+
+   if (!engine_buffer)
+ {
+fb->buffer = 

[EGIT] [core/efl] master 37/53: evas image: Factorize some code for render

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=408115cef6e2460bbf165f19ca6ef09eb1ec5532

commit 408115cef6e2460bbf165f19ca6ef09eb1ec5532
Author: Jean-Philippe Andre 
Date:   Tue Mar 28 14:40:29 2017 +0900

evas image: Factorize some code for render

This factorizes some of the common code for image render
and resolving is_inside (verifying alpha value of a pixel).
This should also be used by save(), as well as buffer_map().

This patch introduces lots of whitespace changes by using return
instead of long if() {} or else {} blocks.
---
 src/lib/evas/canvas/evas_object_image.c | 1107 +++
 1 file changed, 527 insertions(+), 580 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_image.c 
b/src/lib/evas/canvas/evas_object_image.c
index 46bfd33..b76f876 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -888,6 +888,8 @@ _efl_canvas_image_internal_efl_file_save(const Eo *eo_obj, 
Evas_Image_Data *o, c
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
Evas_Object_Protected_Data *source = (o->cur->source ? 
efl_data_scope_get(o->cur->source, EFL_CANVAS_OBJECT_CLASS) : NULL);
 
+   // FIXME: Use _evas_image_pixels_get()
+
evas_object_async_block(obj);
 
if (o->cur->scene)
@@ -1885,55 +1887,57 @@ evas_object_image_render(Evas_Object *eo_obj, 
Evas_Object_Protected_Data *obj, v
_evas_image_render(eo_obj, obj, output, context, surface, x, y, 0, 0, 0, 0, 
do_async);
 }
 
-static void
-_evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
-   void *output, void *context, void *surface, int x, int y,
-   int l, int t, int r, int b, Eina_Bool do_async)
+void *
+_evas_image_pixels_get(Eo *eo_obj, Evas_Object_Protected_Data *obj,
+   void *output, void *context, void *surface, int x, int 
y,
+   int *imagew, int *imageh, int *uvw, int *uvh)
 {
Evas_Image_Data *o = obj->private_data, *oi = NULL;
-   int imagew, imageh, uvw, uvh, cw, ch;
+   Evas_Object_Protected_Data *source = NULL;
void *pixels;
 
-   Evas_Object_Protected_Data *source =
-  (o->cur->source ?
-   efl_data_scope_get(o->cur->source, EFL_CANVAS_OBJECT_CLASS):
-   NULL);
-   if (source && (source->type == o_type))
- oi = efl_data_scope_get(o->cur->source, MY_CLASS);
+   if (o->cur->source)
+ {
+source = efl_data_scope_get(o->cur->source, EFL_CANVAS_OBJECT_CLASS);
+if (source && (source->type == o_type))
+  oi = efl_data_scope_get(o->cur->source, MY_CLASS);
+ }
 
if (o->cur->scene)
  {
 _evas_image_3d_render(obj->layer->evas->evas, eo_obj, obj, o, 
o->cur->scene);
 pixels = obj->data_3d->surface;
-imagew = obj->data_3d->w;
-imageh = obj->data_3d->h;
-uvw = imagew;
-uvh = imageh;
+*imagew = obj->data_3d->w;
+*imageh = obj->data_3d->h;
+*uvw = *imagew;
+*uvh = *imageh;
  }
else if (obj->cur->snapshot)
  {
 pixels = o->engine_data;
-imagew = o->cur->image.w;
-imageh = o->cur->image.h;
-uvw = imagew;
-uvh = imageh;
+*imagew = o->cur->image.w;
+*imageh = o->cur->image.h;
+*uvw = *imagew;
+*uvh = *imageh;
  }
else if (!o->cur->source || !source)
  {
-pixels = evas_process_dirty_pixels(eo_obj, obj, o, output, surface, 
o->engine_data);
-/* pixels = o->engine_data; */
-imagew = o->cur->image.w;
-imageh = o->cur->image.h;
-uvw = imagew;
-uvh = imageh;
+if (output && surface)
+  pixels = evas_process_dirty_pixels(eo_obj, obj, o, output, surface, 
o->engine_data);
+else
+  pixels = o->engine_data;
+*imagew = o->cur->image.w;
+*imageh = o->cur->image.h;
+*uvw = *imagew;
+*uvh = *imageh;
  }
else if (source->proxy->surface && !source->proxy->redraw)
  {
 pixels = source->proxy->surface;
-imagew = source->proxy->w;
-imageh = source->proxy->h;
-uvw = imagew;
-uvh = imageh;
+*imagew = source->proxy->w;
+*imageh = source->proxy->h;
+*uvw = *imagew;
+*uvh = *imageh;
  }
else if (oi && oi->engine_data)
  {
@@ -1945,12 +1949,12 @@ _evas_image_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
  if (output_buffer)
pixels = output_buffer;
   }
-imagew = oi->cur->image.w;
-imageh = oi->cur->image.h;
-uvw = source->cur->geometry.w;
-uvh = source->cur->geometry.h;
+*imagew = oi->cur->image.w;
+*imageh = oi->cur->image.h;
+*uvw = source->cur->geometry.w;
+*uvh = source->cur->geometry.h;
 /* check source_clip since we 

[EGIT] [core/efl] master 33/53: evas filters: Refactor to support reuse of buffers

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1bf24f87626b438598936ad4f780f7877447f496

commit 1bf24f87626b438598936ad4f780f7877447f496
Author: Jean-Philippe Andre 
Date:   Wed Mar 22 16:55:26 2017 +0900

evas filters: Refactor to support reuse of buffers

This will reuse existing buffers by resetting only the minimum
required in the filter context (also reused). Work in progress,
as the actual reuse is disabled for now.
---
 src/bin/elementary/test_evas_snapshot.c |   1 -
 src/lib/evas/canvas/evas_filter_mixin.c | 109 ++
 src/lib/evas/canvas/evas_object_main.c  |   2 +-
 src/lib/evas/canvas/evas_object_textblock.c |   4 +-
 src/lib/evas/filters/evas_filter.c  | 171 
 src/lib/evas/filters/evas_filter_parser.c   |  73 ++--
 src/lib/evas/filters/evas_filter_private.h  |   8 +-
 src/lib/evas/include/evas_filter.h  |  10 +-
 src/lib/evas/include/evas_private.h |   3 +
 9 files changed, 286 insertions(+), 95 deletions(-)

diff --git a/src/bin/elementary/test_evas_snapshot.c 
b/src/bin/elementary/test_evas_snapshot.c
index 94d6e16..13e0458 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -111,7 +111,6 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *e
   efl_pack_grid(grid, efl_added, 1, 1, GRID_SIZE - 2, 
GRID_SIZE - 2),
   efl_gfx_visible_set(efl_added, 1));
 
-
// Objects above snapshot
// 1. Opaque rect, not changing
o = evas_object_rectangle_add(win);
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index 45db424..fab03ba 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -43,6 +43,8 @@ _filter_end_sync(Evas_Filter_Context *ctx, 
Evas_Object_Protected_Data *obj,
  Evas_Filter_Data *pd, Eina_Bool success)
 {
void *previous = pd->data->output;
+   Eina_Bool destroy = !pd->data->reuse;
+   Evas_Object_Filter_Data *fcow;
Eo *eo_obj = obj->object;
 
if (!success)
@@ -50,10 +52,10 @@ _filter_end_sync(Evas_Filter_Context *ctx, 
Evas_Object_Protected_Data *obj,
 ERR("Filter failed at runtime!");
 evas_filter_invalid_set(eo_obj, EINA_TRUE);
 evas_filter_dirty(eo_obj);
+destroy = EINA_TRUE;
  }
else
  {
-Evas_Object_Filter_Data *fcow;
 void *output = evas_filter_buffer_backing_get(ctx, 
EVAS_FILTER_BUFFER_OUTPUT_ID, EINA_FALSE);
 
 fcow = FCOW_BEGIN(pd);
@@ -61,9 +63,29 @@ _filter_end_sync(Evas_Filter_Context *ctx, 
Evas_Object_Protected_Data *obj,
 FCOW_END(fcow, pd);
  }
 
-   // Destroy context as we won't reuse it.
-   evas_filter_buffer_backing_release(ctx, previous);
-   evas_filter_context_destroy(ctx);
+   if (EINA_UNLIKELY(ctx != pd->data->context))
+ {
+ERR("Filter context has changed! Destroying it now...");
+fcow = FCOW_BEGIN(pd);
+evas_filter_context_destroy(fcow->context);
+fcow->context = NULL;
+FCOW_END(fcow, pd);
+destroy = EINA_TRUE;
+ }
+
+   if (destroy)
+ {
+evas_filter_buffer_backing_release(ctx, previous);
+evas_filter_context_destroy(ctx);
+ctx = NULL;
+ }
+
+   if (pd->data->context != ctx)
+ {
+fcow = FCOW_BEGIN(pd);
+fcow->context = ctx;
+FCOW_END(fcow, pd);
+ }
 }
 
 static void
@@ -192,13 +214,6 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 Evas_Object_Filter_Data *fcow;
 Evas_Filter_Padding pad;
 
-/* NOTE: Filter rendering is now done ENTIRELY on CPU.
- * So we rely on cache/cache2 to allocate a real image buffer,
- * that we can draw to. The OpenGL texture will be created only
- * after the rendering has been done, as we simply push the output
- * image to GL.
- */
-
 W = obj->cur->geometry.w;
 H = obj->cur->geometry.h;
 X = obj->cur->geometry.x;
@@ -217,7 +232,7 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
obj->cur->clipper->cur->cache.clip.b,
obj->cur->clipper->cur->cache.clip.a);
 else
-   ENFN->context_multiplier_unset(output, context);
+  ENFN->context_multiplier_unset(output, context);
 
 if (!pd->data->chain)
   {
@@ -295,22 +310,57 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
  _evas_filter_state_set_internal(pd->data->chain, pd);
   }
 
-filter = evas_filter_context_new(obj->layer->evas, do_async, 0);
-
-// Run script
-ok = evas_filter_context_program_use(filter, pd->data->chain);
-if (!filter || !ok)
+

[EGIT] [core/efl] master 28/53: evas filters: Pass gaussian values to GL blur shader

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6af3c20aebc822cfb4148e60a1cb4e19e489c4d1

commit 6af3c20aebc822cfb4148e60a1cb4e19e489c4d1
Author: Jean-Philippe Andre 
Date:   Mon Mar 20 23:25:05 2017 +0900

evas filters: Pass gaussian values to GL blur shader
---
 src/lib/evas/filters/evas_filter.c |   7 +-
 .../evas/engines/gl_common/evas_gl_common.h|   4 +-
 .../evas/engines/gl_common/evas_gl_context.c   |  34 +-
 .../evas/engines/gl_common/evas_gl_shader.c|   3 +-
 .../engines/gl_common/shader/evas_gl_shaders.x |  41 +---
 .../evas/engines/gl_common/shader/fragment.glsl|  39 +--
 .../evas/engines/gl_common/shader/vertex.glsl  |   5 +-
 src/modules/evas/engines/gl_generic/evas_engine.c  |  22 ++--
 .../engines/gl_generic/filters/gl_engine_filter.h  |  14 +--
 .../engines/gl_generic/filters/gl_filter_blend.c   |   2 +-
 .../engines/gl_generic/filters/gl_filter_blur.c| 114 ++---
 .../engines/gl_generic/filters/gl_filter_curve.c   |   2 +-
 .../gl_generic/filters/gl_filter_displace.c|   2 +-
 .../engines/gl_generic/filters/gl_filter_fill.c|   2 +-
 .../engines/gl_generic/filters/gl_filter_mask.c|   2 +-
 15 files changed, 224 insertions(+), 69 deletions(-)

diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index ef2710b..f6e1e27 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -548,7 +548,7 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
 {
Evas_Filter_Command *cmd;
Evas_Filter_Buffer *dx_in, *dx_out, *dy_in, *tmp = NULL;
-   int down_x, down_y, dx, dy;
+   int dx, dy;
 
/* GL blur implementation:
 * - Create intermediate buffer T (variable size)
@@ -567,8 +567,13 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
 
if (type == EVAS_FILTER_BLUR_DEFAULT)
  {
+int down_x = 1, down_y = 1;
+
+/* For now, disable scaling - testing perfect gaussian blur until it's
+ * ready:
 down_x = MAX((1 << evas_filter_smallest_pow2_larger_than(dx / 2) / 2), 
1);
 down_y = MAX((1 << evas_filter_smallest_pow2_larger_than(dy / 2) / 2), 
1);
+*/
 
 tmp = evas_filter_temporary_buffer_get(ctx, ctx->w / down_x, ctx->h / 
down_y,
in->alpha_only, EINA_TRUE);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h 
b/src/modules/evas/engines/gl_common/evas_gl_common.h
index b48955e..3dcc558 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -651,7 +651,9 @@ void  
evas_gl_common_filter_displace_push(Evas_Engine_GL_Context *gc
   int x, int y, int w, int 
h, double dx, double dy, Eina_Bool nearest);
 void  evas_gl_common_filter_curve_push(Evas_Engine_GL_Context *gc, 
Evas_GL_Texture *tex,
int x, int y, int w, int h, 
const uint8_t *points, int channel);
-void  evas_gl_common_filter_blur_push(Evas_Engine_GL_Context *gc, 
Evas_GL_Texture *tex, double sx, double sy, double sw, double sh, double dx, 
double dy, double dw, double dh, double radius, Eina_Bool horiz);
+void  evas_gl_common_filter_blur_push(Evas_Engine_GL_Context *gc, 
Evas_GL_Texture *tex, double sx, double sy, double sw, double sh,
+  double dx, double dy, double 
dw, double dh, GLfloat *values, GLfloat *offsets, int count,
+  Eina_Bool horiz);
 
 int   evas_gl_common_shader_program_init(Evas_GL_Shared *shared);
 void  evas_gl_common_shader_program_shutdown(Evas_GL_Shared 
*shared);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c 
b/src/modules/evas/engines/gl_common/evas_gl_context.c
index 48de69e..c19492d 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -3432,7 +3432,8 @@ evas_gl_common_filter_blur_push(Evas_Engine_GL_Context 
*gc,
 Evas_GL_Texture *tex,
 double sx, double sy, double sw, double sh,
 double dx, double dy, double dw, double dh,
-double radius, Eina_Bool horiz)
+GLfloat *values, GLfloat *offsets, int count,
+Eina_Bool horiz)
 {
double ox1, oy1, ox2, oy2, ox3, oy3, ox4, oy4, pw, ph;
GLfloat tx1, ty1, tx2, ty2, tx3, ty3, tx4, ty4;
@@ -3443,6 +3444,8 @@ evas_gl_common_filter_blur_push(Evas_Engine_GL_Context 
*gc,
Eina_Bool blend = EINA_TRUE;
Eina_Bool smooth = EINA_TRUE;
Shader_Type type = horiz ? SHD_FILTER_BLUR_X : 

[EGIT] [core/efl] master 17/53: evas: Improve blur filter perf by using 2 passes

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b90246a619aab73cc4735296193558f574717c6a

commit b90246a619aab73cc4735296193558f574717c6a
Author: Jean-Philippe Andre 
Date:   Tue Feb 7 18:48:46 2017 +0900

evas: Improve blur filter perf by using 2 passes

By simply splitting X and Y blurs in two passes we can improve
the performance of the blur filter a lot.

There is still much to be done to make it really fast and nice
looking:
- implement true gaussian blur (not sine-based approximation,
  right now the actual blurs look different in SW and GL)
- exploit linear interpolation for R tap instead of R*2+1 taps
  (a tap being a texel fetch)
- downscale & upscale large images with large blur radii
---
 src/lib/evas/filters/evas_filter.c | 103 +
 src/lib/evas/filters/evas_filter_private.h |   1 +
 .../evas/engines/gl_common/evas_gl_common.h|   6 +-
 .../evas/engines/gl_common/evas_gl_context.c   |  19 ++--
 .../evas/engines/gl_common/evas_gl_shader.c|  12 ++-
 .../engines/gl_common/shader/evas_gl_shaders.x |  53 ---
 .../evas/engines/gl_common/shader/fragment.glsl|  47 --
 .../evas/engines/gl_common/shader/vertex.glsl  |   7 +-
 .../engines/gl_generic/filters/gl_filter_blur.c|  22 -
 .../software_generic/filters/evas_filter_blur.c|   2 +-
 10 files changed, 164 insertions(+), 108 deletions(-)

diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index bb761f3..5efe9e4 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -315,7 +315,7 @@ 
evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx)
   }
 
 render |= (fb->id == EVAS_FILTER_BUFFER_INPUT_ID);
-render |= fb->is_render;
+render |= fb->is_render || fb->transient;
 draw |= (fb->id == EVAS_FILTER_BUFFER_OUTPUT_ID);
 
 fb->buffer = _ector_buffer_create(fb, render, draw);
@@ -438,7 +438,11 @@ _command_new(Evas_Filter_Context *ctx, Evas_Filter_Mode 
mode,
cmd->draw.B = 255;
cmd->draw.A = 255;
cmd->draw.rop = EFL_GFX_RENDER_OP_BLEND;
-   if (output) output->dirty = EINA_TRUE;
+   if (output)
+ {
+cmd->draw.output_was_dirty = output->dirty;
+output->dirty = EINA_TRUE;
+ }
 
ctx->commands = eina_inlist_append(ctx->commands, EINA_INLIST_GET(cmd));
return cmd;
@@ -535,6 +539,84 @@ evas_filter_command_fill_add(Evas_Filter_Context *ctx, 
void *draw_context,
return cmd;
 }
 
+static Evas_Filter_Command *
+evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
+Evas_Filter_Buffer *in, Evas_Filter_Buffer 
*out,
+Evas_Filter_Blur_Type type,
+int dx, int dy, int ox, int oy, int count,
+int R, int G, int B, int A)
+{
+   Evas_Filter_Command *cmd;
+   Evas_Filter_Buffer *dx_out, *dy_in;
+
+   /* GL blur implementation:
+* - Always split X and Y passes (only one pass if 1D blur)
+* - TODO: Repeat blur for large radius
+* - TODO: Scale down & up for cheap blur
+* - The rest is all up to the engine!
+*/
+
+   if (dx && dy)
+ {
+dx_out = evas_filter_temporary_buffer_get(ctx, 0, 0, in->alpha_only, 
1);
+if (!dx_out) goto fail;
+dy_in = dx_out;
+ }
+   else
+ {
+dx_out = out;
+dy_in = in;
+ }
+
+   if (dx)
+ {
+XDBG("Add GL blur %d -> %d (%dx%d px)", in->id, dx_out->id, dx, 0);
+cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, in, NULL, dx_out);
+if (!cmd) goto fail;
+cmd->blur.type = type;
+cmd->blur.dx = dx;
+cmd->blur.count = count;
+ }
+
+   if (dy)
+ {
+XDBG("Add GL blur %d -> %d (%dx%d px)", dy_in->id, out->id, 0, dy);
+cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dy_in, NULL, out);
+if (!cmd) goto fail;
+cmd->blur.type = type;
+cmd->blur.dy = dy;
+cmd->blur.count = count;
+ }
+
+   cmd->draw.ox = ox;
+   cmd->draw.oy = oy;
+   DRAW_COLOR_SET(R, G, B, A);
+   cmd->draw.rop = (in == out) ? EFL_GFX_RENDER_OP_COPY : 
EFL_GFX_RENDER_OP_BLEND;
+
+   _filter_buffer_unlock_all(ctx);
+   return cmd;
+
+fail:
+   ERR("Failed to add blur");
+   _filter_buffer_unlock_all(ctx);
+   return NULL;
+}
+
+static Eina_Bool
+_blur_support_gl(Evas_Filter_Context *ctx, Evas_Filter_Buffer *in, 
Evas_Filter_Buffer *out)
+{
+   Evas_Filter_Command cmd = {};
+
+   cmd.input = in;
+   cmd.output = out;
+   cmd.mode = EVAS_FILTER_MODE_BLUR;
+   cmd.ctx = ctx;
+   cmd.blur.type = EVAS_FILTER_BLUR_GAUSSIAN;
+   cmd.blur.dx = 5;
+
+   return cmd.ENFN->gfx_filter_supports(cmd.ENDT, ) == 
EVAS_FILTER_SUPPORT_GL;
+}
+
 Evas_Filter_Command *
 evas_filter_command_blur_add(Evas_Filter_Context *ctx, void 

[EGIT] [core/efl] master 05/53: evas filters: Move displace to software generic (5/8)

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b56a788e96fc26c72b38b3137d586bdd78521740

commit b56a788e96fc26c72b38b3137d586bdd78521740
Author: Jean-Philippe Andre 
Date:   Tue Jan 17 20:56:33 2017 +0900

evas filters: Move displace to software generic (5/8)
---
 src/Makefile_Evas.am | 2 +-
 src/lib/evas/filters/evas_filter.c   | 3 ---
 src/lib/evas/filters/evas_filter_private.h   | 1 -
 src/modules/evas/engines/software_generic/evas_engine.c  | 1 +
 .../evas/engines/software_generic/filters/evas_engine_filter.h   | 1 +
 .../engines/software_generic}/filters/evas_filter_displace.c | 9 -
 6 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index d9cbaef..c1bb961 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -594,7 +594,6 @@ lib/evas/canvas/evas_filter_mixin.c \
 lib/evas/filters/evas_filter.c \
 lib/evas/filters/evas_filter_blur.c \
 lib/evas/filters/evas_filter_bump.c \
-lib/evas/filters/evas_filter_displace.c \
 lib/evas/filters/evas_filter_parser.c \
 lib/evas/filters/evas_filter_transform.c \
 lib/evas/filters/evas_filter_utils.c \
@@ -616,6 +615,7 @@ GFX_FILTER_SW_FILES = \
 modules/evas/engines/software_generic/filters/evas_engine_filter.h \
 modules/evas/engines/software_generic/filters/evas_filter_blend.c \
 modules/evas/engines/software_generic/filters/evas_filter_curve.c \
+modules/evas/engines/software_generic/filters/evas_filter_displace.c \
 modules/evas/engines/software_generic/filters/evas_filter_fill.c \
 modules/evas/engines/software_generic/filters/evas_filter_mask.c \
 $(NULL)
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index a5ffa59..97e06d1 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -1541,9 +1541,6 @@ _filter_command_run(Evas_Filter_Command *cmd)
case EVAS_FILTER_MODE_BLUR:
  func = evas_filter_blur_cpu_func_get(cmd);
  break;
-   case EVAS_FILTER_MODE_DISPLACE:
- func = evas_filter_displace_cpu_func_get(cmd);
- break;
case EVAS_FILTER_MODE_BUMP:
  func = evas_filter_bump_map_cpu_func_get(cmd);
  break;
diff --git a/src/lib/evas/filters/evas_filter_private.h 
b/src/lib/evas/filters/evas_filter_private.h
index c4f3d4b..3be64de 100644
--- a/src/lib/evas/filters/evas_filter_private.h
+++ b/src/lib/evas/filters/evas_filter_private.h
@@ -263,7 +263,6 @@ void 
evas_filter_context_source_set(Evas_Filter_Context *ctx
 /* FIXME: CPU filters entry points. Move these to the Evas Engine itself. */
 Evas_Filter_Apply_Func   evas_filter_blur_cpu_func_get(Evas_Filter_Command 
*cmd);
 Evas_Filter_Apply_Func   evas_filter_bump_map_cpu_func_get(Evas_Filter_Command 
*cmd);
-Evas_Filter_Apply_Func   evas_filter_displace_cpu_func_get(Evas_Filter_Command 
*cmd);
 Evas_Filter_Apply_Func   
evas_filter_transform_cpu_func_get(Evas_Filter_Command *cmd);
 
 /* Utility functions */
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c 
b/src/modules/evas/engines/software_generic/evas_engine.c
index d71d7e7..f7fddb8 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -4629,6 +4629,7 @@ _gfx_filter_func_get(Evas_Filter_Command *cmd)
  {
   case EVAS_FILTER_MODE_BLEND: func = eng_filter_blend_func_get(cmd); 
break;
   case EVAS_FILTER_MODE_CURVE: func = eng_filter_curve_func_get(cmd); 
break;
+  case EVAS_FILTER_MODE_DISPLACE: func = 
eng_filter_displace_func_get(cmd); break;
   case EVAS_FILTER_MODE_FILL: func = eng_filter_fill_func_get(cmd); break;
   case EVAS_FILTER_MODE_MASK: func = eng_filter_mask_func_get(cmd); break;
   default: return NULL;
diff --git 
a/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h 
b/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
index fd282bd..ee26a0f 100644
--- a/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
+++ b/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
@@ -6,6 +6,7 @@
 
 Evas_Filter_Apply_Func eng_filter_blend_func_get(Evas_Filter_Command *cmd);
 Evas_Filter_Apply_Func eng_filter_curve_func_get(Evas_Filter_Command *cmd);
+Evas_Filter_Apply_Func eng_filter_displace_func_get(Evas_Filter_Command *cmd);
 Evas_Filter_Apply_Func eng_filter_fill_func_get(Evas_Filter_Command *cmd);
 Evas_Filter_Apply_Func eng_filter_mask_func_get(Evas_Filter_Command *cmd);
 
diff --git a/src/lib/evas/filters/evas_filter_displace.c 
b/src/modules/evas/engines/software_generic/filters/evas_filter_displace.c
similarity index 97%
rename from src/lib/evas/filters/evas_filter_displace.c
rename to 

[EGIT] [core/efl] master 27/53: evas filters: Use GL downscaling for blur

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a9ddeeb4fb3dc1fecc930d77dfa8721ac88a99b7

commit a9ddeeb4fb3dc1fecc930d77dfa8721ac88a99b7
Author: Jean-Philippe Andre 
Date:   Mon Mar 20 20:20:21 2017 +0900

evas filters: Use GL downscaling for blur

This will improve the performance a lot. Now remains to figure
out the best values for downscaling and improve the actual blur
shader as well.
---
 src/lib/evas/filters/evas_filter.c | 51 +-
 .../evas/engines/gl_common/evas_gl_common.h|  2 +-
 .../evas/engines/gl_common/evas_gl_context.c   | 21 -
 .../engines/gl_generic/filters/gl_filter_blur.c| 27 
 4 files changed, 68 insertions(+), 33 deletions(-)

diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index a37fe40..ef2710b 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -543,24 +543,53 @@ static Evas_Filter_Command *
 evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
 Evas_Filter_Buffer *in, Evas_Filter_Buffer 
*out,
 Evas_Filter_Blur_Type type,
-int dx, int dy, int ox, int oy, int count,
+int rx, int ry, int ox, int oy, int count,
 int R, int G, int B, int A)
 {
Evas_Filter_Command *cmd;
-   Evas_Filter_Buffer *dx_out, *dy_in;
+   Evas_Filter_Buffer *dx_in, *dx_out, *dy_in, *tmp = NULL;
+   int down_x, down_y, dx, dy;
 
/* GL blur implementation:
-* - Always split X and Y passes (only one pass if 1D blur)
-* - TODO: Repeat blur for large radius
-* - TODO: Scale down & up for cheap blur
-* - The rest is all up to the engine!
+* - Create intermediate buffer T (variable size)
+* - Downscale to buffer T
+* - Apply X blur kernel
+* - Apply Y blur kernel while scaling up
+*
+* - TODO: Fix distortion X vs. Y
+* - TODO: Calculate best scaline and blur radius
+* - TODO: Add post-processing? (2D single-pass)
 */
 
+   dx = rx;
+   dy = ry;
+   dx_in = in;
+
+   if (type == EVAS_FILTER_BLUR_DEFAULT)
+ {
+down_x = MAX((1 << evas_filter_smallest_pow2_larger_than(dx / 2) / 2), 
1);
+down_y = MAX((1 << evas_filter_smallest_pow2_larger_than(dy / 2) / 2), 
1);
+
+tmp = evas_filter_temporary_buffer_get(ctx, ctx->w / down_x, ctx->h / 
down_y,
+   in->alpha_only, EINA_TRUE);
+if (!tmp) goto fail;
+
+// FIXME: Fix logic here. This is where the smarts are! Now it's dumb.
+dx = rx / down_x;
+dy = ry / down_y;
+
+XDBG("Add GL downscale %d (%dx%d) -> %d (%dx%d)", in->id, in->w, 
in->h, tmp->id, tmp->w, tmp->h);
+cmd = _command_new(ctx, EVAS_FILTER_MODE_BLEND, in, NULL, tmp);
+if (!cmd) goto fail;
+cmd->draw.fillmode = EVAS_FILTER_FILL_MODE_STRETCH_XY;
+dx_in = tmp;
+ }
+
if (dx && dy)
  {
-dx_out = evas_filter_temporary_buffer_get(ctx, 0, 0, in->alpha_only, 
1);
-if (!dx_out) goto fail;
-dy_in = dx_out;
+tmp = evas_filter_temporary_buffer_get(ctx, 0, 0, in->alpha_only, 1);
+if (!tmp) goto fail;
+dy_in = dx_out = tmp;
  }
else
  {
@@ -570,8 +599,8 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
 
if (dx)
  {
-XDBG("Add GL blur %d -> %d (%dx%d px)", in->id, dx_out->id, dx, 0);
-cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, in, NULL, dx_out);
+XDBG("Add GL blur %d -> %d (%dx%d px)", dx_in->id, dx_out->id, dx, 0);
+cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dx_in, NULL, dx_out);
 if (!cmd) goto fail;
 cmd->blur.type = type;
 cmd->blur.dx = dx;
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h 
b/src/modules/evas/engines/gl_common/evas_gl_common.h
index 3e7548a..b48955e 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -651,7 +651,7 @@ void  
evas_gl_common_filter_displace_push(Evas_Engine_GL_Context *gc
   int x, int y, int w, int 
h, double dx, double dy, Eina_Bool nearest);
 void  evas_gl_common_filter_curve_push(Evas_Engine_GL_Context *gc, 
Evas_GL_Texture *tex,
int x, int y, int w, int h, 
const uint8_t *points, int channel);
-void  evas_gl_common_filter_blur_push(Evas_Engine_GL_Context *gc, 
Evas_GL_Texture *tex, int x, int y, int w, int h, double radius, Eina_Bool 
horiz);
+void  evas_gl_common_filter_blur_push(Evas_Engine_GL_Context *gc, 
Evas_GL_Texture *tex, double sx, double sy, double sw, double sh, double dx, 
double dy, double dw, 

[EGIT] [core/efl] master 42/53: evas filters: Implement obscure support for gl blur

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=45548e8358b0affcaa9738ad1b5ae5b542c9349b

commit 45548e8358b0affcaa9738ad1b5ae5b542c9349b
Author: Jean-Philippe Andre 
Date:   Fri Mar 31 13:10:41 2017 +0900

evas filters: Implement obscure support for gl blur

This can help with performance when a large region of the
filtered image (eg. snapshot) is fully hidden by an opaque
object. For instance the window border is hidden by the
opaque window content.
---
 .../evas/engines/gl_common/evas_gl_context.c   | 100 +
 .../engines/gl_generic/filters/gl_filter_blur.c| 120 +
 2 files changed, 159 insertions(+), 61 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c 
b/src/modules/evas/engines/gl_common/evas_gl_context.c
index d19eb69..b61cc6a 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -3139,13 +3139,17 @@ _filter_data_flush(Evas_Engine_GL_Context *gc, 
Evas_GL_Program *prog)
 }
 
 static inline void
-_filter_data_prepare(Evas_Engine_GL_Context *gc, int pn,
- Evas_GL_Program *prog, int count)
+_filter_data_alloc(Evas_Engine_GL_Context *gc, int pn, int count)
 {
gc->pipe[pn].array.filter_data_count = count;
if (count) gc->pipe[pn].array.filter_data = malloc(count * 2 * 
sizeof(GLfloat));
else gc->pipe[pn].array.filter_data = NULL;
+}
 
+static inline void
+_filter_data_prepare(Evas_Engine_GL_Context *gc EINA_UNUSED,
+ Evas_GL_Program *prog, int count)
+{
if (!prog->filter) prog->filter = calloc(1, sizeof(*prog->filter));
if (!prog->filter->attribute.known_locations)
  {
@@ -3224,7 +3228,8 @@ 
evas_gl_common_filter_displace_push(Evas_Engine_GL_Context *gc,
// displace properties
gc->pipe[pn].shader.filter.map_tex = map_tex->pt->texture;
gc->pipe[pn].shader.filter.map_nearest = nearest;
-   _filter_data_prepare(gc, pn, prog, 3);
+   _filter_data_prepare(gc, prog, 3);
+   _filter_data_alloc(gc, pn, 3);
 
sx = x;
sy = y;
@@ -3439,7 +3444,7 @@ evas_gl_common_filter_blur_push(Evas_Engine_GL_Context 
*gc,
 const double * const offsets, int count,
 double radius, Eina_Bool horiz)
 {
-   double ox1, oy1, ox2, oy2, ox3, oy3, ox4, oy4, pw, ph;
+   double ox1, oy1, ox2, oy2, ox3, oy3, ox4, oy4, pw, ph, texlen;
GLfloat tx1, ty1, tx2, ty2, tx3, ty3, tx4, ty4;
GLfloat offsetx, offsety;
int r, g, b, a, nomul = 0, pn;
@@ -3447,11 +3452,10 @@ evas_gl_common_filter_blur_push(Evas_Engine_GL_Context 
*gc,
Eina_Bool blend = EINA_TRUE;
Eina_Bool smooth = EINA_TRUE;
Shader_Type type = horiz ? SHD_FILTER_BLUR_X : SHD_FILTER_BLUR_Y;
+   Eina_Bool update_uniforms = EINA_FALSE;
GLuint *map_tex_data;
double sum;
 
-   //shader_array_flush(gc);
-
r = R_VAL(>dc->mul.col);
g = G_VAL(>dc->mul.col);
b = B_VAL(>dc->mul.col);
@@ -3463,39 +3467,13 @@ evas_gl_common_filter_blur_push(Evas_Engine_GL_Context 
*gc,
 sw, sh, dw, dh, smooth, tex, 
EINA_FALSE,
 NULL, EINA_FALSE, EINA_FALSE, 0, 0,
 NULL, , NULL);
+
_filter_data_flush(gc, prog);
EINA_SAFETY_ON_NULL_RETURN(prog);
 
-   pn = _evas_gl_common_context_push(type, gc, tex, NULL, prog,
- sx, sy, dw, dh, blend, smooth,
- 0, 0, 0, 0, 0, EINA_FALSE);
-
-   gc->pipe[pn].region.type = type;
-   gc->pipe[pn].shader.prog = prog;
-   gc->pipe[pn].shader.cur_tex = tex->pt->texture;
-   gc->pipe[pn].shader.cur_texm = 0;
-   gc->pipe[pn].shader.tex_target = GL_TEXTURE_2D;
-   gc->pipe[pn].shader.smooth = smooth;
-   gc->pipe[pn].shader.mask_smooth = 0;
-   gc->pipe[pn].shader.blend = blend;
-   gc->pipe[pn].shader.render_op = gc->dc->render_op;
-   gc->pipe[pn].shader.clip = 0;
-   gc->pipe[pn].shader.cx = 0;
-   gc->pipe[pn].shader.cy = 0;
-   gc->pipe[pn].shader.cw = 0;
-   gc->pipe[pn].shader.ch = 0;
-   gc->pipe[pn].array.line = 0;
-   gc->pipe[pn].array.use_vertex = 1;
-   gc->pipe[pn].array.use_color = !nomul;
-   gc->pipe[pn].array.use_texuv = 1;
-   gc->pipe[pn].array.use_texuv2 = 0;
-   gc->pipe[pn].array.use_texuv3 = 0;
-   gc->pipe[pn].array.use_texsam = 0;
-   gc->pipe[pn].array.use_mask = 0;
-   gc->pipe[pn].array.use_masksam = 0;
-
-   pipe_region_expand(gc, pn, dx, dy, dw, dh);
-   PIPE_GROW(gc, pn, 6);
+   pw = tex->pt->w;
+   ph = tex->pt->h;
+   texlen = horiz ? pw : ph;
 
/* Convert double data to RGBA pixel data.
 *
@@ -3525,7 +3503,7 @@ evas_gl_common_filter_blur_push(Evas_Engine_GL_Context 
*gc,
  }
 
// Prepare attributes & uniforms
-   _filter_data_prepare(gc, pn, prog, 0);
+   _filter_data_prepare(gc, prog, 0);
if 

[EGIT] [core/efl] master 01/53: evas filters: Move blend to software_generic (1/8)

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0740010a061d15a4ecaa00dc21c10301e0af4847

commit 0740010a061d15a4ecaa00dc21c10301e0af4847
Author: Jean-Philippe Andre 
Date:   Tue Jan 17 16:13:35 2017 +0900

evas filters: Move blend to software_generic (1/8)

This is an attempt at refactoring the filters code so I can
later implement GL support. This patch adds a few extra changes
to remove avoid calling functions of libevas from the software
engine: use the draw functions from static_libs/draw rather
than evas_common APIs.
---
 src/Makefile_Evas.am   | 16 +++--
 src/lib/evas/common/evas_font_compress.c   |  4 +-
 src/lib/evas/filters/evas_filter.c | 78 +-
 src/lib/evas/filters/evas_filter_mask.c| 12 ++--
 src/lib/evas/filters/evas_filter_private.h | 13 +++-
 src/lib/evas/filters/evas_filter_transform.c   |  4 +-
 src/lib/evas/include/evas_filter.h |  1 -
 src/lib/evas/include/evas_private.h|  6 ++
 .../evas/engines/software_generic/evas_engine.c| 47 -
 .../engines/software_generic/evas_engine_filter.h  |  8 +++
 .../software_generic}/filters/evas_filter_blend.c  | 50 ++
 src/static_libs/draw/draw.h|  9 +--
 src/static_libs/draw/draw_alpha_main.c |  8 +--
 src/static_libs/draw/draw_main.c   | 12 ++--
 14 files changed, 176 insertions(+), 92 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index a1f3789..bb037ff 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -592,7 +592,6 @@ lib/evas/common/evas_op_sub/op_sub_pixel_mask_i386.c
 lib_evas_libevas_la_SOURCES += \
 lib/evas/canvas/evas_filter_mixin.c \
 lib/evas/filters/evas_filter.c \
-lib/evas/filters/evas_filter_blend.c \
 lib/evas/filters/evas_filter_blur.c \
 lib/evas/filters/evas_filter_bump.c \
 lib/evas/filters/evas_filter_curve.c \
@@ -616,6 +615,10 @@ lib/evas/filters/blur/blur_box_rgba_i386.c \
 lib/evas/filters/blur/blur_box_rgba_sse3.c \
 lib/evas/filters/blur/blur_box_rgba_neon.c
 
+GFX_FILTER_SW_FILES = \
+modules/evas/engines/software_generic/evas_engine_filter.h \
+modules/evas/engines/software_generic/filters/evas_filter_blend.c \
+$(NULL)
 
 ### Engine Ector stuff
 
@@ -641,9 +644,11 @@ 
modules/evas/engines/software_generic/Evas_Engine_Software_Shared.h \
 modules/evas/engines/software_generic/evas_native_tbm.c \
 modules/evas/engines/software_generic/evas_native_dmabuf.c \
 modules/evas/engines/software_generic/evas_ector_software_buffer.c \
-modules/evas/engines/software_generic/evas_native_common.h
+modules/evas/engines/software_generic/evas_native_common.h \
+$(GFX_FILTER_SW_FILES)
 lib_evas_libevas_la_LIBADD +=
-lib_evas_libevas_la_CPPFLAGS += -I$(top_srcdir)/src/lib/ector
+lib_evas_libevas_la_CPPFLAGS += -I$(top_srcdir)/src/lib/ector \
+-I$(top_srcdir)/src/lib/evas/filters
 else
 enginesoftwaregenericpkgdir = 
$(libdir)/evas/modules/engines/software_generic/$(MODULE_ARCH)
 enginesoftwaregenericpkg_LTLIBRARIES = 
modules/evas/engines/software_generic/module.la
@@ -660,10 +665,13 @@ 
modules/evas/engines/software_generic/Evas_Engine_Software_Shared.h \
 modules/evas/engines/software_generic/evas_native_tbm.c \
 modules/evas/engines/software_generic/evas_native_dmabuf.c \
 modules/evas/engines/software_generic/evas_ector_software_buffer.c \
-modules/evas/engines/software_generic/evas_native_common.h
+modules/evas/engines/software_generic/evas_native_common.h \
+$(GFX_FILTER_SW_FILES)
+
 modules_evas_engines_software_generic_module_la_CPPFLAGS = 
-I$(top_builddir)/src/lib/efl \
 -I$(top_srcdir)/src/lib/evas/include \
 -I$(top_srcdir)/src/lib/evas/cserve2 \
+-I$(top_srcdir)/src/lib/evas/filters \
 -I$(top_builddir)/src/modules/evas/engines/software_generic \
 @EVAS_CFLAGS@
 modules_evas_engines_software_generic_module_la_LIBADD = @USE_EVAS_LIBS@
diff --git a/src/lib/evas/common/evas_font_compress.c 
b/src/lib/evas/common/evas_font_compress.c
index e923e17..3a0e90c 100644
--- a/src/lib/evas/common/evas_font_compress.c
+++ b/src/lib/evas/common/evas_font_compress.c
@@ -508,8 +508,8 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg,
 // FIXME: Font draw not optimized for Alpha targets! SLOW!
 // This is not pretty :)
 
-Alpha_Gfx_Func func;
 DATA8 *src8, *dst8;
+Draw_Func_Alpha func;
 int row;
 
 if (EINA_UNLIKELY(x < 0))
@@ -534,7 +534,7 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg,
   {
  DATA8 *d = dst8 + ((row - y1) * dst_pitch);
  DATA8 *s = src8 + (row * w) + x1;
- func(s, d, x2 - x1);
+ func(d, s, x2 - x1);
   }
 free(src8);
  }
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 9438a4e..5ff5a7b 100644
--- 

[EGIT] [core/efl] master 06/53: evas filters: Move bump to software generic (6/8)

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1b95d22c2c48f5ba23268dd917fa75524102ef7a

commit 1b95d22c2c48f5ba23268dd917fa75524102ef7a
Author: Jean-Philippe Andre 
Date:   Tue Jan 17 21:00:36 2017 +0900

evas filters: Move bump to software generic (6/8)
---
 src/Makefile_Evas.am| 2 +-
 src/lib/evas/filters/evas_filter.c  | 3 ---
 src/modules/evas/engines/software_generic/evas_engine.c | 1 +
 .../evas/engines/software_generic/filters/evas_engine_filter.h  | 1 +
 .../evas/engines/software_generic}/filters/evas_filter_bump.c   | 6 ++
 5 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index c1bb961..713a28e 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -593,7 +593,6 @@ lib_evas_libevas_la_SOURCES += \
 lib/evas/canvas/evas_filter_mixin.c \
 lib/evas/filters/evas_filter.c \
 lib/evas/filters/evas_filter_blur.c \
-lib/evas/filters/evas_filter_bump.c \
 lib/evas/filters/evas_filter_parser.c \
 lib/evas/filters/evas_filter_transform.c \
 lib/evas/filters/evas_filter_utils.c \
@@ -614,6 +613,7 @@ lib/evas/filters/blur/blur_box_rgba_neon.c
 GFX_FILTER_SW_FILES = \
 modules/evas/engines/software_generic/filters/evas_engine_filter.h \
 modules/evas/engines/software_generic/filters/evas_filter_blend.c \
+modules/evas/engines/software_generic/filters/evas_filter_bump.c \
 modules/evas/engines/software_generic/filters/evas_filter_curve.c \
 modules/evas/engines/software_generic/filters/evas_filter_displace.c \
 modules/evas/engines/software_generic/filters/evas_filter_fill.c \
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 97e06d1..895ca4e 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -1541,9 +1541,6 @@ _filter_command_run(Evas_Filter_Command *cmd)
case EVAS_FILTER_MODE_BLUR:
  func = evas_filter_blur_cpu_func_get(cmd);
  break;
-   case EVAS_FILTER_MODE_BUMP:
- func = evas_filter_bump_map_cpu_func_get(cmd);
- break;
case EVAS_FILTER_MODE_TRANSFORM:
  func = evas_filter_transform_cpu_func_get(cmd);
  break;
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c 
b/src/modules/evas/engines/software_generic/evas_engine.c
index f7fddb8..ff89abd 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -4628,6 +4628,7 @@ _gfx_filter_func_get(Evas_Filter_Command *cmd)
switch (cmd->mode)
  {
   case EVAS_FILTER_MODE_BLEND: func = eng_filter_blend_func_get(cmd); 
break;
+  case EVAS_FILTER_MODE_BUMP: func = eng_filter_bump_func_get(cmd); break;
   case EVAS_FILTER_MODE_CURVE: func = eng_filter_curve_func_get(cmd); 
break;
   case EVAS_FILTER_MODE_DISPLACE: func = 
eng_filter_displace_func_get(cmd); break;
   case EVAS_FILTER_MODE_FILL: func = eng_filter_fill_func_get(cmd); break;
diff --git 
a/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h 
b/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
index ee26a0f..31a326c 100644
--- a/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
+++ b/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
@@ -5,6 +5,7 @@
 #include "draw.h"
 
 Evas_Filter_Apply_Func eng_filter_blend_func_get(Evas_Filter_Command *cmd);
+Evas_Filter_Apply_Func eng_filter_bump_func_get(Evas_Filter_Command *cmd);
 Evas_Filter_Apply_Func eng_filter_curve_func_get(Evas_Filter_Command *cmd);
 Evas_Filter_Apply_Func eng_filter_displace_func_get(Evas_Filter_Command *cmd);
 Evas_Filter_Apply_Func eng_filter_fill_func_get(Evas_Filter_Command *cmd);
diff --git a/src/lib/evas/filters/evas_filter_bump.c 
b/src/modules/evas/engines/software_generic/filters/evas_filter_bump.c
similarity index 99%
rename from src/lib/evas/filters/evas_filter_bump.c
rename to src/modules/evas/engines/software_generic/filters/evas_filter_bump.c
index c7f12cb..3b33c20 100644
--- a/src/lib/evas/filters/evas_filter_bump.c
+++ b/src/modules/evas/engines/software_generic/filters/evas_filter_bump.c
@@ -1,8 +1,6 @@
 /* Simple bump map algorithms for the software engine */
 
-#include "evas_filter_private.h"
-#include "evas_blend_private.h"
-
+#include "evas_engine_filter.h"
 #include 
 
 #ifdef CLAMP
@@ -16,7 +14,7 @@ static Eina_Bool 
_bump_map_cpu_alpha_alpha(Evas_Filter_Command *cmd);
 static Eina_Bool _bump_map_cpu_alpha_rgba(Evas_Filter_Command *cmd);
 
 Evas_Filter_Apply_Func
-evas_filter_bump_map_cpu_func_get(Evas_Filter_Command *cmd)
+eng_filter_bump_func_get(Evas_Filter_Command *cmd)
 {
int w, h;
 

-- 




[EGIT] [core/efl] master 46/53: evas filters: Fix maps with filtered snapshots

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4cbff5f0ea011e93a7b2ea6db202dbd8ddf700c8

commit 4cbff5f0ea011e93a7b2ea6db202dbd8ddf700c8
Author: Jean-Philippe Andre 
Date:   Tue Apr 4 14:28:29 2017 +0900

evas filters: Fix maps with filtered snapshots

Another wonder of evas render... maps, clips, snapshots, filters...
This fixes animations with windows that have a snapshot decoration.
---
 src/bin/elementary/test_evas_snapshot.c | 69 +
 src/lib/evas/canvas/evas_filter_mixin.c | 33 +++---
 src/lib/evas/canvas/evas_object_image.c | 20 +++--
 src/lib/evas/canvas/evas_object_textblock.c |  2 +-
 src/lib/evas/canvas/evas_render.c   | 10 -
 src/lib/evas/filters/evas_filter.c  | 29 +---
 src/lib/evas/filters/evas_filter_private.h  |  1 +
 src/lib/evas/include/evas_filter.h  |  2 +-
 8 files changed, 136 insertions(+), 30 deletions(-)

diff --git a/src/bin/elementary/test_evas_snapshot.c 
b/src/bin/elementary/test_evas_snapshot.c
index 845c95c..75ca1ce 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -25,6 +25,24 @@ static const char *filter =
   "print ('Evaluating filter: ' .. input.width .. 'x' .. input.height)"
   ;
 
+static inline void
+_efl_key_int_set(Eo *obj, const char *key, int val)
+{
+   Eina_Value *v = eina_value_new(EINA_VALUE_TYPE_INT);
+   eina_value_set(v, val);
+   efl_key_value_set(obj, key, v);
+}
+
+static inline int
+_efl_key_int_get(Eo *obj, const char *key)
+{
+   Eina_Value *v = efl_key_value_get(obj, key);
+   int val;
+
+   if (!eina_value_get(v, )) return 0;
+   return val;
+}
+
 static inline Eo *
 _image_create(Eo *win, const char *path)
 {
@@ -102,6 +120,49 @@ _close(void *data, const Efl_Event *ev EINA_UNUSED)
efl_del(win);
 }
 
+static void
+_map_do(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+   Eo *snap = data;
+   int x, y, w, h;
+
+   // Prevent recursive infinite loop :(
+   static int here = 0;
+   if (here) return;
+   here = 1;
+
+   efl_gfx_map_populate(snap, 0);
+   efl_gfx_geometry_get(snap, , , , );
+   efl_gfx_map_zoom(snap, 0.8, 0.8, x + w/2., y + h/2.);
+   efl_gfx_map_rotate(snap, 45., x + w/2., y + h/2.);
+   efl_gfx_map_enable_set(snap, EINA_TRUE);
+
+   here = 0;
+}
+
+static void
+_toggle_map(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+   Eo *win = data;
+   Eo *snap;
+
+   snap = efl_key_wref_get(win, "snap");
+   if (!_efl_key_int_get(snap, "map"))
+ {
+_efl_key_int_set(snap, "map", 1);
+_map_do(snap, NULL);
+efl_event_callback_add(snap, EFL_GFX_EVENT_RESIZE, _map_do, snap);
+efl_event_callback_add(snap, EFL_GFX_EVENT_MOVE, _map_do, snap);
+ }
+   else
+ {
+_efl_key_int_set(snap, "map", 0);
+efl_event_callback_del(snap, EFL_GFX_EVENT_RESIZE, _map_do, snap);
+efl_event_callback_del(snap, EFL_GFX_EVENT_MOVE, _map_do, snap);
+efl_gfx_map_enable_set(snap, EINA_FALSE);
+ }
+}
+
 void
 test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_UNUSED)
 {
@@ -192,6 +253,14 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object 
*obj EINA_UNUSED, void *e
efl_gfx_visible_set(efl_added, 1));
 
efl_add(ELM_BUTTON_CLASS, win,
+   efl_text_set(efl_added, "Map"),
+   efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
+   efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
+   efl_pack(box, efl_added),
+   efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, 
_toggle_map, win),
+   efl_gfx_visible_set(efl_added, 1));
+
+   efl_add(ELM_BUTTON_CLASS, win,
efl_text_set(efl_added, "Close"),
efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index 1ac5e1c..d9ada4f 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -266,6 +266,7 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 Eina_Bool ok;
 void *previous = pd->data->output;
 Evas_Object_Filter_Data *fcow;
+Eina_Bool use_map = EINA_FALSE;
 Evas_Filter_Padding pad;
 
 W = obj->cur->geometry.w;
@@ -288,6 +289,15 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 else
   ENFN->context_multiplier_unset(output, context);
 
+if (obj->map->cur.usemap && obj->map->cur.map && 
(obj->map->cur.map->count >= 4))
+  {
+ int iw, ih;
+
+ use_map = EINA_TRUE;
+ ENFN->image_size_get(ENDT, previous, , );
+ evas_object_map_update(eo_obj, x, y, iw, ih, iw, ih);
+  }
+
 if (!pd->data->chain)
 

[EGIT] [core/efl] master 21/53: elm_test: Add obscuring rectangle in snapshot test

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1639c06118dadf3ee1027719ff0aea362c22caf6

commit 1639c06118dadf3ee1027719ff0aea362c22caf6
Author: Jean-Philippe Andre 
Date:   Wed Mar 15 16:37:31 2017 +0900

elm_test: Add obscuring rectangle in snapshot test

This will test the obscured region optimization for the
filters.
---
 src/bin/elementary/test_evas_snapshot.c | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/bin/elementary/test_evas_snapshot.c 
b/src/bin/elementary/test_evas_snapshot.c
index 8389b61..26d76b4 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -47,7 +47,7 @@ _anim_toggle(void *data, const Efl_Event *ev EINA_UNUSED)
it = efl_content_iterate(grid);
EINA_ITERATOR_FOREACH(it, o)
  {
-if (efl_player_playable_get(o))
+if (efl_isa(o, EFL_PLAYER_INTERFACE) && efl_player_playable_get(o))
   efl_player_play_set(o, !efl_player_play_get(o));
  }
eina_iterator_free(it);
@@ -87,9 +87,8 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *e
   path = eina_slstr_printf("%s/images/%s", elm_app_data_dir_get(), 
images[id]);
   o = _image_create(win, path);
   efl_pack_grid(grid, o, r, c, 1, 1);
-  if (efl_player_playable_get(o))
-efl_player_play_set(o, 1);
}
+   _anim_toggle(win, NULL);
 
// Snapshot
snap = efl_add(EFL_CANVAS_SNAPSHOT_CLASS, win,
@@ -101,6 +100,14 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object 
*obj EINA_UNUSED, void *e
 
 
// Objects above snapshot
+   // 1. Opaque rect, not changing
+   o = evas_object_rectangle_add(win);
+   evas_object_color_set(o, 32, 32, 96, 255);
+   evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   efl_pack_grid(grid, o, 2, GRID_SIZE / 2, GRID_SIZE - 4, GRID_SIZE / 2 - 2);
+   evas_object_show(o);
+
+   // 2. Non-opaque animated object
o = elm_progressbar_add(win);
elm_object_style_set(o, "wheel");
evas_object_size_hint_weight_set(o, 0.0, 0.0);

-- 




[EGIT] [core/efl] master 13/53: evas filters: Implement mask filter in pure GL

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3d2f1a3d9b04d4067ebe6008d2662c46ec694d7b

commit 3d2f1a3d9b04d4067ebe6008d2662c46ec694d7b
Author: Jean-Philippe Andre 
Date:   Tue Jan 24 14:23:03 2017 +0900

evas filters: Implement mask filter in pure GL

This reuses the existing mask infrastructure, but adds a color
flag to use the whole RGBA range, rather than just the Alpha
channel.

Filters are still very slow (glReadPixels and non-optimized use of
GL buffers...), but this is progress :)
---
 src/Makefile_Evas.am   |   1 +
 src/lib/evas/canvas/evas_render.c  |   2 +-
 src/lib/evas/include/evas_common_private.h |   1 +
 src/lib/evas/include/evas_private.h|   2 +-
 .../evas/engines/gl_common/evas_gl_common.h|  37 ---
 .../evas/engines/gl_common/evas_gl_context.c   |  49 +
 src/modules/evas/engines/gl_common/evas_gl_font.c  |  12 ++-
 src/modules/evas/engines/gl_common/evas_gl_image.c | 117 ++---
 src/modules/evas/engines/gl_common/evas_gl_line.c  |   4 +-
 .../evas/engines/gl_common/evas_gl_polygon.c   |   8 +-
 .../evas/engines/gl_common/evas_gl_rectangle.c |  10 +-
 .../evas/engines/gl_common/evas_gl_shader.c|  38 ---
 .../engines/gl_common/shader/evas_gl_shaders.x |  25 -
 .../evas/engines/gl_common/shader/fragment.glsl|  25 -
 .../evas/engines/gl_generic/evas_ector_gl_buffer.c |  24 ++---
 .../gl_generic/evas_ector_gl_image_buffer.c|  30 +-
 src/modules/evas/engines/gl_generic/evas_engine.c  |  83 +--
 .../engines/gl_generic/filters/gl_engine_filter.h  |  14 +--
 .../engines/gl_generic/filters/gl_filter_blend.c   |  13 +--
 .../engines/gl_generic/filters/gl_filter_mask.c|  83 +++
 20 files changed, 391 insertions(+), 187 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 83557df..aa2da76 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -844,6 +844,7 @@ modules/evas/engines/gl_generic/evas_ector_gl_buffer.c \
 modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c \
 modules/evas/engines/gl_generic/filters/gl_engine_filter.h \
 modules/evas/engines/gl_generic/filters/gl_filter_blend.c \
+modules/evas/engines/gl_generic/filters/gl_filter_mask.c \
 $(NULL)
 
 evas_gl_generic_eolian_files = \
diff --git a/src/lib/evas/canvas/evas_render.c 
b/src/lib/evas/canvas/evas_render.c
index a348f6e..5de9847 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -2470,7 +2470,7 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
Eina_Bool smooth = 
evas_object_image_smooth_scale_get(mask->object);
void *original = mask->func->engine_data_get(mask->object);
void *scaled = ENFN->image_scaled_update
- (ENDT, mdata->surface, original, w, h, smooth, EINA_TRUE, 
EVAS_COLORSPACE_GRY8);
+ (ENDT, mdata->surface, original, w, h, smooth, 
EVAS_COLORSPACE_GRY8);
if (scaled)
  {
 done = EINA_TRUE;
diff --git a/src/lib/evas/include/evas_common_private.h 
b/src/lib/evas/include/evas_common_private.h
index a3558f6..829c510 100644
--- a/src/lib/evas/include/evas_common_private.h
+++ b/src/lib/evas/include/evas_common_private.h
@@ -766,6 +766,7 @@ struct _RGBA_Draw_Context
   intmask_x, mask_y;
   Eina_Bool use : 1;
   Eina_Bool async : 1;
+  Eina_Bool mask_color : 1; // true if masking with color (eg. filters)
} clip;
struct {
 #ifdef HAVE_PIXMAN
diff --git a/src/lib/evas/include/evas_private.h 
b/src/lib/evas/include/evas_private.h
index 98c68a0..f3d74d2 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1491,7 +1491,7 @@ struct _Evas_Func
Eina_Bool (*image_map_draw)  (void *data, void *context, 
void *surface, void *image, RGBA_Map *m, int smooth, int level, Eina_Bool 
do_async);
void *(*image_map_surface_new)  (void *data, int w, int h, int 
alpha);
void (*image_map_clean) (void *data, RGBA_Map *m);
-   void *(*image_scaled_update)(void *data, void *scaled, void 
*image, int dst_w, int dst_h, Eina_Bool smooth, Eina_Bool alpha, 
Evas_Colorspace cspace);
+   void *(*image_scaled_update)(void *data, void *scaled, void 
*image, int dst_w, int dst_h, Eina_Bool smooth, Evas_Colorspace cspace);
 
void (*image_content_hint_set)  (void *data, void *surface, int 
hint);
int  (*image_content_hint_get)  (void *data, void *surface);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h 
b/src/modules/evas/engines/gl_common/evas_gl_common.h
index 74d456e..537361c 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ 

[EGIT] [core/efl] master 49/53: evas filters: Cleanup unused buffers

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=30ac3156313d642976ebfc4e52ebb63dd02d8595

commit 30ac3156313d642976ebfc4e52ebb63dd02d8595
Author: Jean-Philippe Andre 
Date:   Wed Apr 5 19:19:36 2017 +0900

evas filters: Cleanup unused buffers

This might not be used as over two consecutive runs all the
same buffers should be used. But it could happen if some
parameters in the filter change (eg. blur radius).

Fixes major (GPU) memory leaks. Reuse mode is still leaking.
---
 src/lib/evas/canvas/evas_filter_mixin.c| 31 --
 src/lib/evas/canvas/evas_object_textblock.c|  1 +
 src/lib/evas/filters/evas_filter.c | 71 +++---
 src/lib/evas/filters/evas_filter_parser.c  |  2 +
 src/lib/evas/filters/evas_filter_private.h |  2 +
 src/lib/evas/include/evas_filter.h |  1 -
 .../evas/engines/gl_generic/evas_ector_gl_buffer.c |  2 +-
 .../gl_generic/evas_ector_gl_image_buffer.c|  2 +-
 8 files changed, 70 insertions(+), 42 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index 31a7628..742a9e8 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -65,7 +65,12 @@ struct _Evas_Filter_Post_Render_Data
Eina_Bool success;
 };
 
-static const Evas_Object_Filter_Data evas_filter_data_cow_default = {};
+// FIXME: This should be enabled (with proper heuristics)
+#define FILTER_CONTEXT_REUSE EINA_FALSE
+
+static const Evas_Object_Filter_Data evas_filter_data_cow_default = {
+   .reuse = FILTER_CONTEXT_REUSE
+};
 Eina_Cow *evas_object_filter_cow = NULL;
 
 void
@@ -100,6 +105,7 @@ _filter_end_sync(Evas_Filter_Context *ctx, 
Evas_Object_Protected_Data *obj,
Eina_Bool destroy = !pd->data->reuse;
Evas_Object_Filter_Data *fcow;
Eo *eo_obj = obj->object;
+   void *output = NULL;
 
if (!success)
  {
@@ -110,36 +116,25 @@ _filter_end_sync(Evas_Filter_Context *ctx, 
Evas_Object_Protected_Data *obj,
  }
else
  {
-void *output = evas_filter_buffer_backing_get(ctx, 
EVAS_FILTER_BUFFER_OUTPUT_ID, EINA_FALSE);
-
-fcow = FCOW_BEGIN(pd);
-fcow->output = output;
-FCOW_END(fcow, pd);
+output = evas_filter_buffer_backing_get(ctx, 
EVAS_FILTER_BUFFER_OUTPUT_ID, EINA_FALSE);
+FCOW_WRITE(pd, output, output);
  }
 
if (EINA_UNLIKELY(ctx != pd->data->context))
  {
 ERR("Filter context has changed! Destroying it now...");
-fcow = FCOW_BEGIN(pd);
-evas_filter_context_destroy(fcow->context);
-fcow->context = NULL;
-FCOW_END(fcow, pd);
+evas_filter_context_destroy(pd->data->context);
 destroy = EINA_TRUE;
  }
 
+   evas_filter_buffer_backing_release(ctx, previous);
if (destroy)
  {
-evas_filter_buffer_backing_release(ctx, previous);
 evas_filter_context_destroy(ctx);
 ctx = NULL;
  }
 
-   if (pd->data->context != ctx)
- {
-fcow = FCOW_BEGIN(pd);
-fcow->context = ctx;
-FCOW_END(fcow, pd);
- }
+   FCOW_WRITE(pd, context, ctx);
 }
 
 static void
@@ -401,7 +396,7 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 
 if (filter)
   {
- ok = evas_filter_context_program_reuse(filter, pd->data->chain, 
X, Y);
+ ok = evas_filter_context_program_use(filter, pd->data->chain, 
EINA_TRUE, X, Y);
  if (!ok)
{
   fcow = FCOW_BEGIN(pd);
diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index abf076c..2e93b11 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -13002,6 +13002,7 @@ _filter_sync_end(Evas_Filter_Context *ctx, Eina_Bool 
success)
 
if (filter->ti)
  {
+// FIXME: LEAK HERE!
 filter->output = evas_filter_buffer_backing_get(ctx, 
EVAS_FILTER_BUFFER_OUTPUT_ID, EINA_FALSE);
 if (filter->ti->parent.format->gfx_filter)
   filter->ti->parent.format->gfx_filter->invalid = !success;
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 419c662..988fbe5 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -155,8 +155,12 @@ evas_filter_context_proxy_render_all(Evas_Filter_Context 
*ctx, Eo *eo_obj,
void *old_surface;
 
old_surface = evas_ector_buffer_drawable_image_get(fb->buffer);
-   if (old_surface && (old_surface != proxy_surface))
- _filter_buffer_backing_free(fb);
+   if (old_surface)
+ {
+evas_ector_buffer_engine_image_release(fb->buffer, 
old_surface);
+if (old_surface && (old_surface != 

[EGIT] [core/efl] master 50/53: evas filters: Fix async RW rendering

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3c92b32c13b11c492f9b0b6d2c60660b8add3468

commit 3c92b32c13b11c492f9b0b6d2c60660b8add3468
Author: Jean-Philippe Andre 
Date:   Thu Apr 13 12:08:31 2017 +0900

evas filters: Fix async RW rendering

This fixes a crash (when deleting the output image), and rearranges
the code a bit.
---
 src/lib/evas/canvas/evas_filter_mixin.c| 389 ++---
 src/lib/evas/canvas/evas_object_image.c|   3 +-
 src/lib/evas/filters/evas_filter.c |  46 ++--
 src/lib/evas/filters/evas_filter_private.h |   7 +-
 src/lib/evas/include/evas_filter.h |   5 +-
 5 files changed, 207 insertions(+), 243 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index 742a9e8..ee38291 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -120,14 +120,9 @@ _filter_end_sync(Evas_Filter_Context *ctx, 
Evas_Object_Protected_Data *obj,
 FCOW_WRITE(pd, output, output);
  }
 
-   if (EINA_UNLIKELY(ctx != pd->data->context))
- {
-ERR("Filter context has changed! Destroying it now...");
-evas_filter_context_destroy(pd->data->context);
-destroy = EINA_TRUE;
- }
+   if (previous)
+ ENFN->image_free(ENDT, previous);
 
-   evas_filter_buffer_backing_release(ctx, previous);
if (destroy)
  {
 evas_filter_context_destroy(ctx);
@@ -143,7 +138,7 @@ _filter_async_post_render_cb(void *data)
Evas_Filter_Post_Render_Data *task = data;
Evas_Filter_Data *pd = task->pd;
 
-#ifdef DEBUG
+#ifdef FILTERS_DEBUG
EINA_SAFETY_ON_FALSE_RETURN(eina_main_loop_is());
 #endif
 
@@ -158,12 +153,8 @@ _filter_cb(Evas_Filter_Context *ctx, void *data, Eina_Bool 
success)
Evas_Object_Protected_Data *obj;
Evas_Filter_Data *pd = data;
 
-#ifdef DEBUG
-   EINA_SAFETY_ON_FALSE_RETURN(!eina_main_loop_is());
-#endif
-
obj = pd->data->obj;
-   EINA_SAFETY_ON_FALSE_RETURN(obj && obj->layer && obj->layer->evas);
+   EVAS_OBJECT_DATA_VALID_CHECK(obj);
 
if (!pd->data->async)
  {
@@ -171,6 +162,10 @@ _filter_cb(Evas_Filter_Context *ctx, void *data, Eina_Bool 
success)
 return;
  }
 
+#ifdef FILTERS_DEBUG
+   EINA_SAFETY_ON_FALSE_RETURN(!eina_main_loop_is());
+#endif
+
post_data = calloc(1, sizeof(*post_data));
post_data->success = success;
post_data->ctx = ctx;
@@ -252,234 +247,220 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
   int x, int y, Eina_Bool do_async, Eina_Bool alpha)
 {
Evas_Filter_Data *pd = efl_data_scope_get(eo_obj, MY_CLASS);
+   int X, Y, W, H;
+   Evas_Filter_Context *filter;
+   void *drawctx;
+   Eina_Bool ok;
+   void *previous = pd->data->output;
+   Evas_Object_Filter_Data *fcow;
+   Eina_Bool use_map = EINA_FALSE;
+   Evas_Filter_Padding pad;
 
-   if (!pd->data->invalid && (pd->data->chain || pd->data->code))
- {
-int X, Y, W, H;
-Evas_Filter_Context *filter;
-void *drawctx;
-Eina_Bool ok;
-void *previous = pd->data->output;
-Evas_Object_Filter_Data *fcow;
-Eina_Bool use_map = EINA_FALSE;
-Evas_Filter_Padding pad;
-
-W = obj->cur->geometry.w;
-H = obj->cur->geometry.h;
-X = obj->cur->geometry.x;
-Y = obj->cur->geometry.y;
-
-// Prepare color multiplier
-ENFN->context_color_set(output, context,
-obj->cur->cache.clip.r,
-obj->cur->cache.clip.g,
-obj->cur->cache.clip.b,
-obj->cur->cache.clip.a);
-if (obj->cur->clipper)
-  ENFN->context_multiplier_set(output, context,
-   obj->cur->clipper->cur->cache.clip.r,
-   obj->cur->clipper->cur->cache.clip.g,
-   obj->cur->clipper->cur->cache.clip.b,
-   obj->cur->clipper->cur->cache.clip.a);
-else
-  ENFN->context_multiplier_unset(output, context);
+   if (pd->data->invalid || (!pd->data->chain && !pd->data->code))
+ return EINA_FALSE;
 
-if (obj->map->cur.usemap && obj->map->cur.map && 
(obj->map->cur.map->count >= 4))
-  {
- int iw, ih;
+   W = obj->cur->geometry.w;
+   H = obj->cur->geometry.h;
+   X = obj->cur->geometry.x;
+   Y = obj->cur->geometry.y;
+
+   // Prepare color multiplier
+   ENFN->context_color_set(output, context,
+   obj->cur->cache.clip.r,
+   obj->cur->cache.clip.g,
+   obj->cur->cache.clip.b,
+   obj->cur->cache.clip.a);
+   if (obj->cur->clipper)
+ ENFN->context_multiplier_set(output, context,
+

[EGIT] [core/efl] master 52/53: makefile: Fix make dist (with filters)

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2497480330a63a5b39e6afedbc6b4ebad44858f0

commit 2497480330a63a5b39e6afedbc6b4ebad44858f0
Author: Jean-Philippe Andre 
Date:   Fri Apr 14 12:04:27 2017 +0900

makefile: Fix make dist (with filters)
---
 src/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/Makefile.am b/src/Makefile.am
index e9c4eb6..3231cd9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -177,6 +177,7 @@ dist-hook:
@mkdir -p $(distdir)/lib/evas/common/evas_op_sub 
$(distdir)/lib/evas/filters/blur
@mkdir -p $(distdir)/static_libs/http-parser/contrib 
$(distdir)/bindings/luajit/eina
@mkdir -p $(distdir)/wayland_protocol
+   @mkdir -p $(distdir)/modules/evas/engines/software_generic/filters/blur
for F in $(EXTRA_DIST2); do cp -f $(srcdir)/$$F $(distdir)/$$F; done
 
 clean-local:

-- 




[EGIT] [core/efl] master 08/53: evas filters: Move blur to software generic (8/8)

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a8d283567a21b2716cdc0b888a49bda46abfb95c

commit a8d283567a21b2716cdc0b888a49bda46abfb95c
Author: Jean-Philippe Andre 
Date:   Tue Jan 17 21:18:46 2017 +0900

evas filters: Move blur to software generic (8/8)

This completes the series of refactoring patches, where only the
filter implementation is moved to the engine rather than inside
evas itself.
---
 src/Makefile_Evas.am   | 22 +++
 src/lib/evas/filters/evas_filter.c | 31 ++
 src/lib/evas/filters/evas_filter_private.h |  4 ---
 .../evas/engines/software_generic/evas_engine.c|  3 +--
 .../filters/blur/blur_box_alpha_.c |  2 +-
 .../filters/blur/blur_box_alpha_i386.c |  0
 .../filters/blur/blur_box_alpha_neon.c |  0
 .../filters/blur/blur_box_alpha_sse3.c |  0
 .../filters/blur/blur_box_rgba_.c  |  2 +-
 .../filters/blur/blur_box_rgba_i386.c  |  0
 .../filters/blur/blur_box_rgba_neon.c  |  0
 .../filters/blur/blur_box_rgba_sse3.c  |  0
 .../filters/blur/blur_gaussian_alpha_.c|  2 +-
 .../filters/blur/blur_gaussian_rgba_.c |  2 +-
 .../software_generic/filters/evas_engine_filter.h  |  1 +
 .../software_generic}/filters/evas_filter_blur.c   | 27 +--
 16 files changed, 32 insertions(+), 64 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 061744a..d6dcd9c 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -592,26 +592,26 @@ lib/evas/common/evas_op_sub/op_sub_pixel_mask_i386.c
 lib_evas_libevas_la_SOURCES += \
 lib/evas/canvas/evas_filter_mixin.c \
 lib/evas/filters/evas_filter.c \
-lib/evas/filters/evas_filter_blur.c \
 lib/evas/filters/evas_filter_parser.c \
 lib/evas/filters/evas_filter_utils.c \
 lib/evas/filters/evas_filter_private.h
 
 EXTRA_DIST2 += \
-lib/evas/filters/blur/blur_gaussian_alpha_.c \
-lib/evas/filters/blur/blur_gaussian_rgba_.c \
-lib/evas/filters/blur/blur_box_alpha_.c \
-lib/evas/filters/blur/blur_box_alpha_i386.c \
-lib/evas/filters/blur/blur_box_alpha_sse3.c \
-lib/evas/filters/blur/blur_box_alpha_neon.c \
-lib/evas/filters/blur/blur_box_rgba_.c \
-lib/evas/filters/blur/blur_box_rgba_i386.c \
-lib/evas/filters/blur/blur_box_rgba_sse3.c \
-lib/evas/filters/blur/blur_box_rgba_neon.c
+modules/evas/engines/software_generic/filters/blur/blur_gaussian_alpha_.c \
+modules/evas/engines/software_generic/filters/blur/blur_gaussian_rgba_.c \
+modules/evas/engines/software_generic/filters/blur/blur_box_alpha_.c \
+modules/evas/engines/software_generic/filters/blur/blur_box_alpha_i386.c \
+modules/evas/engines/software_generic/filters/blur/blur_box_alpha_sse3.c \
+modules/evas/engines/software_generic/filters/blur/blur_box_alpha_neon.c \
+modules/evas/engines/software_generic/filters/blur/blur_box_rgba_.c \
+modules/evas/engines/software_generic/filters/blur/blur_box_rgba_i386.c \
+modules/evas/engines/software_generic/filters/blur/blur_box_rgba_sse3.c \
+modules/evas/engines/software_generic/filters/blur/blur_box_rgba_neon.c
 
 GFX_FILTER_SW_FILES = \
 modules/evas/engines/software_generic/filters/evas_engine_filter.h \
 modules/evas/engines/software_generic/filters/evas_filter_blend.c \
+modules/evas/engines/software_generic/filters/evas_filter_blur.c \
 modules/evas/engines/software_generic/filters/evas_filter_bump.c \
 modules/evas/engines/software_generic/filters/evas_filter_curve.c \
 modules/evas/engines/software_generic/filters/evas_filter_displace.c \
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index f3ea207..b8b993e 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -1492,16 +1492,6 @@ _filter_name_get(int mode)
 #endif
 
 static Eina_Bool
-_engine_gfx_filter_func(Evas_Filter_Command *cmd)
-{
-   // This should be temporary porting code, when moving filter implementations
-   // from here to the engine. Ideally the filters should be in ector though.
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->ENFN->gfx_filter_process, EINA_FALSE);
-   return cmd->ENFN->gfx_filter_process(cmd->ENDT, cmd);
-}
-
-static Eina_Bool
 _filter_command_run(Evas_Filter_Command *cmd)
 {
Evas_Filter_Support support = EVAS_FILTER_SUPPORT_NONE;
@@ -1530,30 +1520,13 @@ _filter_command_run(Evas_Filter_Command *cmd)
  }
 
support = cmd->ENFN->gfx_filter_supports(cmd->ENDT, cmd);
-   if (support != EVAS_FILTER_SUPPORT_NONE)
- {
-func = &_engine_gfx_filter_func;
- }
-   else
- {
-switch (cmd->mode)
-  {
-   case EVAS_FILTER_MODE_BLUR:
- func = evas_filter_blur_cpu_func_get(cmd);
- break;
-   default:
- CRI("Invalid filter mode.");
- break;
-  }
- }
-
-   if (!func)
+   

[EGIT] [core/efl] master 31/53: evas filters: Remove warning about OpenGL

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9aa335ceccff64ed849588c001eaa98091c421be

commit 9aa335ceccff64ed849588c001eaa98091c421be
Author: Jean-Philippe Andre 
Date:   Wed Mar 22 19:18:41 2017 +0900

evas filters: Remove warning about OpenGL

Well... I'm working on making all this work, so the log
is a bit irrelevant now.
---
 src/bin/elementary/test_gfx_filters.c | 20 +++-
 src/lib/evas/filters/evas_filter.c| 12 +---
 2 files changed, 8 insertions(+), 24 deletions(-)

diff --git a/src/bin/elementary/test_gfx_filters.c 
b/src/bin/elementary/test_gfx_filters.c
index 94036c3..600e931 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -525,19 +525,13 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *eve
  efl_ui_text_scrollable_set(efl_added, 1));
   efl_event_callback_add(o, EFL_UI_TEXT_EVENT_CHANGED_USER, _code_changed, 
win);
 
-  // HACK: For now only set filter on code if engine is not GL (WIP)
-  const char *engine = ecore_evas_engine_name_get
-(ecore_evas_ecore_evas_get(evas_object_evas_get(win)));
-  if (engine && !strstr(engine, "gl"))
-{
-   // Insert filter code inside style string: DEFAULT='blah blah 
'
-   buf = eina_strbuf_new();
-   eina_strbuf_append(buf, efl_canvas_text_style_get(o, NULL));
-   eina_strbuf_insert(buf, " gfx_filter=code", 
eina_strbuf_length_get(buf) - 1);
-   efl_gfx_filter_program_set(o, code_filter, "code");
-   efl_canvas_text_style_set(o, NULL, eina_strbuf_string_get(buf));
-   eina_strbuf_free(buf);
-}
+  // Insert filter code inside style string: DEFAULT='blah blah '
+  buf = eina_strbuf_new();
+  eina_strbuf_append(buf, efl_canvas_text_style_get(o, NULL));
+  eina_strbuf_insert(buf, " gfx_filter=code", eina_strbuf_length_get(buf) 
- 1);
+  efl_gfx_filter_program_set(o, code_filter, "code");
+  efl_canvas_text_style_set(o, NULL, eina_strbuf_string_get(buf));
+  eina_strbuf_free(buf);
 
   // FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME
   // Efl.Ui.Text doesn't seem to trigger the proper events during edit
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 46442ae..3b4c7ff 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -41,7 +41,6 @@ Evas_Filter_Context *
 evas_filter_context_new(Evas_Public_Data *evas, Eina_Bool async, void 
*user_data)
 {
Evas_Filter_Context *ctx;
-   static int warned = 0;
 
EINA_SAFETY_ON_NULL_RETURN_VAL(evas, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(evas->engine.func->gfx_filter_supports, 
NULL);
@@ -54,16 +53,7 @@ evas_filter_context_new(Evas_Public_Data *evas, Eina_Bool 
async, void *user_data
ctx->async = async;
ctx->user_data = user_data;
ctx->buffer_scaled_get = _filter_buffer_scaled_get;
-
-   if (ENFN->gl_surface_read_pixels)
- {
-ctx->gl = EINA_TRUE;
-if (!warned)
-  {
- WRN("OpenGL support through SW functions, expect low 
performance!");
- warned = 1;
-  }
- }
+   ctx->gl = (ENFN->gl_surface_read_pixels != NULL);
 
return ctx;
 }

-- 




[EGIT] [core/efl] master 15/53: evas filters: Implement displace filter in pure GL

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=125c7d956ea06ccd606a9eec185132e7e29971cd

commit 125c7d956ea06ccd606a9eec185132e7e29971cd
Author: Jean-Philippe Andre 
Date:   Tue Jan 24 15:28:18 2017 +0900

evas filters: Implement displace filter in pure GL

This one was a bit more... "fun". I had to add a new vertex
attribute and obviously using a VertexAttribPointer led to
incomprehensible crashes. But a simple glVertexAttrib2fv makes
it work like a charm!

A rare option is not handled yet.
---
 src/Makefile_Evas.am   |   2 +
 src/lib/evas/filters/evas_filter.c |  10 +-
 .../evas/engines/gl_common/evas_gl_common.h|  20 ++
 .../evas/engines/gl_common/evas_gl_context.c   | 358 -
 .../evas/engines/gl_common/evas_gl_shader.c|  56 ++--
 .../engines/gl_common/shader/evas_gl_shaders.x |  61 +++-
 .../evas/engines/gl_common/shader/fragment.glsl|  52 ++-
 .../evas/engines/gl_common/shader/vertex.glsl  |  16 +
 src/modules/evas/engines/gl_generic/evas_engine.c  |   4 +-
 .../engines/gl_generic/filters/gl_engine_filter.h  |   4 +-
 .../engines/gl_generic/filters/gl_filter_curve.c   |  67 
 .../gl_generic/filters/gl_filter_displace.c|  85 +
 12 files changed, 684 insertions(+), 51 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 5bac278..b270f76 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -844,6 +844,8 @@ modules/evas/engines/gl_generic/evas_ector_gl_buffer.c \
 modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c \
 modules/evas/engines/gl_generic/filters/gl_engine_filter.h \
 modules/evas/engines/gl_generic/filters/gl_filter_blend.c \
+modules/evas/engines/gl_generic/filters/gl_filter_curve.c \
+modules/evas/engines/gl_generic/filters/gl_filter_displace.c \
 modules/evas/engines/gl_generic/filters/gl_filter_fill.c \
 modules/evas/engines/gl_generic/filters/gl_filter_mask.c \
 $(NULL)
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index f76a8a3..b343b91 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -433,6 +433,11 @@ _command_new(Evas_Filter_Context *ctx, Evas_Filter_Mode 
mode,
cmd->input = input;
cmd->mask = mask;
cmd->output = output;
+   cmd->draw.R = 255;
+   cmd->draw.G = 255;
+   cmd->draw.B = 255;
+   cmd->draw.A = 255;
+   cmd->draw.rop = EFL_GFX_RENDER_OP_BLEND;
if (output) output->dirty = EINA_TRUE;
 
ctx->commands = eina_inlist_append(ctx->commands, EINA_INLIST_GET(cmd));
@@ -1001,7 +1006,10 @@ evas_filter_command_curve_add(Evas_Filter_Context *ctx,
 
memcpy(copy, curve, 256 * sizeof(DATA8));
cmd->curve.data = copy;
-   cmd->curve.channel = channel;
+   if (cmd->input->alpha_only)
+ cmd->curve.channel = EVAS_FILTER_CHANNEL_ALPHA;
+   else
+ cmd->curve.channel = channel;
 
return cmd;
 }
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h 
b/src/modules/evas/engines/gl_common/evas_gl_common.h
index 537361c..463bd24 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -107,6 +107,10 @@ struct _Evas_GL_Program
struct {
   GLuint mvp, rotation_id;
} uniform;
+   struct {
+  GLuint loc_filter_data[3];
+  Eina_Bool known_locations;
+   } attribute;
GLuintprog;
 
Eina_Bool reset : 1;
@@ -239,6 +243,8 @@ enum _Shader_Type {
SHD_NV12_709,
SHD_RGB_A_PAIR,
SHD_MAP,
+   SHD_FILTER_DISPLACE,
+   SHD_FILTER_CURVE,
SHD_TYPE_LAST
 };
 
@@ -268,6 +274,7 @@ struct _Evas_Engine_GL_Context
  Eina_Bool   blend  : 2;
  Eina_Bool   clip   : 2;
  Eina_Bool   anti_alias : 2;
+ Eina_Bool   has_filter_data : 1;
   } current;
} state;
 
@@ -300,6 +307,11 @@ struct _Evas_Engine_GL_Context
  Eina_Boolblend   : 2;
  Eina_Boolmask_smooth : 2;
  Eina_Boolclip: 2;
+ struct {
+GLuintmap_tex;
+Eina_Bool map_nearest : 1;
+Eina_Bool map_delete  : 1;
+ } filter;
   } shader;
   struct {
  intnum, alloc;
@@ -312,6 +324,8 @@ struct _Evas_Engine_GL_Context
  GLfloat   *texsam;
  GLfloat   *mask;
  GLfloat   *masksam;
+ intfilter_data_count; // number of vec2
+ GLfloat   *filter_data;
  Evas_GL_Image *im;
  GLuint buffer;
  intbuffer_alloc;
@@ -631,6 +645,12 @@ void 
evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *g
Eina_Bool tex_only,
Evas_Colorspace cspace);
 

[EGIT] [core/efl] master 30/53: evas filters: Avoid unnecessary draw

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b77cb960caa4f5fee153331d6e7f5ebcf72b722c

commit b77cb960caa4f5fee153331d6e7f5ebcf72b722c
Author: Jean-Philippe Andre 
Date:   Wed Mar 22 16:16:22 2017 +0900

evas filters: Avoid unnecessary draw

This avoids creating one more FBO and doing one more draw,
by rendering the image input data directly into the input
buffer. This also makes the code common between SW and GL.
---
 src/lib/evas/canvas/evas_filter_mixin.c |  2 +-
 src/lib/evas/canvas/evas_object_image.c | 47 +++--
 src/lib/evas/canvas/evas_object_textblock.c |  2 +-
 src/lib/evas/filters/evas_filter.c  | 47 -
 src/lib/evas/filters/evas_filter_private.h  |  1 -
 src/lib/evas/include/evas_filter.h  |  3 +-
 6 files changed, 26 insertions(+), 76 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index ce160a8..45db424 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -54,7 +54,7 @@ _filter_end_sync(Evas_Filter_Context *ctx, 
Evas_Object_Protected_Data *obj,
else
  {
 Evas_Object_Filter_Data *fcow;
-void *output = evas_filter_buffer_backing_steal(ctx, 
EVAS_FILTER_BUFFER_OUTPUT_ID);
+void *output = evas_filter_buffer_backing_get(ctx, 
EVAS_FILTER_BUFFER_OUTPUT_ID, EINA_FALSE);
 
 fcow = FCOW_BEGIN(pd);
 fcow->output = output;
diff --git a/src/lib/evas/canvas/evas_object_image.c 
b/src/lib/evas/canvas/evas_object_image.c
index a3f7e48..46bfd33 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1754,30 +1754,22 @@ 
_efl_canvas_image_internal_efl_canvas_filter_internal_filter_state_prepare(
 
 EOLIAN static Eina_Bool
 _efl_canvas_image_internal_efl_canvas_filter_internal_filter_input_render(
-  Eo *eo_obj, Evas_Image_Data *o, void *_filter, void *context,
+  Eo *eo_obj, Evas_Image_Data *o, void *_filter, void *context EINA_UNUSED,
   void *data EINA_UNUSED, int l, int r EINA_UNUSED, int t, int b 
EINA_UNUSED,
   int x, int y, Eina_Bool do_async)
 {
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
Evas_Filter_Context *filter = _filter;
-   void *surface, *output;
-   Eina_Bool input_stolen;
+   void *surface, *output, *ctx;
int W, H;
 
W = obj->cur->geometry.w;
H = obj->cur->geometry.h;
output = ENDT;
 
-   if (ENFN->gl_surface_read_pixels)
- {
-surface = ENFN->image_map_surface_new(output, W, H, EINA_TRUE);
-input_stolen = EINA_FALSE;
- }
-   else
- {
-surface = evas_filter_buffer_backing_steal(filter, 
EVAS_FILTER_BUFFER_INPUT_ID);
-input_stolen = EINA_TRUE;
- }
+   surface = evas_filter_buffer_backing_get(filter, 
EVAS_FILTER_BUFFER_INPUT_ID, EINA_TRUE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
+
if (!o->filled)
  {
 l = 0;
@@ -1786,30 +1778,25 @@ 
_efl_canvas_image_internal_efl_canvas_filter_internal_filter_input_render(
 b = 0;
  }
 
-   if (!surface)
+   ctx = ENFN->context_new(output);
+
+   if (o->cur->has_alpha && !obj->cur->snapshot)
  {
-ERR("Failed to allocate surface for filter input!");
-return EINA_FALSE;
+ENFN->context_color_set(output, ctx, 0, 0, 0, 0);
+ENFN->context_render_op_set(output, ctx, EVAS_RENDER_COPY);
+ENFN->rectangle_draw(output, ctx, surface, 0, 0, W, H, do_async);
+ENFN->context_color_set(output, ctx, 255, 255, 255, 255);
+ENFN->context_render_op_set(output, ctx, EVAS_RENDER_BLEND);
  }
 
-   ENFN->context_color_set(output, context, 0, 0, 0, 0);
-   ENFN->context_render_op_set(output, context, EVAS_RENDER_COPY);
-   ENFN->rectangle_draw(output, context, surface, 0, 0, W, H, EINA_FALSE);
-   ENFN->context_color_set(output, context, 255, 255, 255, 255);
-   ENFN->context_render_op_set(output, context, EVAS_RENDER_BLEND);
-
-   _evas_image_render(eo_obj, obj, output, context, surface,
+   _evas_image_render(eo_obj, obj, output, ctx, surface,
   x + l - obj->cur->geometry.x,
   y + t - obj->cur->geometry.y,
   l, t, r, b, do_async);
 
-   if (!input_stolen)
- {
-evas_filter_image_draw(filter, context, EVAS_FILTER_BUFFER_INPUT_ID, 
surface, do_async);
-ENFN->image_free(output, surface);
- }
-   else
- evas_filter_buffer_backing_release(filter, surface);
+   ENFN->context_free(output, ctx);
+
+   evas_filter_buffer_backing_release(filter, surface);
 
return EINA_TRUE;
 }
diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index f021649..05166b9 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ 

[EGIT] [core/efl] master 48/53: evas filters: Adjust downscale coordinates to avoid artifacts

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=01a4ecd92c41e9159aafa59754a7be842f5ca0fb

commit 01a4ecd92c41e9159aafa59754a7be842f5ca0fb
Author: Jean-Philippe Andre 
Date:   Wed Apr 5 15:32:07 2017 +0900

evas filters: Adjust downscale coordinates to avoid artifacts

This avoids sampling artifacts when moving or resizing a
snapshot object over a region with sharp content (eg. text).
---
 src/lib/evas/canvas/evas_filter_mixin.c|  4 +-
 src/lib/evas/canvas/evas_object_textblock.c|  2 +-
 src/lib/evas/filters/evas_filter.c | 64 ++
 src/lib/evas/filters/evas_filter_parser.c  |  4 +-
 src/lib/evas/filters/evas_filter_private.h |  6 ++
 src/lib/evas/include/evas_filter.h |  4 +-
 .../engines/gl_generic/filters/gl_filter_blend.c   | 56 +++
 7 files changed, 90 insertions(+), 50 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index d9ada4f..31a7628 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -401,7 +401,7 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 
 if (filter)
   {
- ok = evas_filter_context_program_reuse(filter, pd->data->chain);
+ ok = evas_filter_context_program_reuse(filter, pd->data->chain, 
X, Y);
  if (!ok)
{
   fcow = FCOW_BEGIN(pd);
@@ -417,7 +417,7 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
  filter = evas_filter_context_new(obj->layer->evas, do_async, 0);
 
  // Run script
- ok = evas_filter_context_program_use(filter, pd->data->chain, 
EINA_FALSE);
+ ok = evas_filter_context_program_use(filter, pd->data->chain, 
EINA_FALSE, X, Y);
  if (!filter || !ok)
{
   ERR("Parsing failed?");
diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index f65624f..abf076c 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -13476,7 +13476,7 @@ evas_object_textblock_render(Evas_Object *eo_obj 
EINA_UNUSED,
 ctx = evas_filter_context_new(obj->layer->evas, do_async, 
ti->gfx_filter);
 evas_filter_state_prepare(eo_obj, , ti);
 evas_filter_program_state_set(pgm, );
-ok = evas_filter_context_program_use(ctx, pgm, EINA_FALSE);
+ok = evas_filter_context_program_use(ctx, pgm, EINA_FALSE, 0, 0);
 if (!ok)
   {
  evas_filter_context_destroy(ctx);
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 2500590..419c662 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -165,7 +165,7 @@ evas_filter_context_proxy_render_all(Evas_Filter_Context 
*ctx, Eo *eo_obj,
 }
 
 Eina_Bool
-evas_filter_context_program_reuse(Evas_Filter_Context *ctx, 
Evas_Filter_Program *pgm)
+evas_filter_context_program_reuse(Evas_Filter_Context *ctx, 
Evas_Filter_Program *pgm, int x, int y)
 {
Evas_Filter_Buffer *fb;
Eina_List *li;
@@ -196,7 +196,7 @@ evas_filter_context_program_reuse(Evas_Filter_Context *ctx, 
Evas_Filter_Program
 fb->dirty = EINA_FALSE;
  }
 
-   return evas_filter_context_program_use(ctx, pgm, EINA_TRUE);
+   return evas_filter_context_program_use(ctx, pgm, EINA_TRUE, x, y);
 }
 
 static void
@@ -691,19 +691,24 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
 int rx, int ry, int ox, int oy, int count,
 int R, int G, int B, int A)
 {
-   Evas_Filter_Command *cmd;
+   Evas_Filter_Command *cmd = NULL;
Evas_Filter_Buffer *dx_in, *dx_out, *dy_in, *dy_out, *tmp = NULL;
+   int down_x = 1, down_y = 1;
+   int pad_x = 0, pad_y = 0;
double dx, dy;
 
/* GL blur implementation:
-* - Create intermediate buffer T (variable size)
-* - Downscale to buffer T
-* - Apply X blur kernel
-* - Apply Y blur kernel while scaling up
 *
-* - TODO: Fix distortion X vs. Y
-* - TODO: Calculate best scaline and blur radius
-* - TODO: Add post-processing? (2D single-pass)
+* - Create intermediate buffer T1, T2
+* - Downscale input to buffer T1
+* - Apply X blur kernel from T1 to T2
+* - Apply Y blur kernel from T2 back to output
+*
+* In order to avoid sampling artifacts when moving or resizing a filtered
+* snapshot, we make sure that we always sample and scale based on the same
+* original pixels positions:
+* - Input pixels must be aligned to down_x,down_y boundaries
+* - T1/T2 buffer size is up to 1px larger than [input / scale_x,y]
 */
 
dx = rx;
@@ -714,34 +719,43 @@ 

[EGIT] [core/efl] master 34/53: evas: Fix excessive redraws of snapshot objects

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b6c5af5edcd268a6da5c82762faf8815d729b064

commit b6c5af5edcd268a6da5c82762faf8815d729b064
Author: Jean-Philippe Andre 
Date:   Wed Mar 22 20:51:53 2017 +0900

evas: Fix excessive redraws of snapshot objects
---
 src/lib/evas/canvas/evas_filter_mixin.c |   7 +-
 src/lib/evas/canvas/evas_render.c   | 148 +++-
 src/lib/evas/include/evas_private.h |   1 +
 3 files changed, 93 insertions(+), 63 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index fab03ba..d2c17b2 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -263,12 +263,15 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
   }
 else if (previous && !pd->data->changed)
   {
- Eina_Bool redraw = EINA_TRUE;
+ Eina_Bool redraw;
 
- if (_evas_filter_state_set_internal(pd->data->chain, pd))
+ redraw = _evas_filter_state_set_internal(pd->data->chain, pd);
+ if (redraw)
DBG("Filter redraw by state change!");
  else if (obj->changed)
DBG("Filter redraw by object content change!");
+ else if (obj->snapshot_needs_redraw)
+   DBG("Filter redraw by snapshot change!");
  else if (_evas_filter_obscured_region_changed(pd))
DBG("Filter redraw by obscure regions change!");
  else redraw = EINA_FALSE;
diff --git a/src/lib/evas/canvas/evas_render.c 
b/src/lib/evas/canvas/evas_render.c
index 61d8fd2..cd63a63 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -100,12 +100,19 @@ rend_dbg(const char *txt)
 #define ENDT evas->engine.data.output
 
 typedef struct _Render_Updates Render_Updates;
+typedef struct _Cutout_Margin  Cutout_Margin;
+
 struct _Render_Updates
 {
void *surface;
Eina_Rectangle *area;
 };
 
+struct _Cutout_Margin
+{
+   int l, r, t, b;
+};
+
 static Eina_Bool
 evas_render_updates_internal(Evas *eo_e, unsigned char make_updates, unsigned 
char do_draw, Evas_Render_Done_Cb done_func, void *done_data, Eina_Bool 
do_async);
 
@@ -2615,7 +2622,7 @@ end:
 static void
 _evas_render_cutout_add(Evas_Public_Data *evas, void *context,
 Evas_Object_Protected_Data *obj, int off_x, int off_y,
-int cutout_margin)
+Cutout_Margin *cutout_margin)
 {
Evas_Coord cox = 0, coy = 0, cow = 0, coh = 0;
 
@@ -2630,8 +2637,7 @@ _evas_render_cutout_add(Evas_Public_Data *evas, void 
*context,
   {
  Evas_Object_Protected_Data *oo;
 
- oo = obj;
- while (oo->cur->clipper)
+ for (oo = obj; oo->cur->clipper; oo = oo->cur->clipper)
{
   if ((oo->cur->clipper->map->cur.map_parent
!= oo->map->cur.map_parent) &&
@@ -2642,7 +2648,7 @@ _evas_render_cutout_add(Evas_Public_Data *evas, void 
*context,
  oo->cur->geometry.y,
  oo->cur->geometry.w,
  oo->cur->geometry.h);
-  oo = oo->cur->clipper;
+  if ((cow <= 0) || (coh <= 0)) return;
}
   }
  }
@@ -2655,12 +2661,15 @@ _evas_render_cutout_add(Evas_Public_Data *evas, void 
*context,
obj->cur->cache.clip.w, obj->cur->cache.clip.h);
  }
else return;
-   cox += cutout_margin + off_x;
-   coy += cutout_margin + off_y;
-   cow -= 2 * cutout_margin;
-   coh -= 2 * cutout_margin;
+   if (cutout_margin)
+ {
+cox += cutout_margin->l;
+coy += cutout_margin->t;
+cow -= cutout_margin->l + cutout_margin->r;
+coh -= cutout_margin->t + cutout_margin->b;
+ }
if ((cow <= 0) || (coh <= 0)) return;
-   ENFN->context_cutout_add(ENDT, context, cox, coy, cow, coh);
+   ENFN->context_cutout_add(ENDT, context, cox + off_x, coy + off_y, cow, coh);
 }
 
 void
@@ -2750,11 +2759,10 @@ _rectangle_inside(Eina_Rectangle *big, Eina_Rectangle 
*small)
return EINA_FALSE;
 }
 
-static Eina_Bool
-_snapshot_needs_redraw(Evas_Public_Data *evas, Evas_Object_Protected_Data 
*snap,
-   Eina_Rectangle *opaque)
+static void
+_snapshot_redraw_update(Evas_Public_Data *evas, Evas_Object_Protected_Data 
*snap)
 {
-   Eina_Bool above = EINA_FALSE, ret = EINA_FALSE;
+   Eina_Bool above = EINA_FALSE, add_rect = EINA_FALSE, need_redraw = 
EINA_FALSE;
const int x = snap->cur->geometry.x;
const int y = snap->cur->geometry.y;
const int w = snap->cur->geometry.w;
@@ -2762,27 +2770,35 @@ _snapshot_needs_redraw(Evas_Public_Data *evas, 
Evas_Object_Protected_Data *snap,
Evas_Object_Protected_Data *obj;

[EGIT] [core/efl] master 24/53: evas: Consider objects in copy mode as opaque

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3f6f51560a41b9c05e90366a6e9b28847e37ee8a

commit 3f6f51560a41b9c05e90366a6e9b28847e37ee8a
Author: Jean-Philippe Andre 
Date:   Fri Mar 17 14:54:40 2017 +0900

evas: Consider objects in copy mode as opaque

This skips extra tests with image objects that have the
is_opaque() function. That way, if an object is marked as COPY,
rendering of all objects below it will be skipped.

This can dramatically help with performance when flagging a
snapshot object as COPY. This should not be done if a filter is
applied and is meant to blend with the underlying UI.
---
 src/lib/evas/include/evas_inline.x | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/include/evas_inline.x 
b/src/lib/evas/include/evas_inline.x
index 979f6ef..d7aa37a 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -94,6 +94,8 @@ static inline int
 evas_object_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
 {
if (obj->is_smart || obj->no_render) return 0;
+   if (obj->cur->render_op == EVAS_RENDER_COPY)
+ return 1;
/* If clipped: Assume alpha */
if (obj->cur->cache.clip.a == 255)
  {
@@ -105,8 +107,6 @@ evas_object_is_opaque(Evas_Object *eo_obj, 
Evas_Object_Protected_Data *obj)
   return obj->func->is_opaque(eo_obj, obj, obj->private_data);
 return 1;
  }
-   if (obj->cur->render_op == EVAS_RENDER_COPY)
- return 1;
return 0;
 }
 

-- 




[EGIT] [core/efl] master 35/53: evas filters: Move private data out of evas headers

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a8b6c1cd7f067001c902967af3a652d1d4efc782

commit a8b6c1cd7f067001c902967af3a652d1d4efc782
Author: Jean-Philippe Andre 
Date:   Thu Mar 23 16:22:43 2017 +0900

evas filters: Move private data out of evas headers

This moves the filter internal data back to the filters
implementation, rather than inside evas common headers.
---
 src/lib/evas/canvas/evas_filter_mixin.c| 50 --
 src/lib/evas/canvas/evas_main.c|  2 --
 src/lib/evas/canvas/evas_object_main.c | 12 ++-
 src/lib/evas/filters/evas_filter.c |  2 ++
 src/lib/evas/filters/evas_filter_private.h |  3 ++
 src/lib/evas/include/evas_private.h| 32 ---
 6 files changed, 55 insertions(+), 46 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index d2c17b2..f3ed146 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -17,6 +17,34 @@
 typedef struct _Evas_Filter_Data Evas_Filter_Data;
 typedef struct _Evas_Filter_Post_Render_Data Evas_Filter_Post_Render_Data;
 
+struct _Evas_Object_Filter_Data
+{
+   Evas_Object_Protected_Data *obj;
+   Eina_Stringshare*name;
+   Eina_Stringshare*code;
+   Evas_Filter_Program *chain;
+   Evas_Filter_Context *context;
+   Eina_Hash   *sources; // Evas_Filter_Proxy_Binding
+   Eina_Inlist *data; // Evas_Filter_Data_Binding
+   Eina_Rectangle   prev_obscured, obscured;
+   void*output;
+   struct {
+  struct {
+ Eina_Stringshare *name;
+ doublevalue;
+  } cur;
+  struct {
+ Eina_Stringshare *name;
+ doublevalue;
+  } next;
+  double   pos;
+   } state;
+   Eina_Boolchanged : 1;
+   Eina_Boolinvalid : 1; // Code parse failed
+   Eina_Boolasync : 1;
+   Eina_Boolreuse : 1;
+};
+
 struct _Evas_Filter_Data
 {
const Evas_Object_Filter_Data *data;
@@ -29,6 +57,24 @@ struct _Evas_Filter_Post_Render_Data
Eina_Bool success;
 };
 
+static const Evas_Object_Filter_Data evas_filter_data_cow_default = {};
+Eina_Cow *evas_object_filter_cow = NULL;
+
+void
+evas_filter_mixin_init(void)
+{
+   evas_object_filter_cow = eina_cow_add
+ ("Evas Filter Data", sizeof(Evas_Object_Filter_Data), 8,
+  _filter_data_cow_default, EINA_TRUE);
+}
+
+void
+evas_filter_mixin_shutdown(void)
+{
+   eina_cow_del(evas_object_filter_cow);
+   evas_object_filter_cow = NULL;
+}
+
 static inline void
 _state_check(Evas_Object_Filter_Data *fcow)
 {
@@ -630,7 +676,7 @@ 
_efl_canvas_filter_internal_efl_gfx_filter_filter_padding_get(Eo *eo_obj EINA_UN
 EOLIAN static void
 _efl_canvas_filter_internal_filter_changed_set(Eo *eo_obj EINA_UNUSED, 
Evas_Filter_Data *pd, Eina_Bool val)
 {
-   if ((evas_object_filter_cow_default != pd->data) && (pd->data->changed != 
val))
+   if ((_filter_data_cow_default != pd->data) && (pd->data->changed != 
val))
  {
 Evas_Object_Filter_Data *fcow = FCOW_BEGIN(pd);
 fcow->changed = val;
@@ -668,7 +714,7 @@ _efl_canvas_filter_internal_efl_object_destructor(Eo 
*eo_obj, Evas_Filter_Data *
Evas_Public_Data *e;
Eina_Inlist *il;
 
-   if (!pd->data || (evas_object_filter_cow_default == pd->data))
+   if (!pd->data || (_filter_data_cow_default == pd->data))
  goto finish;
 
obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 1dac921..1323a89 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -157,9 +157,7 @@ evas_shutdown(void)
evas_object_image_state_cow = NULL;
 
evas_filter_shutdown();
-   eina_cow_del(evas_object_filter_cow);
eina_cow_del(evas_object_mask_cow);
-   evas_object_filter_cow = NULL;
evas_object_mask_cow = NULL;
 
evas_thread_shutdown();
diff --git a/src/lib/evas/canvas/evas_object_main.c 
b/src/lib/evas/canvas/evas_object_main.c
index b62ffe6..6ec47de 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -32,10 +32,6 @@ static const Evas_Object_Protected_State default_state = {
   { 255, 255, 255, 255 },
   1.0, 0, EVAS_RENDER_BLEND, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, 
EINA_FALSE
 };
-static const Evas_Object_Filter_Data default_filter = {
-  NULL, NULL, NULL, NULL, NULL, NULL, NULL, {}, {}, NULL, {}, EINA_FALSE, 
EINA_FALSE, EINA_TRUE, EINA_TRUE
-};
-const void * const evas_object_filter_cow_default = _filter;
 static const Evas_Object_Mask_Data default_mask = {
   NULL, 0, 0, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE
 };
@@ -44,36 +40,32 @@ Eina_Cow *evas_object_proxy_cow = NULL;
 Eina_Cow *evas_object_map_cow = NULL;
 Eina_Cow *evas_object_state_cow = NULL;
 Eina_Cow 

[EGIT] [core/efl] master 12/53: evas filters: Fix blur logic and GL buffer handling

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=92dfe1831cc8a5f53c65ef5b0893eb05d2476e45

commit 92dfe1831cc8a5f53c65ef5b0893eb05d2476e45
Author: Jean-Philippe Andre 
Date:   Mon Jan 23 17:55:17 2017 +0900

evas filters: Fix blur logic and GL buffer handling

This corrects two things:
- the blur filter high-level logic, that lead to reusing some
  temporary buffers which contained garbage;
- the versatile gl buffer implementation so that it now properly
  switches between the RGBA_Image and the FBO content (yes, this
  is insanely slow and inefficient... but it works and that was
  the only point).
---
 src/lib/evas/filters/evas_filter.c | 263 -
 src/lib/evas/filters/evas_filter_parser.c  |   4 +
 src/lib/evas/filters/evas_filter_private.h |   2 +-
 src/lib/evas/filters/evas_filter_utils.c   |   2 +-
 src/lib/evas/include/evas_ector_buffer.eo  |   6 -
 src/lib/evas/include/evas_filter.h |   1 +
 .../evas/engines/gl_common/evas_gl_common.h|   1 +
 src/modules/evas/engines/gl_common/evas_gl_image.c |  11 +
 .../evas/engines/gl_generic/evas_ector_gl_buffer.c |  86 ---
 .../gl_generic/evas_ector_gl_image_buffer.c|   3 +-
 src/modules/evas/engines/gl_generic/evas_engine.c  |   2 +-
 .../engines/gl_generic/filters/gl_engine_filter.h  |  13 +
 .../engines/gl_generic/filters/gl_filter_blend.c   | 171 +-
 .../software_generic/evas_ector_software_buffer.c  |   6 +-
 .../filters/evas_filter_displace.c |   2 +-
 .../software_generic/filters/evas_filter_mask.c|   3 -
 16 files changed, 398 insertions(+), 178 deletions(-)

diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 98a1cb8..f76a8a3 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -341,7 +341,6 @@ evas_filter_buffer_empty_new(Evas_Filter_Context *ctx, 
Eina_Bool alpha_only)
fb = _buffer_empty_new(ctx, 0, 0, alpha_only, EINA_FALSE);
if (!fb) return -1;
 
-   XDBG("Created context buffer %d %s", fb->id, alpha_only ? "alpha" : "rgba");
return fb->id;
 }
 
@@ -403,7 +402,7 @@ evas_filter_buffer_backing_steal(Evas_Filter_Context *ctx, 
int bufid)
fb = _filter_buffer_get(ctx, bufid);
if (!fb) return NULL;
 
-   return evas_ector_buffer_drawable_image_get(fb->buffer, EINA_TRUE);
+   return evas_ector_buffer_drawable_image_get(fb->buffer);
 }
 
 Eina_Bool
@@ -434,6 +433,7 @@ _command_new(Evas_Filter_Context *ctx, Evas_Filter_Mode 
mode,
cmd->input = input;
cmd->mask = mask;
cmd->output = output;
+   if (output) output->dirty = EINA_TRUE;
 
ctx->commands = eina_inlist_append(ctx->commands, EINA_INLIST_GET(cmd));
return cmd;
@@ -454,19 +454,20 @@ _command_del(Evas_Filter_Context *ctx, 
Evas_Filter_Command *cmd)
 
 Evas_Filter_Buffer *
 evas_filter_temporary_buffer_get(Evas_Filter_Context *ctx, int w, int h,
- Eina_Bool alpha_only)
+ Eina_Bool alpha_only, Eina_Bool clean)
 {
-   Evas_Filter_Buffer *buf = NULL;
+   Evas_Filter_Buffer *fb = NULL;
Eina_List *l;
 
-   EINA_LIST_FOREACH(ctx->buffers, l, buf)
+   EINA_LIST_FOREACH(ctx->buffers, l, fb)
  {
-if (buf->transient && !buf->locked && (buf->alpha_only == alpha_only))
+if (fb->transient && !fb->locked && (fb->alpha_only == alpha_only)
+&& (!clean || !fb->dirty))
   {
- if ((!w || (w == buf->w)) && (!h || (h == buf->h)))
+ if ((!w || (w == fb->w)) && (!h || (h == fb->h)))
{
-  buf->locked = EINA_TRUE;
-  return buf;
+  fb->locked = EINA_TRUE;
+  return fb;
}
   }
  }
@@ -477,10 +478,11 @@ evas_filter_temporary_buffer_get(Evas_Filter_Context 
*ctx, int w, int h,
 return NULL;
  }
 
-   buf = _buffer_empty_new(ctx, w, h, alpha_only, EINA_TRUE);
-   buf->locked = EINA_TRUE;
+   fb = _buffer_empty_new(ctx, w, h, alpha_only, EINA_TRUE);
+   fb->locked = EINA_TRUE;
+   XDBG("Created temporary buffer %d %s", fb->id, alpha_only ? "alpha" : 
"rgba");
 
-   return buf;
+   return fb;
 }
 
 static void
@@ -522,7 +524,9 @@ evas_filter_command_fill_add(Evas_Filter_Context *ctx, void 
*draw_context,
 
XDBG("Add fill %d with color(%d,%d,%d,%d)", buf->id, R, G, B, A);
 
-   buf->dirty = EINA_TRUE;
+   if (!R && !G && !B && !A)
+ buf->dirty = EINA_FALSE;
+
return cmd;
 }
 
@@ -533,10 +537,16 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, 
void *drawctx,
 {
Evas_Filter_Buffer *in = NULL, *out = NULL, *tmp = NULL, *in_dy = NULL;
Evas_Filter_Buffer *out_dy = NULL, *out_dx = NULL;
-   Evas_Filter_Buffer *copybuf = NULL, *blur_out = NULL;
-   Eina_Bool copy_back = EINA_FALSE, blend = EINA_FALSE;
+   

[EGIT] [core/efl] master 51/53: evas filters: Fix rare crash with async render

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=03b0e23137ee67a79c8610123f9674a4664f3dea

commit 03b0e23137ee67a79c8610123f9674a4664f3dea
Author: Jean-Philippe Andre 
Date:   Fri Apr 14 11:07:04 2017 +0900

evas filters: Fix rare crash with async render

Reported by bu5hm4n

@fix (backport will look slightly different)
---
 src/lib/evas/canvas/evas_filter_mixin.c | 12 +++-
 src/lib/evas/filters/evas_filter.c  |  2 --
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index ee38291..1c5dd60 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -130,6 +130,7 @@ _filter_end_sync(Evas_Filter_Context *ctx, 
Evas_Object_Protected_Data *obj,
  }
 
FCOW_WRITE(pd, context, ctx);
+   efl_unref(eo_obj);
 }
 
 static void
@@ -449,16 +450,9 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
FCOW_END(fcow, pd);
 
// Run the filter now (maybe async)
+   efl_ref(eo_obj);
ok = evas_filter_context_run(filter);
-   if (!ok)
- {
-ERR("Filter program failed to run!");
-evas_filter_context_destroy(filter);
-fcow = FCOW_BEGIN(pd);
-fcow->context = NULL;
-fcow->invalid = EINA_TRUE;
-FCOW_END(fcow, pd);
- }
+   if (!ok) ERR("Filter program failed to run!");
 
return ok;
 }
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 1e73bb3..08ad0b7 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -1880,8 +1880,6 @@ _filter_obscured_region_calc(Evas_Filter_Context *ctx)
 Eina_Bool
 evas_filter_context_run(Evas_Filter_Context *ctx)
 {
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE);
-
_filter_obscured_region_calc(ctx);
 
ctx->run_count++;

-- 




[EGIT] [core/efl] master 23/53: evas filters: Expand snapshot regions by blur radius

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1336b2d9e05f2c6fafe109af49ea56739fe77fe3

commit 1336b2d9e05f2c6fafe109af49ea56739fe77fe3
Author: Jean-Philippe Andre 
Date:   Fri Mar 17 11:24:10 2017 +0900

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.
---
 src/bin/elementary/test_evas_snapshot.c |  2 +-
 src/lib/evas/canvas/evas_filter_mixin.c | 18 ++
 src/lib/evas/canvas/evas_render.c   | 58 +
 src/lib/evas/include/evas_private.h |  1 +
 4 files changed, 50 insertions(+), 29 deletions(-)

diff --git a/src/bin/elementary/test_evas_snapshot.c 
b/src/bin/elementary/test_evas_snapshot.c
index 26d76b4..d2e8786 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -20,7 +20,7 @@ static const int rnd[] = {
 
 static const char *filter =
   "padding_set {0}"
-  "fill { color = '#0123' }"
+  "fill { color = 'red' }"
   "blur { 5 }"
   "print ('Evaluating filter: ' .. input.width .. 'x' .. input.height)"
   ;
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index a0d3b3e..636451d 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, );
+
+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"
diff --git a/src/lib/evas/canvas/evas_render.c 
b/src/lib/evas/canvas/evas_render.c
index e464026..61d8fd2 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -88,6 +88,7 @@ rend_dbg(const char *txt)
 #else
 #define RD(xxx, args...)
 #define IFRD(ifcase, xxx, args...)
+#define RDNAME(xxx) ""
 #endif
 
 #define OBJ_ARRAY_PUSH(array, obj) eina_array_push(array, obj)
@@ -2612,13 +2613,15 @@ end:
 }
 
 static void
-_evas_render_cutout_add(Evas_Public_Data *evas, void *context, 
Evas_Object_Protected_Data *obj, int off_x, int off_y)
+_evas_render_cutout_add(Evas_Public_Data *evas, void *context,
+Evas_Object_Protected_Data *obj, int off_x, int off_y,
+int cutout_margin)
 {
+   Evas_Coord cox = 0, coy = 0, cow = 0, coh = 0;
+
if (evas_object_is_source_invisible(obj->object, obj)) return;
if (evas_object_is_opaque(obj->object, obj))
  {
-Evas_Coord cox, coy, cow, coh;
-
 cox = obj->cur->cache.clip.x;
 coy = obj->cur->cache.clip.y;
 cow = obj->cur->cache.clip.w;
@@ -2642,28 +2645,22 @@ _evas_render_cutout_add(Evas_Public_Data *evas, void 
*context, Evas_Object_Prote
   oo = oo->cur->clipper;
}
   }
-ENFN->context_cutout_add(ENDT, context, cox + off_x, coy + off_y, cow, 
coh);
  }
-   else
+   else if (obj->func->get_opaque_rect)
  {
-if (obj->func->get_opaque_rect)
-  {
- Evas_Coord obx, oby, obw, obh;
-
- obj->func->get_opaque_rect(obj->object, obj, obj->private_data, 
, , , );
- if ((obw > 0) && (obh > 0))
-   {
-  obx += off_x;
-  oby += off_y;
-  RECTS_CLIP_TO_RECT(obx, oby, obw, obh,
- obj->cur->cache.clip.x + off_x,
- obj->cur->cache.clip.y + off_y,
- obj->cur->cache.clip.w,
- obj->cur->cache.clip.h);
-  ENFN->context_cutout_add(ENDT, context, obx, oby, obw, obh);
-   }
-  

[EGIT] [core/efl] master 20/53: evas: Pass obscuring region to the filters

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9b1ea2fc6b21be05c7959d2d14402310c9c68784

commit 9b1ea2fc6b21be05c7959d2d14402310c9c68784
Author: Jean-Philippe Andre 
Date:   Wed Mar 15 14:49:50 2017 +0900

evas: Pass obscuring region to the filters

This will be most useful in a special case, where a filter is
used in a window decoration, applied to a snapshot object.

Another optimization that might be wanted is passing a list
of update regions (from the proxy or snapshot).

The filters don't support the obscuring region yet, only some
of the high-level logic is implemented.
---
 src/lib/evas/canvas/efl_canvas_filter_internal.eo |  1 +
 src/lib/evas/canvas/evas_filter_mixin.c   | 86 +--
 src/lib/evas/canvas/evas_object_main.c|  2 +-
 src/lib/evas/canvas/evas_object_textblock.c   | 34 -
 src/lib/evas/canvas/evas_render.c | 75 +---
 src/lib/evas/filters/evas_filter.c| 57 +++
 src/lib/evas/filters/evas_filter_parser.c | 44 +++-
 src/lib/evas/filters/evas_filter_private.h| 12 +++-
 src/lib/evas/include/evas_filter.h| 10 ++-
 src/lib/evas/include/evas_private.h   |  2 +
 10 files changed, 253 insertions(+), 70 deletions(-)

diff --git a/src/lib/evas/canvas/efl_canvas_filter_internal.eo 
b/src/lib/evas/canvas/efl_canvas_filter_internal.eo
index 8b44d40..a60b3f1 100644
--- a/src/lib/evas/canvas/efl_canvas_filter_internal.eo
+++ b/src/lib/evas/canvas/efl_canvas_filter_internal.eo
@@ -1,4 +1,5 @@
 // import efl_gfx_types -> need to add Efl.Gfx.Color
+import eina_types;
 
 /* Everything in this file is internal to Evas. It is not meant to be used
from outside EFL itself! */
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index b19e4e6..a0d3b3e 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -157,6 +157,24 @@ _evas_filter_state_set_internal(Evas_Filter_Program *pgm, 
Evas_Filter_Data *pd)
return evas_filter_program_state_set(pgm, );
 }
 
+static inline Eina_Bool
+_evas_filter_obscured_region_changed(Evas_Filter_Data *pd)
+{
+   Eina_Rectangle inter;
+
+   inter = pd->data->prev_obscured;
+   if (eina_rectangle_is_empty(>data->obscured) &&
+   eina_rectangle_is_empty())
+ return EINA_FALSE;
+   if (!eina_rectangle_intersection(, >data->obscured))
+ return EINA_TRUE;
+   if ((inter.w != pd->data->prev_obscured.w) ||
+   (inter.h != pd->data->prev_obscured.h))
+ return EINA_TRUE;
+
+   return EINA_FALSE;
+}
+
 Eina_Bool
 evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
   void *output, void *context, void *surface,
@@ -166,12 +184,13 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 
if (!pd->data->invalid && (pd->data->chain || pd->data->code))
  {
-int X, Y, W, H, l = 0, r = 0, t = 0, b = 0;
+int X, Y, W, H;
 Evas_Filter_Context *filter;
 void *drawctx;
 Eina_Bool ok;
 void *previous = pd->data->output;
 Evas_Object_Filter_Data *fcow;
+Evas_Filter_Padding pad;
 
 /* NOTE: Filter rendering is now done ENTIRELY on CPU.
  * So we rely on cache/cache2 to allocate a real image buffer,
@@ -229,17 +248,15 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
   }
 else if (previous && !pd->data->changed)
   {
- Eina_Bool redraw;
+ Eina_Bool redraw = EINA_TRUE;
 
- redraw = _evas_filter_state_set_internal(pd->data->chain, pd);
- if (redraw)
+ if (_evas_filter_state_set_internal(pd->data->chain, pd))
DBG("Filter redraw by state change!");
  else if (obj->changed)
-   {
-  // FIXME: Check that something else than X,Y changed!
-  redraw = EINA_TRUE;
-  DBG("Filter redraw by object content change!");
-   }
+   DBG("Filter redraw by object content change!");
+ else if (_evas_filter_obscured_region_changed(pd))
+   DBG("Filter redraw by obscure regions change!");
+ else redraw = EINA_FALSE;
 
  // Scan proxies to find if any changed
  if (!redraw && pd->data->sources)
@@ -303,13 +320,16 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 drawctx = ENFN->context_new(ENDT);
 ENFN->context_color_set(ENDT, drawctx, 255, 255, 255, 255);
 
+// Set obscured region
+evas_filter_context_obscured_region_set(filter, pd->data->obscured);
+
 // Allocate all buffers now
 evas_filter_context_buffers_allocate_all(filter);
 

[EGIT] [core/efl] master 10/53: evas filters: Prepare GL support for blend operation

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fb52c15e8513cc1458341da13e570d231a886551

commit fb52c15e8513cc1458341da13e570d231a886551
Author: Jean-Philippe Andre 
Date:   Tue Jan 17 21:34:48 2017 +0900

evas filters: Prepare GL support for blend operation

No implementation yet, this is just the skeletton!
---
 src/Makefile_Evas.am   |  4 ++
 src/modules/evas/engines/gl_generic/evas_engine.c  | 53 ++
 .../engines/gl_generic/filters/gl_engine_filter.h  | 19 
 .../engines/gl_generic/filters/gl_filter_blend.c   | 30 
 4 files changed, 106 insertions(+)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 7bea8c3..f925cda 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -843,6 +843,8 @@ modules/evas/engines/gl_generic/Evas_Engine_GL_Shared.h \
 modules/evas/engines/gl_generic/evas_ector_gl_buffer.c \
 modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c \
 modules/evas/engines/gl_generic/evas_ector_gl_rgbaimage_buffer.c \
+modules/evas/engines/gl_generic/filters/gl_engine_filter.h \
+modules/evas/engines/gl_generic/filters/gl_filter_blend.c \
 $(NULL)
 
 evas_gl_generic_eolian_files = \
@@ -894,6 +896,8 @@ modules_evas_engines_gl_generic_module_la_CFLAGS = \
 -I$(top_srcdir)/src/lib/evas/include \
 -I$(top_builddir)/src/lib/evas/include \
 -I$(top_srcdir)/src/lib/evas/cserve2 \
+-I$(top_srcdir)/src/lib/evas/filters \
+-I$(top_builddir)/src/lib/evas/canvas \
 -I$(top_srcdir)/src/modules/evas/engines/gl_common \
 -I$(top_builddir)/src/modules/evas/engines/gl_generic \
 @evas_engine_gl_common_cflags@ \
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c 
b/src/modules/evas/engines/gl_generic/evas_engine.c
index 5f97c36..00fcc1d 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -8,6 +8,7 @@
 #include "evas_ector_gl_buffer.eo.h"
 #include "evas_ector_gl_image_buffer.eo.h"
 #include "evas_ector_gl_rgbaimage_buffer.eo.h"
+#include "filters/gl_engine_filter.h"
 
 #if defined HAVE_DLSYM && ! defined _WIN32
 # include   /* dlopen,dlclose,etc */
@@ -3155,6 +3156,55 @@ eng_image_surface_noscale_region_get(void *engdata 
EINA_UNUSED, void *image, int
  }
 }
 
+////
+
+static GL_Filter_Apply_Func
+_gfx_filter_func_get(Evas_Filter_Command *cmd)
+{
+   GL_Filter_Apply_Func funcptr = NULL;
+
+   switch (cmd->mode)
+ {
+  case EVAS_FILTER_MODE_BLEND: funcptr = gl_filter_blend_func_get(cmd); 
break;
+  //case EVAS_FILTER_MODE_BLUR: funcptr = gl_filter_blur_func_get(cmd); 
break;
+  //case EVAS_FILTER_MODE_BUMP: funcptr = gl_filter_bump_func_get(cmd); 
break;
+  //case EVAS_FILTER_MODE_CURVE: funcptr = gl_filter_curve_func_get(cmd); 
break;
+  //case EVAS_FILTER_MODE_DISPLACE: funcptr = 
gl_filter_displace_func_get(cmd); break;
+  //case EVAS_FILTER_MODE_FILL: funcptr = gl_filter_fill_func_get(cmd); 
break;
+  //case EVAS_FILTER_MODE_MASK: funcptr = gl_filter_mask_func_get(cmd); 
break;
+  //case EVAS_FILTER_MODE_TRANSFORM: funcptr = 
gl_filter_transform_func_get(cmd); break;
+  default: return NULL;
+ }
+
+   return funcptr;
+}
+
+static Evas_Filter_Support
+eng_gfx_filter_supports(void *data, Evas_Filter_Command *cmd)
+{
+   Render_Engine_GL_Generic *re = data;
+
+   if (!_gfx_filter_func_get(cmd))
+ return pfunc.gfx_filter_supports(>software, cmd);
+
+   return EVAS_FILTER_SUPPORT_GL;
+}
+
+static Eina_Bool
+eng_gfx_filter_process(void *data, Evas_Filter_Command *cmd)
+{
+   Render_Engine_GL_Generic *re = data;
+   GL_Filter_Apply_Func funcptr;
+
+   funcptr = _gfx_filter_func_get(cmd);
+   if (funcptr)
+ return funcptr(re, cmd);
+   else
+ return pfunc.gfx_filter_process(>software, cmd);
+}
+
+////
+
 static int
 module_open(Evas_Module *em)
 {
@@ -3323,6 +3373,9 @@ module_open(Evas_Module *em)
ORD(ector_new);
ORD(ector_free);
 
+   ORD(gfx_filter_supports);
+   ORD(gfx_filter_process);
+
/* now advertise out own api */
em->functions = (void *)();
return 1;
diff --git a/src/modules/evas/engines/gl_generic/filters/gl_engine_filter.h 
b/src/modules/evas/engines/gl_generic/filters/gl_engine_filter.h
new file mode 100644
index 000..061ea5f
--- /dev/null
+++ b/src/modules/evas/engines/gl_generic/filters/gl_engine_filter.h
@@ -0,0 +1,19 @@
+#ifndef GL_ENGINE_FILTER_H
+#define GL_ENGINE_FILTER_H
+
+#include "evas_filter_private.h"
+#include "evas_gl_common.h"
+#include "evas_ector_buffer.eo.h"
+#include "../Evas_Engine_GL_Generic.h"
+
+typedef Eina_Bool (* GL_Filter_Apply_Func) (Render_Engine_GL_Generic *re, 
Evas_Filter_Command *cmd);
+GL_Filter_Apply_Func gl_filter_blend_func_get(Evas_Filter_Command *cmd);
+//Software_Filter_Func gl_filter_blur_func_get(Evas_Filter_Command *cmd);

[EGIT] [core/efl] master 41/53: evas: Fix cutout handling for snapshot objects

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=08a80725714904e8408dfd116c812b013e7a603b

commit 08a80725714904e8408dfd116c812b013e7a603b
Author: Jean-Philippe Andre 
Date:   Thu Mar 30 13:52:48 2017 +0900

evas: Fix cutout handling for snapshot objects

This improves over the previous code for handling
snapshot objects and cutouts. Basically any opaque object
above a snapshot should be obscuring it. That is true
unless a crazy filter is applied, or the snapshot object
is itself the source of a map or proxy.

This also uses eina_tiler instead of a custom (and really
bad) algorithm to compute the obscure regions.
---
 src/lib/evas/canvas/efl_canvas_snapshot.c  |  12 --
 src/lib/evas/canvas/efl_canvas_snapshot.eo |   1 -
 src/lib/evas/canvas/evas_filter_mixin.c|  42 ---
 src/lib/evas/canvas/evas_object_image.c|   6 +-
 src/lib/evas/canvas/evas_render.c  | 189 -
 src/lib/evas/include/evas_private.h|   4 +-
 6 files changed, 139 insertions(+), 115 deletions(-)

diff --git a/src/lib/evas/canvas/efl_canvas_snapshot.c 
b/src/lib/evas/canvas/efl_canvas_snapshot.c
index fcb7a7a..9f77ce6 100644
--- a/src/lib/evas/canvas/efl_canvas_snapshot.c
+++ b/src/lib/evas/canvas/efl_canvas_snapshot.c
@@ -21,16 +21,4 @@ _efl_canvas_snapshot_efl_object_constructor(Eo *eo_obj, void 
*pd EINA_UNUSED)
return eo_obj;
 }
 
-EOLIAN static void
-_efl_canvas_snapshot_efl_gfx_buffer_buffer_update_add(Eo *eo_obj, void *_pd 
EINA_UNUSED,
-  int x EINA_UNUSED, int y 
EINA_UNUSED,
-  int w EINA_UNUSED, int h 
EINA_UNUSED)
-{
-   Evas_Object_Protected_Data *obj;
-
-   // FIXME: Prevent obscures in the region x,y,w,h
-   obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
-   evas_object_change(eo_obj, obj);
-}
-
 #include "efl_canvas_snapshot.eo.c"
diff --git a/src/lib/evas/canvas/efl_canvas_snapshot.eo 
b/src/lib/evas/canvas/efl_canvas_snapshot.eo
index e917aeb..e370581 100644
--- a/src/lib/evas/canvas/efl_canvas_snapshot.eo
+++ b/src/lib/evas/canvas/efl_canvas_snapshot.eo
@@ -9,6 +9,5 @@ class Efl.Canvas.Snapshot (Efl.Canvas.Image.Internal)
data: null;
implements {
   Efl.Object.constructor;
-  Efl.Gfx.Buffer.buffer_update_add;
}
 }
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index 1a74cd8..1bae8c6 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -841,29 +841,43 @@ _efl_canvas_filter_internal_filter_output_buffer_get(Eo 
*obj EINA_UNUSED, Evas_F
 }
 
 Eina_Bool
-_evas_filter_obscured_region_set(Evas_Object_Protected_Data *obj,
- const Eina_Rectangle rect)
+_evas_filter_obscured_regions_set(Evas_Object_Protected_Data *obj, const 
Eina_Tiler *tiler)
 {
Evas_Object_Filter_Data *fcow;
+   Eina_Rectangle prev, rect = {}, empty = {};
+   Eina_Rectangle *r;
Evas_Filter_Data *pd;
-   Eina_Rectangle prev;
+   Eina_Iterator *it;
+   Eina_Bool was_empty;
+   int area = 0;
+
+   // TODO: Can we handle more than one opaque region?
 
pd = efl_data_scope_get(obj->object, MY_CLASS);
if (!pd->data) return EINA_FALSE;
 
-   prev = pd->data->prev_obscured;
+   // Find largest opaque rect
+   it = eina_tiler_iterator_new(tiler);
+   EINA_ITERATOR_FOREACH(it, r)
+ {
+int wh = r->w * r->h;
+if (wh > area)
+  {
+ area = wh;
+ rect = *r;
+  }
+ }
+   eina_iterator_free(it);
 
-   fcow = FCOW_BEGIN(pd);
-   if ((rect.w <= 0) || (rect.h <= 0))
- memset(>obscured, 0, sizeof(fcow->obscured));
-   else
+   prev = pd->data->prev_obscured;
+   if (!pd->data->changed && !memcmp(, , sizeof(prev)))
+ was_empty = EINA_TRUE;
+   else if (memcmp(, , sizeof(rect)))
  {
-fcow->obscured.x = rect.x - obj->cur->geometry.x;
-fcow->obscured.y = rect.y - obj->cur->geometry.y;
-fcow->obscured.w = rect.w;
-fcow->obscured.h = rect.h;
+fcow = FCOW_BEGIN(pd);
+fcow->obscured = rect;
+FCOW_END(fcow, pd);
  }
-   FCOW_END(fcow, pd);
 
// Snapshot objects need to be redrawn if the padding has increased
if ((pd->data->prev_padding.l < pd->data->padding.l) ||
@@ -873,7 +887,7 @@ _evas_filter_obscured_region_set(Evas_Object_Protected_Data 
*obj,
  return EINA_TRUE;
 
// Snapshot objects need to be redrawn if the obscured region has shrank
-   if (!_evas_eina_rectangle_inside(, >data->obscured))
+   if (!was_empty && !_evas_eina_rectangle_inside(, >data->obscured))
  return EINA_TRUE;
 
return EINA_FALSE;
diff --git a/src/lib/evas/canvas/evas_object_image.c 
b/src/lib/evas/canvas/evas_object_image.c
index ae2a1c4..94feded 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ 

[EGIT] [core/efl] master 14/53: evas filters: Implement fill filter in pure GL

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ac8812665b8659fe0c9132ef1ccdc8e8a058fc03

commit ac8812665b8659fe0c9132ef1ccdc8e8a058fc03
Author: Jean-Philippe Andre 
Date:   Tue Jan 24 15:39:29 2017 +0900

evas filters: Implement fill filter in pure GL

Now that one was trivial. Could also be done with glClear and
glScissor instead, but the rectangle infrastructure works well
enough.
---
 src/Makefile_Evas.am   |  1 +
 src/lib/evas/filters/evas_filter_parser.c  |  1 +
 src/modules/evas/engines/gl_generic/evas_engine.c  |  2 +-
 .../engines/gl_generic/filters/gl_engine_filter.h  |  2 +-
 .../engines/gl_generic/filters/gl_filter_fill.c| 72 ++
 5 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index aa2da76..5bac278 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -844,6 +844,7 @@ modules/evas/engines/gl_generic/evas_ector_gl_buffer.c \
 modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c \
 modules/evas/engines/gl_generic/filters/gl_engine_filter.h \
 modules/evas/engines/gl_generic/filters/gl_filter_blend.c \
+modules/evas/engines/gl_generic/filters/gl_filter_fill.c \
 modules/evas/engines/gl_generic/filters/gl_filter_mask.c \
 $(NULL)
 
diff --git a/src/lib/evas/filters/evas_filter_parser.c 
b/src/lib/evas/filters/evas_filter_parser.c
index 143d065..9bebd19 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -3210,6 +3210,7 @@ _instr2cmd_fill(Evas_Filter_Context *ctx,
cmd->draw.clip.t = t;
cmd->draw.clip.b = b;
cmd->draw.clip_mode_lrtb = EINA_TRUE;
+   cmd->draw.rop = EFL_GFX_RENDER_OP_COPY;
 
return cmd;
 }
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c 
b/src/modules/evas/engines/gl_generic/evas_engine.c
index 6c840f6..f43cebd 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -3033,7 +3033,7 @@ _gfx_filter_func_get(Evas_Filter_Command *cmd)
   //case EVAS_FILTER_MODE_BUMP: funcptr = gl_filter_bump_func_get(cmd); 
break;
   //case EVAS_FILTER_MODE_CURVE: funcptr = gl_filter_curve_func_get(cmd); 
break;
   //case EVAS_FILTER_MODE_DISPLACE: funcptr = 
gl_filter_displace_func_get(cmd); break;
-  //case EVAS_FILTER_MODE_FILL: funcptr = gl_filter_fill_func_get(cmd); 
break;
+  case EVAS_FILTER_MODE_FILL: funcptr = gl_filter_fill_func_get(cmd); 
break;
   case EVAS_FILTER_MODE_MASK: funcptr = gl_filter_mask_func_get(cmd); 
break;
   //case EVAS_FILTER_MODE_TRANSFORM: funcptr = 
gl_filter_transform_func_get(cmd); break;
   default: return NULL;
diff --git a/src/modules/evas/engines/gl_generic/filters/gl_engine_filter.h 
b/src/modules/evas/engines/gl_generic/filters/gl_engine_filter.h
index 6b6e45b..80daf91 100644
--- a/src/modules/evas/engines/gl_generic/filters/gl_engine_filter.h
+++ b/src/modules/evas/engines/gl_generic/filters/gl_engine_filter.h
@@ -14,7 +14,7 @@ GL_Filter_Apply_Func 
gl_filter_blend_func_get(Evas_Filter_Command *cmd);
 //GL_Filter_Apply_Func gl_filter_bump_func_get(Evas_Filter_Command *cmd);
 //GL_Filter_Apply_Func gl_filter_curve_func_get(Evas_Filter_Command *cmd);
 //GL_Filter_Apply_Func gl_filter_displace_func_get(Evas_Filter_Command *cmd);
-//GL_Filter_Apply_Func gl_filter_fill_func_get(Evas_Filter_Command *cmd);
+GL_Filter_Apply_Func gl_filter_fill_func_get(Evas_Filter_Command *cmd);
 GL_Filter_Apply_Func gl_filter_mask_func_get(Evas_Filter_Command *cmd);
 //GL_Filter_Apply_Func gl_filter_transform_func_get(Evas_Filter_Command *cmd);
 
diff --git a/src/modules/evas/engines/gl_generic/filters/gl_filter_fill.c 
b/src/modules/evas/engines/gl_generic/filters/gl_filter_fill.c
new file mode 100644
index 000..a15198d
--- /dev/null
+++ b/src/modules/evas/engines/gl_generic/filters/gl_filter_fill.c
@@ -0,0 +1,72 @@
+#include "gl_engine_filter.h"
+
+static Eina_Bool
+_gl_filter_fill(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd)
+{
+   Evas_Filter_Buffer *fb = cmd->output;
+   Evas_Engine_GL_Context *gc;
+   Evas_GL_Image *surface;
+   RGBA_Draw_Context *dc_save;
+   int x = MAX(0, cmd->draw.clip.x);
+   int y = MAX(0, cmd->draw.clip.y);
+   int w, h;
+
+   DEBUG_TIME_BEGIN();
+
+   if (!cmd->draw.clip_mode_lrtb)
+ {
+if (cmd->draw.clip.w)
+  w = MIN(cmd->draw.clip.w, fb->w - x);
+else
+  w = fb->w - x;
+if (cmd->draw.clip.h)
+  h = MIN(cmd->draw.clip.h, fb->h - y);
+else
+  h = fb->h - y;
+ }
+   else
+ {
+x = MAX(0, cmd->draw.clip.l);
+y = MAX(0, cmd->draw.clip.t);
+w = CLAMP(0, fb->w - x - cmd->draw.clip.r, fb->w - x);
+h = CLAMP(0, fb->h - y - cmd->draw.clip.b, fb->h - y);
+ }
+
+   surface = evas_ector_buffer_render_image_get(fb->buffer);
+   

[EGIT] [core/efl] master 02/53: evas filters: Move mask to software generic (2/8)

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=09ff5f419ec102e65dc37cabf53d9854c6da978e

commit 09ff5f419ec102e65dc37cabf53d9854c6da978e
Author: Jean-Philippe Andre 
Date:   Tue Jan 17 19:33:50 2017 +0900

evas filters: Move mask to software generic (2/8)
---
 src/Makefile_Evas.am   |  2 +-
 src/lib/evas/filters/evas_filter.c |  5 +-
 src/lib/evas/filters/evas_filter_private.h |  1 -
 .../evas/engines/software_generic/evas_engine.c|  8 +--
 .../engines/software_generic/evas_engine_filter.h  |  1 +
 .../software_generic}/filters/evas_filter_mask.c   | 76 +-
 6 files changed, 53 insertions(+), 40 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index bb037ff..00b8791 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -597,7 +597,6 @@ lib/evas/filters/evas_filter_bump.c \
 lib/evas/filters/evas_filter_curve.c \
 lib/evas/filters/evas_filter_displace.c \
 lib/evas/filters/evas_filter_fill.c \
-lib/evas/filters/evas_filter_mask.c \
 lib/evas/filters/evas_filter_parser.c \
 lib/evas/filters/evas_filter_transform.c \
 lib/evas/filters/evas_filter_utils.c \
@@ -618,6 +617,7 @@ lib/evas/filters/blur/blur_box_rgba_neon.c
 GFX_FILTER_SW_FILES = \
 modules/evas/engines/software_generic/evas_engine_filter.h \
 modules/evas/engines/software_generic/filters/evas_filter_blend.c \
+modules/evas/engines/software_generic/filters/evas_filter_mask.c \
 $(NULL)
 
 ### Engine Ector stuff
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 5ff5a7b..04188d5 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -1550,9 +1550,6 @@ _filter_command_run(Evas_Filter_Command *cmd)
case EVAS_FILTER_MODE_FILL:
  func = evas_filter_fill_cpu_func_get(cmd);
  break;
-   case EVAS_FILTER_MODE_MASK:
- func = evas_filter_mask_cpu_func_get(cmd);
- break;
case EVAS_FILTER_MODE_BUMP:
  func = evas_filter_bump_map_cpu_func_get(cmd);
  break;
@@ -1567,7 +1564,7 @@ _filter_command_run(Evas_Filter_Command *cmd)
 
if (!func)
  {
-ERR("No function to process this filter!");
+ERR("No function to process this filter (mode %d)", cmd->mode);
 return EINA_FALSE;
  }
 
diff --git a/src/lib/evas/filters/evas_filter_private.h 
b/src/lib/evas/filters/evas_filter_private.h
index f659daa..d81bc9a 100644
--- a/src/lib/evas/filters/evas_filter_private.h
+++ b/src/lib/evas/filters/evas_filter_private.h
@@ -266,7 +266,6 @@ Evas_Filter_Apply_Func   
evas_filter_bump_map_cpu_func_get(Evas_Filter_Command *
 Evas_Filter_Apply_Func   evas_filter_curve_cpu_func_get(Evas_Filter_Command 
*cmd);
 Evas_Filter_Apply_Func   evas_filter_displace_cpu_func_get(Evas_Filter_Command 
*cmd);
 Evas_Filter_Apply_Func   evas_filter_fill_cpu_func_get(Evas_Filter_Command 
*cmd);
-Evas_Filter_Apply_Func   evas_filter_mask_cpu_func_get(Evas_Filter_Command 
*cmd);
 Evas_Filter_Apply_Func   
evas_filter_transform_cpu_func_get(Evas_Filter_Command *cmd);
 
 /* Utility functions */
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c 
b/src/modules/evas/engines/software_generic/evas_engine.c
index 37fa1b9..281340a 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -4627,11 +4627,9 @@ _gfx_filter_func_get(Evas_Filter_Command *cmd)
 
switch (cmd->mode)
  {
-  case EVAS_FILTER_MODE_BLEND:
-func = eng_filter_blend_func_get(cmd);
-break;
-  default:
-return NULL;
+  case EVAS_FILTER_MODE_BLEND: func = eng_filter_blend_func_get(cmd); 
break;
+  case EVAS_FILTER_MODE_MASK: func = eng_filter_mask_func_get(cmd); break;
+  default: return NULL;
  }
 
return func;
diff --git a/src/modules/evas/engines/software_generic/evas_engine_filter.h 
b/src/modules/evas/engines/software_generic/evas_engine_filter.h
index 2b2c81d..3971a6b 100644
--- a/src/modules/evas/engines/software_generic/evas_engine_filter.h
+++ b/src/modules/evas/engines/software_generic/evas_engine_filter.h
@@ -4,5 +4,6 @@
 #include "evas_filter_private.h"
 
 Evas_Filter_Apply_Func eng_filter_blend_func_get(Evas_Filter_Command *cmd);
+Evas_Filter_Apply_Func eng_filter_mask_func_get(Evas_Filter_Command *cmd);
 
 #endif // EVAS_ENGINE_FILTER_H
diff --git a/src/lib/evas/filters/evas_filter_mask.c 
b/src/modules/evas/engines/software_generic/filters/evas_filter_mask.c
similarity index 86%
rename from src/lib/evas/filters/evas_filter_mask.c
rename to src/modules/evas/engines/software_generic/filters/evas_filter_mask.c
index 230cb32..18acf8c 100644
--- a/src/lib/evas/filters/evas_filter_mask.c
+++ b/src/modules/evas/engines/software_generic/filters/evas_filter_mask.c
@@ -1,7 +1,6 @@
 /* Implementation of 

[EGIT] [core/efl] master 03/53: evas filters: Move curve to software generic (3/8)

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b6df13b02448621e5264152e2db1de370c7a6529

commit b6df13b02448621e5264152e2db1de370c7a6529
Author: Jean-Philippe Andre 
Date:   Tue Jan 17 20:34:16 2017 +0900

evas filters: Move curve to software generic (3/8)

This moves the RGBA premul/unpremul functions to static_libs/draw.
---
 src/Makefile_Evas.am   |  2 +-
 src/lib/evas/common/evas_convert_color.c   | 84 +---
 src/lib/evas/filters/evas_filter.c |  3 -
 src/lib/evas/filters/evas_filter_private.h |  1 -
 .../evas/engines/software_generic/evas_engine.c|  1 +
 .../engines/software_generic/evas_engine_filter.h  |  2 +
 .../software_generic/filters/evas_filter_blend.c   |  2 -
 .../software_generic}/filters/evas_filter_curve.c  | 10 +--
 .../software_generic/filters/evas_filter_mask.c|  1 -
 src/static_libs/draw/draw.h|  3 +
 src/static_libs/draw/draw_convert.c| 90 ++
 src/static_libs/draw/draw_main_neon.c  |  1 +
 12 files changed, 105 insertions(+), 95 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 00b8791..a2237d5 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -594,7 +594,6 @@ lib/evas/canvas/evas_filter_mixin.c \
 lib/evas/filters/evas_filter.c \
 lib/evas/filters/evas_filter_blur.c \
 lib/evas/filters/evas_filter_bump.c \
-lib/evas/filters/evas_filter_curve.c \
 lib/evas/filters/evas_filter_displace.c \
 lib/evas/filters/evas_filter_fill.c \
 lib/evas/filters/evas_filter_parser.c \
@@ -617,6 +616,7 @@ lib/evas/filters/blur/blur_box_rgba_neon.c
 GFX_FILTER_SW_FILES = \
 modules/evas/engines/software_generic/evas_engine_filter.h \
 modules/evas/engines/software_generic/filters/evas_filter_blend.c \
+modules/evas/engines/software_generic/filters/evas_filter_curve.c \
 modules/evas/engines/software_generic/filters/evas_filter_mask.c \
 $(NULL)
 
diff --git a/src/lib/evas/common/evas_convert_color.c 
b/src/lib/evas/common/evas_convert_color.c
index ee26638..548c8c5 100644
--- a/src/lib/evas/common/evas_convert_color.c
+++ b/src/lib/evas/common/evas_convert_color.c
@@ -1,9 +1,6 @@
 #include "evas_common_private.h"
 #include "evas_convert_color.h"
-
-#ifdef BUILD_NEON
-#include 
-#endif
+#include "draw.h"
 
 EAPI DATA32
 evas_common_convert_ag_premul(DATA16 *data, unsigned int len)
@@ -57,88 +54,13 @@ evas_common_convert_ag_unpremul(DATA16 *data, unsigned int 
len)
 EAPI DATA32
 evas_common_convert_argb_premul(DATA32 *data, unsigned int len)
 {
-   DATA32 *de = data + len;
-   DATA32 nas = 0;
-
-#ifdef BUILD_NEON
-   if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
- {
-uint8x8_t mask_0x00 = vdup_n_u8(0);
-uint8x8_t mask_0x01 = vdup_n_u8(1);
-uint8x8_t mask_0xff = vdup_n_u8(255);
-uint8x8_t cmp;
-uint64x1_t tmp;
-
-while (data <= de - 8)
-  {
- uint8x8x4_t rgba = vld4_u8((uint8_t *)data);
-
- cmp = vand_u8(vorr_u8(vceq_u8(rgba.val[3], mask_0xff),
-   vceq_u8(rgba.val[3], mask_0x00)),
-   mask_0x01);
- tmp = vpaddl_u32(vpaddl_u16(vpaddl_u8(cmp)));
- nas += vget_lane_u32(vreinterpret_u32_u64(tmp), 0);
-
- uint16x8x4_t lrgba;
- lrgba.val[0] = vmovl_u8(rgba.val[0]);
- lrgba.val[1] = vmovl_u8(rgba.val[1]);
- lrgba.val[2] = vmovl_u8(rgba.val[2]);
- lrgba.val[3] = vaddl_u8(rgba.val[3], mask_0x01);
-
- rgba.val[0] = vshrn_n_u16(vmlaq_u16(lrgba.val[0], lrgba.val[0],
- lrgba.val[3]), 8);
- rgba.val[1] = vshrn_n_u16(vmlaq_u16(lrgba.val[1], lrgba.val[1],
- lrgba.val[3]), 8);
- rgba.val[2] = vshrn_n_u16(vmlaq_u16(lrgba.val[2], lrgba.val[2],
- lrgba.val[3]), 8);
- vst4_u8((uint8_t *)data, rgba);
- data += 8;
-  }
- }
-#endif
-
-   while (data < de)
- {
-   DATA32  a = 1 + (*data >> 24);
-
-   *data = (*data & 0xff00) +
- (*data) >> 8) & 0xff) * a) & 0xff00) +
- (*data) & 0x00ff00ff) * a) >> 8) & 0x00ff00ff);
-   data++;
-
-   if ((a == 1) || (a == 256))
- nas++;
- }
-
-   return nas;
+   return (DATA32) efl_draw_argb_premul(data, len);
 }
 
 EAPI void
 evas_common_convert_argb_unpremul(DATA32 *data, unsigned int len)
 {
-   DATA32 *de = data + len;
-   DATA32 p_val = 0x, p_res = 0x;
-
-   while (data < de)
- {
-DATA32 a = (*data >> 24);
-
-if (p_val == *data) *data = p_res;
-else
-  {
- p_val = *data;
- if ((a > 0) && (a < 255))
-   *data = ARGB_JOIN(a,
-   

[EGIT] [core/efl] master 04/53: evas filters: Move fill to software generic (4/8)

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c9eec7400275405520d242747e3bf80801eb8b04

commit c9eec7400275405520d242747e3bf80801eb8b04
Author: Jean-Philippe Andre 
Date:   Tue Jan 17 20:48:31 2017 +0900

evas filters: Move fill to software generic (4/8)

This also moves the header evas_engine_filter.h to its subdir.
---
 src/Makefile_Evas.am | 4 ++--
 src/lib/evas/filters/evas_filter.c   | 9 +++--
 src/lib/evas/filters/evas_filter_private.h   | 1 -
 src/modules/evas/engines/software_generic/evas_engine.c  | 3 ++-
 .../engines/software_generic/{ => filters}/evas_engine_filter.h  | 1 +
 .../evas/engines/software_generic/filters/evas_filter_blend.c| 2 +-
 .../evas/engines/software_generic/filters/evas_filter_curve.c| 2 +-
 .../evas/engines/software_generic}/filters/evas_filter_fill.c| 5 ++---
 .../evas/engines/software_generic/filters/evas_filter_mask.c | 2 +-
 9 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index a2237d5..d9cbaef 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -595,7 +595,6 @@ lib/evas/filters/evas_filter.c \
 lib/evas/filters/evas_filter_blur.c \
 lib/evas/filters/evas_filter_bump.c \
 lib/evas/filters/evas_filter_displace.c \
-lib/evas/filters/evas_filter_fill.c \
 lib/evas/filters/evas_filter_parser.c \
 lib/evas/filters/evas_filter_transform.c \
 lib/evas/filters/evas_filter_utils.c \
@@ -614,9 +613,10 @@ lib/evas/filters/blur/blur_box_rgba_sse3.c \
 lib/evas/filters/blur/blur_box_rgba_neon.c
 
 GFX_FILTER_SW_FILES = \
-modules/evas/engines/software_generic/evas_engine_filter.h \
+modules/evas/engines/software_generic/filters/evas_engine_filter.h \
 modules/evas/engines/software_generic/filters/evas_filter_blend.c \
 modules/evas/engines/software_generic/filters/evas_filter_curve.c \
+modules/evas/engines/software_generic/filters/evas_filter_fill.c \
 modules/evas/engines/software_generic/filters/evas_filter_mask.c \
 $(NULL)
 
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 3f2f0d5..a5ffa59 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -54,6 +54,8 @@ evas_filter_context_new(Evas_Public_Data *evas, Eina_Bool 
async, void *user_data
Evas_Filter_Context *ctx;
 
EINA_SAFETY_ON_NULL_RETURN_VAL(evas, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(evas->engine.func->gfx_filter_supports, 
NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(evas->engine.func->gfx_filter_process, NULL);
 
ctx = calloc(1, sizeof(Evas_Filter_Context));
if (!ctx) return NULL;
@@ -1527,9 +1529,7 @@ _filter_command_run(Evas_Filter_Command *cmd)
 return EINA_FALSE;
  }
 
-   if (cmd->ENFN->gfx_filter_supports)
- support = cmd->ENFN->gfx_filter_supports(cmd->ENDT, cmd);
-
+   support = cmd->ENFN->gfx_filter_supports(cmd->ENDT, cmd);
if (support != EVAS_FILTER_SUPPORT_NONE)
  {
 func = &_engine_gfx_filter_func;
@@ -1544,9 +1544,6 @@ _filter_command_run(Evas_Filter_Command *cmd)
case EVAS_FILTER_MODE_DISPLACE:
  func = evas_filter_displace_cpu_func_get(cmd);
  break;
-   case EVAS_FILTER_MODE_FILL:
- func = evas_filter_fill_cpu_func_get(cmd);
- break;
case EVAS_FILTER_MODE_BUMP:
  func = evas_filter_bump_map_cpu_func_get(cmd);
  break;
diff --git a/src/lib/evas/filters/evas_filter_private.h 
b/src/lib/evas/filters/evas_filter_private.h
index f95dd61..c4f3d4b 100644
--- a/src/lib/evas/filters/evas_filter_private.h
+++ b/src/lib/evas/filters/evas_filter_private.h
@@ -264,7 +264,6 @@ void 
evas_filter_context_source_set(Evas_Filter_Context *ctx
 Evas_Filter_Apply_Func   evas_filter_blur_cpu_func_get(Evas_Filter_Command 
*cmd);
 Evas_Filter_Apply_Func   evas_filter_bump_map_cpu_func_get(Evas_Filter_Command 
*cmd);
 Evas_Filter_Apply_Func   evas_filter_displace_cpu_func_get(Evas_Filter_Command 
*cmd);
-Evas_Filter_Apply_Func   evas_filter_fill_cpu_func_get(Evas_Filter_Command 
*cmd);
 Evas_Filter_Apply_Func   
evas_filter_transform_cpu_func_get(Evas_Filter_Command *cmd);
 
 /* Utility functions */
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c 
b/src/modules/evas/engines/software_generic/evas_engine.c
index 7dd2c2e..d71d7e7 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -29,7 +29,7 @@
 
 #include "Evas_Engine_Software_Generic.h"
 #include "evas_native_common.h"
-#include "evas_engine_filter.h"
+#include "filters/evas_engine_filter.h"
 
 #ifdef EVAS_GL
 //--//
@@ -4629,6 +4629,7 @@ _gfx_filter_func_get(Evas_Filter_Command *cmd)
  {
   case EVAS_FILTER_MODE_BLEND: 

[EGIT] [core/efl] master 26/53: evas filters: Recompile filter after data_set

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d56f9afa403b226b4fc0c690062dabd39fdf1b52

commit d56f9afa403b226b4fc0c690062dabd39fdf1b52
Author: Jean-Philippe Andre 
Date:   Mon Mar 20 20:16:19 2017 +0900

evas filters: Recompile filter after data_set
---
 src/lib/evas/canvas/evas_filter_mixin.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index 636451d..ce160a8 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -679,8 +679,12 @@ 
_efl_canvas_filter_internal_efl_gfx_filter_filter_data_set(Eo *eo_obj, Evas_Filt
db->execute = execute;
fcow->data = eina_inlist_append(fcow->data, EINA_INLIST_GET(db));
 }
-  evas_filter_program_data_set_all(fcow->chain, fcow->data);
-  evas_filter_program_parse(fcow->chain, fcow->code);
+  fcow->invalid = EINA_FALSE;
+  if (fcow->chain)
+{
+   evas_filter_program_data_set_all(fcow->chain, fcow->data);
+   evas_filter_program_parse(fcow->chain, fcow->code);
+}
   fcow->changed = 1;
}
FCOW_END(fcow, pd);

-- 




[EGIT] [core/efl] master 40/53: evas: Make save() work on snapshots

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c53f1526f3d52aefcf7d9ac0f70846fd60fe

commit c53f1526f3d52aefcf7d9ac0f70846fd60fe
Author: Jean-Philippe Andre 
Date:   Tue Mar 28 16:09:34 2017 +0900

evas: Make save() work on snapshots

This make save() work on snapshot objects, provided the call
is done from inside render_post.

Also, this saves the filtered output of an image, rather than
its source pixels. Any call to save() on a filtered image must
be done from post-render as well.

Fixes T2102

@feature
---
 src/bin/elementary/test_evas_snapshot.c|  48 -
 src/lib/evas/canvas/efl_canvas_snapshot.c  |  12 ++
 src/lib/evas/canvas/efl_canvas_snapshot.eo |   1 +
 src/lib/evas/canvas/evas_image_private.h   |   1 +
 src/lib/evas/canvas/evas_object_image.c| 200 +
 src/lib/evas/canvas/evas_render.c  |   5 +
 src/lib/evas/include/evas_private.h|   1 +
 .../evas/engines/gl_common/evas_gl_common.h|   1 +
 src/modules/evas/engines/gl_generic/evas_engine.c  |  85 ++---
 9 files changed, 213 insertions(+), 141 deletions(-)

diff --git a/src/bin/elementary/test_evas_snapshot.c 
b/src/bin/elementary/test_evas_snapshot.c
index 13e0458..845c95c 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -54,6 +54,35 @@ _anim_toggle(void *data, const Efl_Event *ev EINA_UNUSED)
 }
 
 static void
+_render_post(void *data, const Efl_Event *ev)
+{
+   Eo *snap = data;
+
+   efl_event_callback_del(ev->object, EFL_CANVAS_EVENT_RENDER_POST, 
_render_post, data);
+   efl_file_save(snap, eina_slstr_printf("%s/snap-efl.png", 
eina_environment_tmp_get()), NULL, NULL);
+}
+
+static void
+_save_image(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+   Eo *win = data;
+   Eo *snap;
+   int w, h;
+
+   // Save is available only during render_post
+   snap = efl_key_wref_get(win, "snap");
+   efl_event_callback_add(win, EFL_CANVAS_EVENT_RENDER_POST, _render_post, 
snap);
+
+   // Force a render in order to ensure post_render is called. EO API provides
+   // no way to do manual render, so we add a damage to the snapshot object.
+   // This is a special case handled by snapshot for the purpose of taking
+   // screenshots like this. This is useful only if the button click has no
+   // animation on screen and there is no spinning wheel either.
+   efl_gfx_size_get(snap, , );
+   efl_gfx_buffer_update_add(snap, 0, 0, w, h);
+}
+
+static void
 _radius_set(void *data, const Efl_Event *ev)
 {
char buf[128];
@@ -76,7 +105,7 @@ _close(void *data, const Efl_Event *ev EINA_UNUSED)
 void
 test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_UNUSED)
 {
-   Eo *win, *grid, *o, *snap;
+   Eo *win, *grid, *o, *snap, *box;
const char *path;
 
win = efl_add(EFL_UI_WIN_STANDARD_CLASS, NULL,
@@ -141,19 +170,32 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object 
*obj EINA_UNUSED, void *e
efl_event_callback_add(efl_added, ELM_SLIDER_EVENT_CHANGED, 
_radius_set, win),
efl_gfx_visible_set(efl_added, 1));
 
+   box = efl_add(EFL_UI_BOX_CLASS, win,
+ efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
+ efl_pack_grid(grid, efl_added, 0, GRID_SIZE + 1, GRID_SIZE, 
1),
+ efl_gfx_visible_set(efl_added, 1));
+
efl_add(ELM_BUTTON_CLASS, win,
efl_text_set(efl_added, "Toggle animation"),
efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
-   efl_pack_grid(grid, efl_added, 0, GRID_SIZE + 1, (GRID_SIZE + 1) / 
2, 1),
+   efl_pack(box, efl_added),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, 
_anim_toggle, win),
efl_gfx_visible_set(efl_added, 1));
 
efl_add(ELM_BUTTON_CLASS, win,
+   efl_text_set(efl_added, "Save to file"),
+   efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
+   efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
+   efl_pack(box, efl_added),
+   efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, 
_save_image, win),
+   efl_gfx_visible_set(efl_added, 1));
+
+   efl_add(ELM_BUTTON_CLASS, win,
efl_text_set(efl_added, "Close"),
efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
-   efl_pack_grid(grid, efl_added, (GRID_SIZE + 1) / 2, GRID_SIZE + 1, 
(GRID_SIZE + 1) / 2, 1),
+   efl_pack(box, efl_added),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _close, 
win),
efl_gfx_visible_set(efl_added, 1));
 
diff --git a/src/lib/evas/canvas/efl_canvas_snapshot.c 
b/src/lib/evas/canvas/efl_canvas_snapshot.c
index 

[EGIT] [core/efl] master 07/53: evas filters: Move transform to software generic (7/8)

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=46542ea74884675fcdae77a05b88e3d1cfa62e86

commit 46542ea74884675fcdae77a05b88e3d1cfa62e86
Author: Jean-Philippe Andre 
Date:   Tue Jan 17 21:09:18 2017 +0900

evas filters: Move transform to software generic (7/8)
---
 src/Makefile_Evas.am  |  2 +-
 src/lib/evas/filters/evas_filter.c|  3 ---
 src/lib/evas/filters/evas_filter_private.h|  1 -
 src/modules/evas/engines/software_generic/evas_engine.c   |  1 +
 .../engines/software_generic/filters/evas_engine_filter.h |  1 +
 .../software_generic}/filters/evas_filter_transform.c | 15 +--
 6 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 713a28e..061744a 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -594,7 +594,6 @@ lib/evas/canvas/evas_filter_mixin.c \
 lib/evas/filters/evas_filter.c \
 lib/evas/filters/evas_filter_blur.c \
 lib/evas/filters/evas_filter_parser.c \
-lib/evas/filters/evas_filter_transform.c \
 lib/evas/filters/evas_filter_utils.c \
 lib/evas/filters/evas_filter_private.h
 
@@ -618,6 +617,7 @@ 
modules/evas/engines/software_generic/filters/evas_filter_curve.c \
 modules/evas/engines/software_generic/filters/evas_filter_displace.c \
 modules/evas/engines/software_generic/filters/evas_filter_fill.c \
 modules/evas/engines/software_generic/filters/evas_filter_mask.c \
+modules/evas/engines/software_generic/filters/evas_filter_transform.c \
 $(NULL)
 
 ### Engine Ector stuff
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 895ca4e..f3ea207 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -1541,9 +1541,6 @@ _filter_command_run(Evas_Filter_Command *cmd)
case EVAS_FILTER_MODE_BLUR:
  func = evas_filter_blur_cpu_func_get(cmd);
  break;
-   case EVAS_FILTER_MODE_TRANSFORM:
- func = evas_filter_transform_cpu_func_get(cmd);
- break;
default:
  CRI("Invalid filter mode.");
  break;
diff --git a/src/lib/evas/filters/evas_filter_private.h 
b/src/lib/evas/filters/evas_filter_private.h
index 3be64de..bdbfd80 100644
--- a/src/lib/evas/filters/evas_filter_private.h
+++ b/src/lib/evas/filters/evas_filter_private.h
@@ -263,7 +263,6 @@ void 
evas_filter_context_source_set(Evas_Filter_Context *ctx
 /* FIXME: CPU filters entry points. Move these to the Evas Engine itself. */
 Evas_Filter_Apply_Func   evas_filter_blur_cpu_func_get(Evas_Filter_Command 
*cmd);
 Evas_Filter_Apply_Func   evas_filter_bump_map_cpu_func_get(Evas_Filter_Command 
*cmd);
-Evas_Filter_Apply_Func   
evas_filter_transform_cpu_func_get(Evas_Filter_Command *cmd);
 
 /* Utility functions */
 void _clip_to_target(int *sx, int *sy, int sw, int sh, int ox, int oy, int dw, 
int dh, int *dx, int *dy, int *rows, int *cols);
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c 
b/src/modules/evas/engines/software_generic/evas_engine.c
index ff89abd..9bc0436 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -4633,6 +4633,7 @@ _gfx_filter_func_get(Evas_Filter_Command *cmd)
   case EVAS_FILTER_MODE_DISPLACE: func = 
eng_filter_displace_func_get(cmd); break;
   case EVAS_FILTER_MODE_FILL: func = eng_filter_fill_func_get(cmd); break;
   case EVAS_FILTER_MODE_MASK: func = eng_filter_mask_func_get(cmd); break;
+  case EVAS_FILTER_MODE_TRANSFORM: func = 
eng_filter_transform_func_get(cmd); break;
   default: return NULL;
  }
 
diff --git 
a/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h 
b/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
index 31a326c..2ae3618 100644
--- a/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
+++ b/src/modules/evas/engines/software_generic/filters/evas_engine_filter.h
@@ -10,5 +10,6 @@ Evas_Filter_Apply_Func 
eng_filter_curve_func_get(Evas_Filter_Command *cmd);
 Evas_Filter_Apply_Func eng_filter_displace_func_get(Evas_Filter_Command *cmd);
 Evas_Filter_Apply_Func eng_filter_fill_func_get(Evas_Filter_Command *cmd);
 Evas_Filter_Apply_Func eng_filter_mask_func_get(Evas_Filter_Command *cmd);
+Evas_Filter_Apply_Func eng_filter_transform_func_get(Evas_Filter_Command *cmd);
 
 #endif // EVAS_ENGINE_FILTER_H
diff --git a/src/lib/evas/filters/evas_filter_transform.c 
b/src/modules/evas/engines/software_generic/filters/evas_filter_transform.c
similarity index 87%
rename from src/lib/evas/filters/evas_filter_transform.c
rename to 
src/modules/evas/engines/software_generic/filters/evas_filter_transform.c
index db90147..31354e8 100644
--- a/src/lib/evas/filters/evas_filter_transform.c
+++ 

[EGIT] [core/efl] master 38/53: evas filters: Switch to uniforms in GL blur

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=06a7beec529d741d9060878ce1fb740cf57804ad

commit 06a7beec529d741d9060878ce1fb740cf57804ad
Author: Jean-Philippe Andre 
Date:   Tue Mar 28 14:44:17 2017 +0900

evas filters: Switch to uniforms in GL blur

This was a poor attempt at improving the performance but
obviously the root cause isn't fixed (too many texel fetches).

Uniform should (theoretically) work better than an attribute
the for loop. Just a guess here.

This also makes GL blur use a float value as radius, allowing
future extension to non-integer blur radii, as well as using
linear scaling as a fast blur approximation.
---
 src/lib/evas/filters/evas_filter.c | 33 ++---
 src/lib/evas/filters/evas_filter_private.h |  2 +-
 .../evas/engines/gl_common/evas_gl_common.h| 29 ++--
 .../evas/engines/gl_common/evas_gl_context.c   | 81 ++
 .../evas/engines/gl_common/evas_gl_shader.c|  6 ++
 .../engines/gl_common/shader/evas_gl_shaders.x | 39 +--
 .../evas/engines/gl_common/shader/fragment.glsl| 30 
 .../evas/engines/gl_common/shader/vertex.glsl  | 11 ---
 .../engines/gl_generic/filters/gl_filter_blur.c|  2 +-
 .../software_generic/filters/evas_filter_blur.c|  4 +-
 10 files changed, 144 insertions(+), 93 deletions(-)

diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 5ed3ba8..f08926e 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -660,8 +660,8 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
 int R, int G, int B, int A)
 {
Evas_Filter_Command *cmd;
-   Evas_Filter_Buffer *dx_in, *dx_out, *dy_in, *tmp = NULL;
-   int dx, dy;
+   Evas_Filter_Buffer *dx_in, *dx_out, *dy_in, *dy_out, *tmp = NULL;
+   double dx, dy;
 
/* GL blur implementation:
 * - Create intermediate buffer T (variable size)
@@ -677,16 +677,18 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
dx = rx;
dy = ry;
dx_in = in;
+   dy_out = out;
 
+#if 0
if (type == EVAS_FILTER_BLUR_DEFAULT)
  {
 int down_x = 1, down_y = 1;
 
 /* For now, disable scaling - testing perfect gaussian blur until it's
- * ready:
+ * ready: */
 down_x = MAX((1 << evas_filter_smallest_pow2_larger_than(dx / 2) / 2), 
1);
 down_y = MAX((1 << evas_filter_smallest_pow2_larger_than(dy / 2) / 2), 
1);
-*/
+
 
 tmp = evas_filter_temporary_buffer_get(ctx, ctx->w / down_x, ctx->h / 
down_y,
in->alpha_only, EINA_TRUE);
@@ -701,11 +703,17 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
 if (!cmd) goto fail;
 cmd->draw.fillmode = EVAS_FILTER_FILL_MODE_STRETCH_XY;
 dx_in = tmp;
+
+tmp = evas_filter_temporary_buffer_get(ctx, ctx->w / down_x, ctx->h / 
down_y,
+   in->alpha_only, EINA_TRUE);
+if (!tmp) goto fail;
+dy_out = tmp;
  }
+#endif
 
if (dx && dy)
  {
-tmp = evas_filter_temporary_buffer_get(ctx, 0, 0, in->alpha_only, 1);
+tmp = evas_filter_temporary_buffer_get(ctx, dx_in->w, dx_in->h, 
in->alpha_only, 1);
 if (!tmp) goto fail;
 dy_in = dx_out = tmp;
  }
@@ -717,7 +725,7 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
 
if (dx)
  {
-XDBG("Add GL blur %d -> %d (%dx%d px)", dx_in->id, dx_out->id, dx, 0);
+XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dx_in->id, dx_out->id, dx, 
0.0);
 cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dx_in, NULL, dx_out);
 if (!cmd) goto fail;
 cmd->blur.type = type;
@@ -727,14 +735,23 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
 
if (dy)
  {
-XDBG("Add GL blur %d -> %d (%dx%d px)", dy_in->id, out->id, 0, dy);
-cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dy_in, NULL, out);
+XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dy_in->id, dy_out->id, 
0.0, dy);
+cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dy_in, NULL, dy_out);
 if (!cmd) goto fail;
 cmd->blur.type = type;
 cmd->blur.dy = dy;
 cmd->blur.count = count;
  }
 
+   if (cmd->output != out)
+ {
+XDBG("Add GL upscale %d (%dx%d) -> %d (%dx%d)",
+ cmd->output->id, cmd->output->w, cmd->output->h, out->id, out->w, 
out->h);
+cmd = _command_new(ctx, EVAS_FILTER_MODE_BLEND, cmd->output, NULL, 
out);
+if (!cmd) goto fail;
+cmd->draw.fillmode = EVAS_FILTER_FILL_MODE_STRETCH_XY;
+ }
+
cmd->draw.ox = ox;
cmd->draw.oy = oy;
DRAW_COLOR_SET(R, G, B, A);
diff --git a/src/lib/evas/filters/evas_filter_private.h 
b/src/lib/evas/filters/evas_filter_private.h

[EGIT] [core/efl] master 53/53: evas gl: Fix compilation for EGL

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d87a65e825eefb499ead5bd2ae8e160e93d6db0b

commit d87a65e825eefb499ead5bd2ae8e160e93d6db0b
Author: Jean-Philippe Andre 
Date:   Fri Apr 14 13:43:09 2017 +0900

evas gl: Fix compilation for EGL
---
 src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.c   | 7 ++-
 src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c | 8 ++--
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.c 
b/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.c
index 108a1c9..63af1d1 100644
--- a/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.c
+++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.c
@@ -5,13 +5,10 @@
 #define ECTOR_GL_BUFFER_BASE_PROTECTED
 
 #include "evas_common_private.h"
+#include "evas_gl_private.h"
 
+#include 
 #include 
-#include "gl/ector_gl_private.h"
-#include "evas_common_private.h"
-#include "../gl_common/evas_gl_common.h"
-#include "evas_private.h"
-#include "ector_buffer.h"
 #include "Evas_Engine_GL_Generic.h"
 
 #include "evas_ector_buffer.eo.h"
diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c 
b/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c
index d6be151..360882f 100644
--- a/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c
+++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c
@@ -7,17 +7,13 @@
 #define ECTOR_GL_BUFFER_BASE_PROTECTED
 
 #include "evas_common_private.h"
+#include "evas_gl_private.h"
 
+#include 
 #include 
-#include "gl/ector_gl_private.h"
-#include "evas_common_private.h"
-#include "../gl_common/evas_gl_common.h"
-#include "evas_private.h"
-#include "ector_buffer.h"
 #include "Evas_Engine_GL_Generic.h"
 
 #include "evas_ector_buffer.eo.h"
-#include "evas_ector_gl_buffer.eo.h"
 #include "evas_ector_gl_image_buffer.eo.h"
 #include "evas_gl_private.h"
 

-- 




Re: [E-devel] Committer access proposal: Conr2d

2017-04-13 Thread 조재현
+1 :)
I was also confused that conr2d already had a full commit access.. ;)

-Original Message-
보낸사람: "WooHyun Jung" woohyun0...@gmail.com
받는사람: "Enlightenment developer list" 
enlightenment-devel@lists.sourceforge.net
날짜: 2017.04.14 오전 11:29:28
제목: Re: [E-devel] Committer access proposal: Conr2d



+1 :)

2017. 4. 14. 오전 10:50에 "Jean-Philippe André" j...@videolan.org님이 작성:

 Hi,

 I realized today that Jeeyong Um, also known as Conr2d, still has probie
 but not full commit access.

 I think he does a very good work, provides many careful patches and
 participates well in the community. Does anyone have any objection to
 giving him full commit access?

 Best regards,

 --
 Jean-Philippe André
 
 --
 Check out the vibrant tech community on one of the world's most
 engaging tech sites, Slashdot.org! http://sdm.link/slashdot
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Committer access proposal: Conr2d

2017-04-13 Thread WooHyun Jung
+1 :)

2017. 4. 14. 오전 10:50에 "Jean-Philippe André" 님이 작성:

> Hi,
>
> I realized today that Jeeyong Um, also known as Conr2d, still has probie
> but not full commit access.
>
> I think he does a very good work, provides many careful patches and
> participates well in the community. Does anyone have any objection to
> giving him full commit access?
>
> Best regards,
>
> --
> Jean-Philippe André
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] efl-1.19 01/01: Efl.Gfx.Path: Fix wrong condition check in _find_ellipsis_coords

2017-04-13 Thread Jeeyong Um
jpeg pushed a commit to branch efl-1.19.

http://git.enlightenment.org/core/efl.git/commit/?id=e2febfd5953d84bcfea16dc925666117b84e954d

commit e2febfd5953d84bcfea16dc925666117b84e954d
Author: Jeeyong Um 
Date:   Fri Apr 14 10:16:48 2017 +0900

Efl.Gfx.Path: Fix wrong condition check in _find_ellipsis_coords

Summary:
In previous patch, !w should be replaced with EINA_FLT_EQ(w, 0.0), but it 
was
replaced with !EINA_FLT_EQ(w, 0.0). This breaks rounded rectangle.

T5291

Test Plan: compile and run attached file

Reviewers: cedric, jpeg, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D4787
---
 src/lib/efl/interfaces/efl_gfx_path.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/efl/interfaces/efl_gfx_path.c 
b/src/lib/efl/interfaces/efl_gfx_path.c
index 964ca2b..e593cbf 100644
--- a/src/lib/efl/interfaces/efl_gfx_path.c
+++ b/src/lib/efl/interfaces/efl_gfx_path.c
@@ -799,7 +799,7 @@ _find_ellipse_coords(double x, double y, double w, double 
h, double angle,
double angles[2] = { angle, angle + length };
Point *points[2];
 
-   if (!EINA_FLT_EQ(w, 0.0) || !EINA_FLT_EQ(h, 0.0))
+   if (EINA_FLT_EQ(w, 0.0) || EINA_FLT_EQ(h, 0.0))
  {
 if (start_point)
   {

-- 




[EGIT] [core/efl] efl-1.19 01/01: evas filters: Prevent crash with async sw rendering

2017-04-13 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch efl-1.19.

http://git.enlightenment.org/core/efl.git/commit/?id=2b90533e37f2e3c746589155b91648b18d516d32

commit 2b90533e37f2e3c746589155b91648b18d516d32
Author: Jean-Philippe Andre 
Date:   Thu Apr 13 17:57:47 2017 +0900

evas filters: Prevent crash with async sw rendering
---
 src/lib/evas/canvas/evas_filter_mixin.c | 13 -
 src/lib/evas/filters/evas_filter.c  |  5 +++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/lib/evas/canvas/evas_filter_mixin.c 
b/src/lib/evas/canvas/evas_filter_mixin.c
index b19e4e6..b2aeadb 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -64,6 +64,7 @@ _filter_end_sync(Evas_Filter_Context *ctx, 
Evas_Object_Protected_Data *obj,
// Destroy context as we won't reuse it.
evas_filter_buffer_backing_release(ctx, previous);
evas_filter_context_destroy(ctx);
+   efl_unref(eo_obj);
 }
 
 static void
@@ -87,12 +88,8 @@ _filter_cb(Evas_Filter_Context *ctx, void *data, Eina_Bool 
success)
Evas_Object_Protected_Data *obj;
Evas_Filter_Data *pd = data;
 
-#ifdef DEBUG
-   EINA_SAFETY_ON_FALSE_RETURN(!eina_main_loop_is());
-#endif
-
obj = pd->data->obj;
-   EINA_SAFETY_ON_FALSE_RETURN(obj && obj->layer && obj->layer->evas);
+   EVAS_OBJECT_DATA_VALID_CHECK(obj);
 
if (!pd->data->async)
  {
@@ -100,6 +97,10 @@ _filter_cb(Evas_Filter_Context *ctx, void *data, Eina_Bool 
success)
 return;
  }
 
+#ifdef DEBUG
+   EINA_SAFETY_ON_FALSE_RETURN(!eina_main_loop_is());
+#endif
+
post_data = calloc(1, sizeof(*post_data));
post_data->success = success;
post_data->ctx = ctx;
@@ -315,6 +316,7 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 ENFN->context_free(ENDT, drawctx);
 
 // Add post-run callback and run filter
+efl_ref(eo_obj);
 evas_filter_context_post_run_callback_set(filter, _filter_cb, pd);
 ok = evas_filter_run(filter);
 
@@ -332,6 +334,7 @@ evas_filter_object_render(Eo *eo_obj, 
Evas_Object_Protected_Data *obj,
 else
   {
  ERR("Rendering failed.");
+ efl_unref(eo_obj);
  return EINA_FALSE;
   }
  }
diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 9438a4e..98700cd 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -1609,7 +1609,7 @@ evas_filter_run(Evas_Filter_Context *ctx)
EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE);
 
if (!ctx->commands)
- return EINA_TRUE;
+ return EINA_FALSE;
 
if (ENFN->gl_surface_read_pixels && !warned)
  {
@@ -1627,7 +1627,8 @@ evas_filter_run(Evas_Filter_Context *ctx)
 
if (ctx->post_run.cb)
  ctx->post_run.cb(ctx, ctx->post_run.data, ret);
-   return ret;
+
+   return EINA_TRUE;
 }
 
 

-- 




[E-devel] Committer access proposal: Conr2d

2017-04-13 Thread Jean-Philippe André
Hi,

I realized today that Jeeyong Um, also known as Conr2d, still has probie
but not full commit access.

I think he does a very good work, provides many careful patches and
participates well in the community. Does anyone have any objection to
giving him full commit access?

Best regards,

-- 
Jean-Philippe André
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] master 01/01: Efl.Gfx.Path: Fix wrong condition check in _find_ellipsis_coords

2017-04-13 Thread Jeeyong Um
jaehyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f370ea803b977c245f173bae1b3b904e9bb68e38

commit f370ea803b977c245f173bae1b3b904e9bb68e38
Author: Jeeyong Um 
Date:   Fri Apr 14 10:16:48 2017 +0900

Efl.Gfx.Path: Fix wrong condition check in _find_ellipsis_coords

Summary:
In previous patch, !w should be replaced with EINA_FLT_EQ(w, 0.0), but it 
was
replaced with !EINA_FLT_EQ(w, 0.0). This breaks rounded rectangle.

T5291

Test Plan: compile and run attached file

Reviewers: cedric, jpeg, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D4787
---
 src/lib/efl/interfaces/efl_gfx_path.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/efl/interfaces/efl_gfx_path.c 
b/src/lib/efl/interfaces/efl_gfx_path.c
index 964ca2b..e593cbf 100644
--- a/src/lib/efl/interfaces/efl_gfx_path.c
+++ b/src/lib/efl/interfaces/efl_gfx_path.c
@@ -799,7 +799,7 @@ _find_ellipse_coords(double x, double y, double w, double 
h, double angle,
double angles[2] = { angle, angle + length };
Point *points[2];
 
-   if (!EINA_FLT_EQ(w, 0.0) || !EINA_FLT_EQ(h, 0.0))
+   if (EINA_FLT_EQ(w, 0.0) || EINA_FLT_EQ(h, 0.0))
  {
 if (start_point)
   {

-- 




[EGIT] [core/efl] master 02/02: evas: move Efl_Canvas_Output to be an internal only API.

2017-04-13 Thread Cedric BAIL
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9883831b761c9a7e4681a259487fbfd07d1a0d9f

commit 9883831b761c9a7e4681a259487fbfd07d1a0d9f
Author: Cedric BAIL 
Date:   Thu Apr 13 15:25:29 2017 -0700

evas: move Efl_Canvas_Output to be an internal only API.
---
 src/Makefile_Evas.am   |   2 +-
 src/lib/evas/Evas_Common.h |   4 -
 src/lib/evas/Evas_Internal.h   |  56 ++
 src/lib/evas/canvas/efl_canvas_output.eo   |  55 -
 src/lib/evas/canvas/evas_main.c|   4 +-
 src/lib/evas/canvas/evas_out.c | 172 ++---
 src/lib/evas/include/evas_common_private.h |   2 +
 7 files changed, 144 insertions(+), 151 deletions(-)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index b2f4885..a1f3789 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -50,7 +50,6 @@ evas_eolian_pub_files = \
lib/evas/canvas/efl_input_hold.eo \
lib/evas/canvas/efl_input_focus.eo \
lib/evas/canvas/efl_gfx_map.eo \
-   lib/evas/canvas/efl_canvas_output.eo \
$(NULL)
 
 evas_eolian_legacy_files = \
@@ -114,6 +113,7 @@ dist_installed_evascanvasheaders_DATA = 
lib/evas/canvas/evas_textblock_legacy.h
 noinst_DATA += $(evas_eolian_priv_h)
 
 noinst_HEADERS += \
+lib/evas/Evas_Internal.h \
 lib/evas/include/evas_inline.x \
 lib/evas/include/evas_private.h \
 lib/evas/include/evas_options.h \
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index 59f11a0..0844260 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -3569,10 +3569,6 @@ EAPI Eina_Bool
evas_seat_key_lock_is_set(const Evas_Lock *l, const ch
  * @ingroup Evas_Canvas
  */
 
-typedef Eo Evas_Out;
-
-#define _EVAS_OUT_EO_CLASS_TYPE
-
 /**
  * @ingroup Evas_Font_Group
  *
diff --git a/src/lib/evas/Evas_Internal.h b/src/lib/evas/Evas_Internal.h
new file mode 100644
index 000..79a1806
--- /dev/null
+++ b/src/lib/evas/Evas_Internal.h
@@ -0,0 +1,56 @@
+/* This header is not to be installed and should only be used by EFL internals 
*/
+#ifndef _EVAS_INTERNAL_H
+#define _EVAS_INTERNAL_H
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef EFL_EVAS_BUILD
+#  ifdef DLL_EXPORT
+#   define EAPI __declspec(dllexport)
+#  else
+#   define EAPI
+#  endif /* ! DLL_EXPORT */
+# else
+#  define EAPI __declspec(dllimport)
+# endif /* ! EFL_EVAS_BUILD */
+#else
+# ifdef __GNUC__
+#  if __GNUC__ >= 4
+#   define EAPI __attribute__ ((visibility("default")))
+#  else
+#   define EAPI
+#  endif
+# else
+#  define EAPI
+# endif
+#endif /* ! _WIN32 */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _Efl_Canvas_Output Efl_Canvas_Output;
+
+EAPI Efl_Canvas_Output *efl_canvas_output_add(Evas *canvas);
+EAPI void efl_canvas_output_del(Efl_Canvas_Output *output);
+EAPI void efl_canvas_output_view_set(Efl_Canvas_Output *output,
+ Evas_Coord x, Evas_Coord y, Evas_Coord w, 
Evas_Coord h);
+EAPI void efl_canvas_output_view_get(Efl_Canvas_Output *output,
+ Evas_Coord *x, Evas_Coord *y, Evas_Coord 
*w, Evas_Coord *h);
+EAPI Eina_Bool efl_canvas_output_engine_info_set(Efl_Canvas_Output *output,
+ Evas_Engine_Info *info);
+EAPI Evas_Engine_Info *efl_canvas_output_engine_info_get(Efl_Canvas_Output 
*output);
+EAPI Eina_Bool efl_canvas_output_lock(Efl_Canvas_Output *output);
+EAPI Eina_Bool efl_canvas_output_unlock(Efl_Canvas_Output *output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#undef EAPI
+#define EAPI
+
+#endif
diff --git a/src/lib/evas/canvas/efl_canvas_output.eo 
b/src/lib/evas/canvas/efl_canvas_output.eo
deleted file mode 100644
index 3e1441f..000
--- a/src/lib/evas/canvas/efl_canvas_output.eo
+++ /dev/null
@@ -1,55 +0,0 @@
-import evas_types;
-
-class Efl.Canvas.Output (Efl.Object, Efl.Gfx.Buffer)
-{
-   [[Efl canvas output class]]
-   methods {
-  @property view {
- set {
-[[Sets the viewport region of the canvas that the output displays.
-
-  This sets both the viewport region in the canvas that displays
-  on the given output, but also the viewport size will match the 
-  output resolution 1:1.]]
- }
- get {
-[[Gets the viewport region of the canvas that the output 
displays.]]
- }
- values {
-x: Evas.Coord; [[X coordinate viewport]]
-y: Evas.Coord; [[Y coordinate viewport]] 
-w: Evas.Coord; [[Viewport width]]
-h: Evas.Coord; [[Viewport height]]
- }
-  }
-  lock {
- [[Lock this output and prevent rendering any buffer associated to 
it.]]
- return: bool; [[$true on success, $false otherwise]]
-  }
-  unlock {
- [[Unlock this output and will rendering of this buffer during next 
call to 

[EGIT] [core/efl] master 01/02: evas: this symbol actually don't exist.

2017-04-13 Thread Cedric BAIL
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=969112a36d3a1af008668533eff5022d6c554ac4

commit 969112a36d3a1af008668533eff5022d6c554ac4
Author: Cedric BAIL 
Date:   Thu Apr 13 14:39:46 2017 -0700

evas: this symbol actually don't exist.
---
 src/lib/evas/Evas_Legacy.h | 28 
 1 file changed, 28 deletions(-)

diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 586f3b7..673cbdc 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -5892,34 +5892,6 @@ EAPI Evas_Object   *evas_object_grid_add(Evas *evas) 
EINA_WARN_UNUSED_RESULT EIN
  */
 
 /**
- *
- * Adds an output to the canvas
- *
- * @parem e The canvas to add the output to
- * @return The output
- *
- * @see evas_out_engine_info_set
- * @see evas_output_viewport_set
- * @see evas_output_size_set
- *
- * @since 1.8
- */
-EAPI Evas_Out *evas_out_add(Evas *e);
-
-/**
- *
- * Deletes an output
- *
- * @parem evo The output object
- *
- * @see evas_out_add
- *
- * @since 1.8
- *
- */
-EAPI void evas_output_del(Evas_Out *evo);
-
-/**
  * @brief Sets the output framespace size of the render engine of the given
  * evas.
  *

-- 




Re: [E-devel] Enlightenment on OpenIndiana

2017-04-13 Thread Aurélien Larcher
Hi,

With the help of Vincent I disabled the epoll check for solaris based
> systems now. This will be part of the 1.19 release I prepare right now.
>

Thank you, this is perfect for now.

>
> Once it is out I would appreciate if you could test it. If we missed
> anything else we could put that into the 1.19.1 release.
>

If will bump our package to 1.19 next week.
There is an ongoing discussion to decide if epoll should be "fixed" or if
we should use event port for EFL.
I am in touch with Vincent on a regular basis so you'll be updated as soon
as something comes out.

Kind regards

Aurelien



>
> regards
> Stefan Schmidt
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>



-- 
---
Praise the Caffeine embeddings
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] master 01/01: Revert "efl: terrible kludge so avoid termination crash on osx"

2017-04-13 Thread Stefan Schmidt
stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9a15eeacedf2266f995f80d49c0b1b68f3e0b13d

commit 9a15eeacedf2266f995f80d49c0b1b68f3e0b13d
Author: Stefan Schmidt 
Date:   Thu Apr 13 14:32:07 2017 +0200

Revert "efl: terrible kludge so avoid termination crash on osx"

The only purpose of this commit was to allow efl 1.19 to be
released on macOS wothout crashing on termination. Time to revert
it and see that we can find a real fix for the next release.

This reverts commit cd5e755951c0126f136b6e7cfded14056d8336fa.

ref T5245
---
 src/lib/elementary/elm_module.c  | 14 --
 src/lib/evas/common/evas_thread_render.c | 14 --
 2 files changed, 28 deletions(-)

diff --git a/src/lib/elementary/elm_module.c b/src/lib/elementary/elm_module.c
index a987c9e..03f70dc 100644
--- a/src/lib/elementary/elm_module.c
+++ b/src/lib/elementary/elm_module.c
@@ -190,22 +190,8 @@ _elm_module_unload(Elm_Module *m)
if (m->module)
  {
 if (m->shutdown_func) m->shutdown_func(m);
-#if defined(__APPLE__) && defined(__MACH__)
-   /*
-* FIXME
-*
-* MacOS currently undergo a fatal issue on shutdown: dlsym()
-* crashes. I still have no clue why... Sue to the imminent release,
-* let's NOT shutdown the module. Do nothing...
-*
-* THIS IS A TERRIBLE KLUDGE. IT MUST NOT STAY AFTER THE RELEASE OCCURS!
-*
-* FIXME
-*/
-#else
 eina_module_unload(m->module);
 eina_module_free(m->module);
-#endif
 m->module = NULL;
  }
m->shutdown_func = NULL;
diff --git a/src/lib/evas/common/evas_thread_render.c 
b/src/lib/evas/common/evas_thread_render.c
index e66acd5..8595566 100644
--- a/src/lib/evas/common/evas_thread_render.c
+++ b/src/lib/evas/common/evas_thread_render.c
@@ -220,21 +220,7 @@ evas_thread_shutdown(void)
   }
  }
 
-#if defined(__APPLE__) && defined(__MACH__)
-   /*
-* FIXME
-*
-* MacOS currently undergo a fatal issue on shutdown: pthread_join()
-* crashes. I still have no clue why... Sue to the imminent release,
-* let's NOT join this thread: do nothing at all!
-*
-* THIS IS A TERRIBLE KLUDGE. IT MUST NOT STAY AFTER THE RELEASE OCCURS!
-*
-* FIXME
-*/
-#else
eina_thread_join(evas_thread_worker);
-#endif
 timeout_shutdown:
eina_lock_free(_thread_queue_lock);
eina_condition_free(_thread_queue_condition);

-- 




[EGIT] [core/efl] master 01/01: eolian: allow extending eolian-generated classes from within C

2017-04-13 Thread Daniel Kolesa
q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=53fef30db0aecc191384dae81882b50eba79da1a

commit 53fef30db0aecc191384dae81882b50eba79da1a
Author: Daniel Kolesa 
Date:   Thu Apr 13 15:56:15 2017 +0200

eolian: allow extending eolian-generated classes from within C

If you define either the macro MY_CLASS_EXTRA_OPS for normal
methods/properties or MY_CLASS_EXTRA_CLASS_OPS for class methods
or properties, which contains a comma-delimited list of ops defs
(i.e. EFL_OBJECT_OP_FUNC(...), ...) right before including the
generated my_class.eo.c file, the definitions from these will
be included in the actual class. This can be used to override
certain things in a class internally without exposing it to
Eolian, or for testing/debugging.
---
 src/bin/eolian/sources.c | 51 +---
 src/tests/eolian/data/class_simple_ref.c | 18 +--
 src/tests/eolian/data/override_ref.c | 18 +--
 3 files changed, 65 insertions(+), 22 deletions(-)

diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index f264f53..6004a9e 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -532,12 +532,13 @@ _gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf)
  }
eina_iterator_free(itr);
 
-   char *cnamel = NULL;
-   eo_gen_class_names_get(cl, NULL, NULL, );
+   char *cnamel = NULL, *cnameu = NULL;
+   eo_gen_class_names_get(cl, NULL, , );
 
eina_strbuf_append(buf, "\nstatic Eina_Bool\n_");
eina_strbuf_append(buf, cnamel);
eina_strbuf_append(buf, "_class_initializer(Efl_Class *klass)\n{\n");
+   eina_strbuf_append(buf, "   const Efl_Object_Ops *opsp = NULL, *copsp = 
NULL;\n\n");
 
Eina_Strbuf *ops = eina_strbuf_new(), *cops = eina_strbuf_new();
 
@@ -584,37 +585,51 @@ _gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf)
  }
eina_iterator_free(itr);
 
-   /* strip the final comma before appending */
if (eina_strbuf_length_get(ops))
  {
-eina_strbuf_remove(ops, eina_strbuf_length_get(ops) - 2,
-   eina_strbuf_length_get(ops));
-eina_strbuf_append(ops, "\n   );\n");
+/* make sure the extras are defined */
+eina_strbuf_append_printf(buf, "#ifndef %s_EXTRA_OPS\n", cnameu);
+eina_strbuf_append_printf(buf, "#define %s_EXTRA_OPS\n", cnameu);
+eina_strbuf_append(buf, "#endif\n\n");
+
+eina_strbuf_append_printf(ops, "  %s_EXTRA_OPS\n   );\n", cnameu);
 eina_strbuf_append(buf, eina_strbuf_string_get(ops));
+eina_strbuf_append(buf, "   opsp = \n\n");
+ }
+   else
+ {
+/* no predefined, but if custom ones are required define it anyway */
+eina_strbuf_append_printf(buf, "#ifdef %s_EXTRA_OPS\n", cnameu);
+eina_strbuf_append_printf(buf, "   EFL_OPS_DEFINE(ops, 
%s_EXTRA_OPS);\n", cnameu);
+eina_strbuf_append(buf, "   opsp = \n");
+eina_strbuf_append(buf, "#endif\n\n");
  }
if (eina_strbuf_length_get(cops))
  {
-eina_strbuf_remove(cops, eina_strbuf_length_get(cops) - 2,
-   eina_strbuf_length_get(cops));
-eina_strbuf_append(cops, "\n   );\n");
+eina_strbuf_append_printf(buf, "#ifndef %s_EXTRA_CLASS_OPS\n", cnameu);
+eina_strbuf_append_printf(buf, "#define %s_EXTRA_CLASS_OPS\n", cnameu);
+eina_strbuf_append(buf, "#endif\n\n");
+
+eina_strbuf_append_printf(cops, "  %s_EXTRA_CLASS_OPS\n   );\n", 
cnameu);
 eina_strbuf_append(buf, eina_strbuf_string_get(cops));
+eina_strbuf_append(buf, "   copsp = \n\n");
  }
-
-   eina_strbuf_append(buf, "   return efl_class_functions_set(klass, ");
-   if (eina_strbuf_length_get(ops))
- eina_strbuf_append(buf, ", ");
-   else
- eina_strbuf_append(buf, "NULL, ");
-   if (eina_strbuf_length_get(cops))
- eina_strbuf_append(buf, ");\n");
else
- eina_strbuf_append(buf, "NULL);\n");
+ {
+eina_strbuf_append_printf(buf, "#ifdef %s_EXTRA_CLASS_OPS\n", cnameu);
+eina_strbuf_append_printf(buf, "   EFL_OPS_DEFINE(cops, 
%s_EXTRA_CLASS_OPS);\n", cnameu);
+eina_strbuf_append(buf, "   copsp = \n");
+eina_strbuf_append(buf, "#endif\n\n");
+ }
+
+   eina_strbuf_append(buf, "   return efl_class_functions_set(klass, opsp, 
copsp);\n");
 
eina_strbuf_free(ops);
eina_strbuf_free(cops);
 
eina_strbuf_append(buf, "}\n\n");
 
+   free(cnameu);
free(cnamel);
 
return EINA_TRUE;
diff --git a/src/tests/eolian/data/class_simple_ref.c 
b/src/tests/eolian/data/class_simple_ref.c
index baa47d6..ea0fdac 100644
--- a/src/tests/eolian/data/class_simple_ref.c
+++ b/src/tests/eolian/data/class_simple_ref.c
@@ -29,14 +29,28 @@ EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_bar, int *, 
NULL, EFL_FUNC_CALL(x)
 static Eina_Bool
 _class_simple_class_initializer(Efl_Class *klass)
 {
+   const 

[E-devel] Weekly news from the automated build and QA front

2017-04-13 Thread Stefan Schmidt
Hello.

Summary:
o Coverity builds are running again

This should give everyone an overview over what has happened in the last
week on the QA front. The numbers in parentheses reflect the values from
last week to give you a trend.

CI:
o Overall build statistic: 4.86% (5.14%) failed.
https://build.enlightenment.org/

Unit tests:
o N/A (N/A) unit tests for efl

Coverage:
o EFL total coverage is at N/A% (N/A%) lines, N/A% (N/A%) functions and 
N/A (N/A) branches
https://build.enlightenment.org/view/Test%20Coverage/

Coverity:
o EFL: Outstanding defects 46 (51) with a density of 0.04 (0.05)
o Enlightenment: Outstanding defects 2 (1) with a density of 0.01 (0)
o Terminology: Outstanding defects 0 (0) with a density of 0 (0)
o Rage: Outstanding defects 0 (0) with a density of 0 (0)

Phab:
o EFL bug count: 380 (363)
o E bug count: 406 (400)
https://phab.enlightenment.org/maniphest/report/burn/
o Pending patch reviews: 160 (164)

regards
Stefan Schmidt

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] master 03/03: efl vpath: Check and terminate execution if set*uid() calls fail

2017-04-13 Thread Bryce Harrington
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8b95b78dee42bf1f10ff48c9be4c34e5db8e6581

commit 8b95b78dee42bf1f10ff48c9be4c34e5db8e6581
Author: Bryce Harrington 
Date:   Thu Apr 13 16:41:02 2017 +0900

efl vpath: Check and terminate execution if set*uid() calls fail

Summary:
Quells warnings:
lib/efl/interfaces/efl_vpath_core.c:117:9: warning: ignoring return
value of ‘setuid’, declared with attribute warn_unused_result
[-Wunused-result]
 setuid(geteuid());
 ^
lib/efl/interfaces/efl_vpath_core.c:169:9: warning: ignoring return
value of ‘setreuid’, declared with attribute warn_unused_result
[-Wunused-result]
 setreuid(uid, geteuid());
 ^

Reviewers: raster, jpeg

Reviewed By: raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4768
---
 src/lib/efl/interfaces/efl_vpath_core.c | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_vpath_core.c 
b/src/lib/efl/interfaces/efl_vpath_core.c
index f3bff42..d6b1363 100644
--- a/src/lib/efl/interfaces/efl_vpath_core.c
+++ b/src/lib/efl/interfaces/efl_vpath_core.c
@@ -114,7 +114,13 @@ _efl_vpath_core_efl_object_constructor(Eo *obj, 
Efl_Vpath_Core_Data *pd)
 
 #if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
 uid = getuid();
-setuid(geteuid());
+if (setuid(geteuid()) != 0)
+   {
+  fprintf(stderr,
+  "FATAL: Cannot setuid - errno=%i\n",
+  errno);
+  abort();
+   }
 #endif
 // fallback - make ~/.run
 snprintf(buf, sizeof(buf), "%s/.run", home);
@@ -166,7 +172,13 @@ _efl_vpath_core_efl_object_constructor(Eo *obj, 
Efl_Vpath_Core_Data *pd)
}
   }
 #if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
-setreuid(uid, geteuid());
+if (setreuid(uid, geteuid()) != 0)
+   {
+  fprintf(stderr,
+  "FATAL: Cannot setreuid - errno=%i\n",
+  errno);
+  abort();
+   };
 #endif
  }
if (!s) s = (char *)efl_vpath_core_meta_get(obj, "tmp");

-- 




[EGIT] [core/efl] master 01/03: ecore_input: add API to get name of joystick.

2017-04-13 Thread Shinwoo Kim
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4f6873905be8f28971d5cf89bf395f6a4e6e7518

commit 4f6873905be8f28971d5cf89bf395f6a4e6e7518
Author: Shinwoo Kim 
Date:   Thu Apr 13 14:53:47 2017 +0900

ecore_input: add API to get name of joystick.

Summary:
The Ecore_Event_Joystick would be not enough information on user side.
Because the button index such as 
ECORE_EVENT_JOYSTICK_BUTTON_SELECT/START/META,
etc could be mapped to different button for different named joystick.

Test Plan: Using example

Reviewers: raster, cedric, jpeg

Reviewed By: raster

Differential Revision: https://phab.enlightenment.org/D4669
---
 src/examples/ecore/ecore_input_joystick_example.c |  4 
 src/lib/ecore_input/Ecore_Input.h | 11 ++
 src/lib/ecore_input/ecore_input_joystick.c| 25 +++
 3 files changed, 40 insertions(+)

diff --git a/src/examples/ecore/ecore_input_joystick_example.c 
b/src/examples/ecore/ecore_input_joystick_example.c
index c2c962b..a39f065 100644
--- a/src/examples/ecore/ecore_input_joystick_example.c
+++ b/src/examples/ecore/ecore_input_joystick_example.c
@@ -32,6 +32,10 @@ _joystick_event_handler_cb(void *data, int type EINA_UNUSED, 
void *event)
 break;
  }
 
+   const char *joystick_name;
+   joystick_name = ecore_input_joystick_name_get(ev->index);
+   printf("joystick name is: %s (index: %d)\n", joystick_name, ev->index);
+
if (ev->type == ECORE_EVENT_JOYSTICK_EVENT_TYPE_BUTTON &&
ev->button.index == ECORE_EVENT_JOYSTICK_BUTTON_START)
  ecore_main_loop_quit();
diff --git a/src/lib/ecore_input/Ecore_Input.h 
b/src/lib/ecore_input/Ecore_Input.h
index 4949ff7..c701301 100644
--- a/src/lib/ecore_input/Ecore_Input.h
+++ b/src/lib/ecore_input/Ecore_Input.h
@@ -478,6 +478,17 @@ extern "C" {
 */
EAPI int ecore_input_joystick_event_axis_deadzone_get(void);
 
+   /**
+* Get name of joystick
+*
+* This function returns the name string of the joysitck. If @p index
+* does not exist, or on error, this function returns NULL.
+*
+* @param index The index of joystick.
+* @return name of joystick.
+* @since 1.20
+*/
+   EAPI Eina_Slstr *ecore_input_joystick_name_get(int index);
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/lib/ecore_input/ecore_input_joystick.c 
b/src/lib/ecore_input/ecore_input_joystick.c
index 4f2fd11..7051597 100644
--- a/src/lib/ecore_input/ecore_input_joystick.c
+++ b/src/lib/ecore_input/ecore_input_joystick.c
@@ -621,3 +621,28 @@ ecore_input_joystick_event_axis_deadzone_get(void)
 {
return _event_axis_deadzone;
 }
+
+EAPI Eina_Slstr *
+ecore_input_joystick_name_get(int index)
+{
+#ifdef JSIOCGNAME
+   int fd;
+   char name[128];
+   Eina_List *l;
+   Joystick_Info *ji;
+
+   EINA_LIST_FOREACH(joystick_list, l, ji)
+ {
+if (index == ji->index)
+  {
+ fd = ecore_main_fd_handler_fd_get(ji->fd_handler);
+ if (fd < 0) return NULL;
+
+ if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0)
+strncpy(name, "Unknown", sizeof(name));
+ return eina_slstr_copy_new(name);
+  }
+ }
+#endif
+   return NULL;
+}

-- 




[EGIT] [core/efl] master 02/03: Genlist: Performance optimization for genlist in non-filter cases

2017-04-13 Thread Godly T.Alias
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5cba6a585715198c35488b2e664b5ad554c14b80

commit 5cba6a585715198c35488b2e664b5ad554c14b80
Author: Godly T.Alias 
Date:   Thu Apr 13 16:40:28 2017 +0900

Genlist: Performance optimization for genlist in non-filter cases

Summary:
When _item_filtered_get is called, block and pan re-calculations
happen, When there is no filter applied, we can skip item filtering to
avoid some unwanted calculations

Reviewers: cedric, raster, SanghyeonLee

Reviewed By: raster

Subscribers: rajeshps, Princekrdubey, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4759
---
 src/lib/elementary/elm_genlist.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 6c36251..360bbcb 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -2320,7 +2320,8 @@ _item_block_position(Item_Block *itb, const int blk_idx)
 sd = it->item->wsd;
 if (sd->reorder_it == it) continue;
 
-if (!it->filtered) _item_filtered_get(it);
+if (!it->filtered && sd->filter_data && it->itc->func.filter_get)
+  _item_filtered_get(it);
 if (it->hide)
   {
  if (it->realized) evas_object_hide(VIEW(it));

-- 




[EGIT] [website/www-content] master 01/01: Wiki page fedora-start changed with summary [] by Philippe Jean Guillaumie

2017-04-13 Thread Philippe Jean Guillaumie
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=f7a1d2a9678845f672b44e3d2c49afecb7fc7a49

commit f7a1d2a9678845f672b44e3d2c49afecb7fc7a49
Author: Philippe Jean Guillaumie 
Date:   Thu Apr 13 01:15:40 2017 -0700

Wiki page fedora-start changed with summary [] by Philippe Jean Guillaumie
---
 pages/distros/fedora-start.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pages/distros/fedora-start.txt b/pages/distros/fedora-start.txt
index 64f00b7..17518ff 100644
--- a/pages/distros/fedora-start.txt
+++ b/pages/distros/fedora-start.txt
@@ -16,7 +16,7 @@ libXinerama-devel libXScrnSaver-devel libXtst-devel 
luajit-devel make \
 mesa-libgbm-devel mesa-libwayland-egl-devel openjpeg-devel openssl-devel 
pam-devel \
 perf poppler-cpp-devel pulseaudio-libs-devel scim-devel systemd-devel 
texlive-base \
 uuid-devel valgrind-devel wayland-devel wayland-protocols-devel \
-xine-lib-devel xorg-x11-server-Xephyr
+xcb-util-keysyms-devel xine-lib-devel xorg-x11-server-Xephyr
 
 
 Then go to [[../docs-efl-start]] to learn how to install the whole thing ;-)

-- 




[EGIT] [website/www-content] master 01/01: Wiki page ubuntu-start changed with summary [] by Philippe Jean Guillaumie

2017-04-13 Thread Philippe Jean Guillaumie
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=8f52a96e5735cb0c90082e89c7f49581b8cdaa7e

commit 8f52a96e5735cb0c90082e89c7f49581b8cdaa7e
Author: Philippe Jean Guillaumie 
Date:   Thu Apr 13 00:21:56 2017 -0700

Wiki page ubuntu-start changed with summary [] by Philippe Jean Guillaumie
---
 pages/distros/ubuntu-start.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pages/distros/ubuntu-start.txt b/pages/distros/ubuntu-start.txt
index 2f9f818..52cfa07 100644
--- a/pages/distros/ubuntu-start.txt
+++ b/pages/distros/ubuntu-start.txt
@@ -16,7 +16,7 @@ libpoppler-cpp-dev libpoppler-dev libpoppler-private-dev \
 libproxy-dev libpulse-dev libraw-dev librsvg2-dev libscim-dev \
 libsndfile1-dev libspectre-dev libssl-dev libsystemd-dev \
 libtiff5-dev libtool libudev-dev libudisks2-dev libunibreak-dev \
-libvlc-dev libwebp-dev libxcursor-dev libxine2-dev\
+libvlc-dev libwebp-dev libxcursor-dev libxine2-dev \
 libxinerama-dev libxkbfile-dev libxrandr-dev libxss-dev \
 libxtst-dev linux-tools-common texlive-base unity-greeter-badges \
 valgrind xserver-xephyr

-- 




[EGIT] [website/www-content] master 01/01: Wiki page fedora-start changed with summary [] by Philippe Jean Guillaumie

2017-04-13 Thread Philippe Jean Guillaumie
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=5cec44eb1ec2d8a36a0de8ca536fb81d119f8a41

commit 5cec44eb1ec2d8a36a0de8ca536fb81d119f8a41
Author: Philippe Jean Guillaumie 
Date:   Thu Apr 13 00:20:15 2017 -0700

Wiki page fedora-start changed with summary [] by Philippe Jean Guillaumie
---
 pages/distros/fedora-start.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pages/distros/fedora-start.txt b/pages/distros/fedora-start.txt
index ddba00a..64f00b7 100644
--- a/pages/distros/fedora-start.txt
+++ b/pages/distros/fedora-start.txt
@@ -15,7 +15,7 @@ libxkbcommon-devel libxkbfile-devel libXcursor-devel 
libXdamage-devel libXext-de
 libXinerama-devel libXScrnSaver-devel libXtst-devel luajit-devel make \
 mesa-libgbm-devel mesa-libwayland-egl-devel openjpeg-devel openssl-devel 
pam-devel \
 perf poppler-cpp-devel pulseaudio-libs-devel scim-devel systemd-devel 
texlive-base \
-uuid-devel valgrind-devel wayland-devel wayland-protocols-devel 
xcb-util-keysyms-devel \
+uuid-devel valgrind-devel wayland-devel wayland-protocols-devel \
 xine-lib-devel xorg-x11-server-Xephyr
 
 

-- 




[EGIT] [website/www-content] master 01/01: Wiki page ubuntu-start changed with summary [] by Philippe Jean Guillaumie

2017-04-13 Thread Philippe Jean Guillaumie
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=3e6db6fff648d7dd24a33514dc11a41292629e24

commit 3e6db6fff648d7dd24a33514dc11a41292629e24
Author: Philippe Jean Guillaumie 
Date:   Thu Apr 13 00:10:21 2017 -0700

Wiki page ubuntu-start changed with summary [] by Philippe Jean Guillaumie
---
 pages/distros/ubuntu-start.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pages/distros/ubuntu-start.txt b/pages/distros/ubuntu-start.txt
index d61700a..2f9f818 100644
--- a/pages/distros/ubuntu-start.txt
+++ b/pages/distros/ubuntu-start.txt
@@ -16,8 +16,8 @@ libpoppler-cpp-dev libpoppler-dev libpoppler-private-dev \
 libproxy-dev libpulse-dev libraw-dev librsvg2-dev libscim-dev \
 libsndfile1-dev libspectre-dev libssl-dev libsystemd-dev \
 libtiff5-dev libtool libudev-dev libudisks2-dev libunibreak-dev \
-libvlc-dev libwebp-dev libxcb-keysyms1-dev libxcursor-dev \
-libxine2-dev libxinerama-dev libxkbfile-dev libxrandr-dev libxss-dev \
+libvlc-dev libwebp-dev libxcursor-dev libxine2-dev\
+libxinerama-dev libxkbfile-dev libxrandr-dev libxss-dev \
 libxtst-dev linux-tools-common texlive-base unity-greeter-badges \
 valgrind xserver-xephyr
 

--