summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/evas/engines')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h4
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c96
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_shader.c7
-rw-r--r--src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x7
-rw-r--r--src/modules/evas/engines/gl_common/shader/fragment.glsl8
-rw-r--r--src/modules/evas/engines/gl_drm/evas_engine.c4
-rw-r--r--src/modules/evas/engines/gl_drm/evas_outbuf.c2
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c11
-rw-r--r--src/modules/evas/engines/gl_generic/filters/gl_engine_filter.h1
-rw-r--r--src/modules/evas/engines/gl_generic/filters/gl_filter_inverse_color.c53
-rw-r--r--src/modules/evas/engines/gl_generic/meson.build1
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c8
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c13
-rw-r--r--src/modules/evas/engines/software_generic/filters/evas_engine_filter.h1
-rw-r--r--src/modules/evas/engines/software_generic/filters/evas_filter_inverse_color.c57
-rw-r--r--src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h8
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c2
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_wl_main.c2
18 files changed, 256 insertions, 29 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 b2cf74b..0cc7f30 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -266,7 +266,8 @@ enum _Shader_Type {
266 SHD_FILTER_CURVE, 266 SHD_FILTER_CURVE,
267 SHD_FILTER_BLUR_X, 267 SHD_FILTER_BLUR_X,
268 SHD_FILTER_BLUR_Y, 268 SHD_FILTER_BLUR_Y,
269 SHD_FILTER_GRAYSCALE 269 SHD_FILTER_GRAYSCALE,
270 SHD_FILTER_INVERSE_COLOR
270}; 271};
271 272
272#define ARRAY_BUFFER_USE 500 273#define ARRAY_BUFFER_USE 500
@@ -682,6 +683,7 @@ void evas_gl_common_filter_blur_push(Evas_Engine_GL_Context *gc, Ev
682 double dx, double dy, double dw, double dh, const double * const values, const double * const offsets, int count, double radius, 683 double dx, double dy, double dw, double dh, const double * const values, const double * const offsets, int count, double radius,
683 Eina_Bool horiz, Eina_Bool alphaonly); 684 Eina_Bool horiz, Eina_Bool alphaonly);
684void evas_gl_common_filter_grayscale_push(Evas_Engine_GL_Context *gc, Evas_GL_Texture *tex, int x, int y, int w, int h); 685void evas_gl_common_filter_grayscale_push(Evas_Engine_GL_Context *gc, Evas_GL_Texture *tex, int x, int y, int w, int h);
686void evas_gl_common_filter_inverse_color_push(Evas_Engine_GL_Context *gc, Evas_GL_Texture *tex, int x, int y, int w, int h);
685 687
686int evas_gl_common_shader_program_init(Evas_GL_Shared *shared); 688int evas_gl_common_shader_program_init(Evas_GL_Shared *shared);
687void evas_gl_common_shader_program_shutdown(Evas_GL_Shared *shared); 689void 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 9178d3f..da36167 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -3771,6 +3771,99 @@ evas_gl_common_filter_grayscale_push(Evas_Engine_GL_Context *gc,
3771 if (!nomul) 3771 if (!nomul)
3772 PUSH_6_COLORS(pn, r, g, b, a); 3772 PUSH_6_COLORS(pn, r, g, b, a);
3773} 3773}
3774
3775void
3776evas_gl_common_filter_inverse_color_push(Evas_Engine_GL_Context *gc,
3777 Evas_GL_Texture *tex,
3778 int x, int y, int w, int h)
3779{
3780 double ox1, oy1, ox2, oy2, ox3, oy3, ox4, oy4, pw, ph;
3781 GLfloat tx1, ty1, tx2, ty2, tx3, ty3, tx4, ty4;
3782 GLfloat offsetx, offsety;
3783 int r, g, b, a, nomul = 0, pn;
3784 Evas_GL_Program *prog;
3785 Eina_Bool blend = EINA_TRUE;
3786 Eina_Bool smooth = EINA_TRUE;
3787 Shader_Type type = SHD_FILTER_INVERSE_COLOR;
3788
3789 r = R_VAL(&gc->dc->mul.col);
3790 g = G_VAL(&gc->dc->mul.col);
3791 b = B_VAL(&gc->dc->mul.col);
3792 a = A_VAL(&gc->dc->mul.col);
3793 if (gc->dc->render_op == EVAS_RENDER_COPY)
3794 blend = EINA_FALSE;
3795
3796 prog = evas_gl_common_shader_program_get(gc, type, NULL, 0, r, g, b, a,
3797 w, h, w, h, smooth, tex, EINA_FALSE,
3798 NULL, EINA_FALSE, EINA_FALSE, 0, 0,
3799 EINA_FALSE, NULL, &nomul, NULL);
3800
3801 _filter_data_flush(gc, prog);
3802 EINA_SAFETY_ON_NULL_RETURN(prog);
3803
3804 pn = _evas_gl_common_context_push(type, gc, tex, NULL, prog,
3805 x, y, w, h, blend, smooth,
3806 0, 0, 0, 0, 0, EINA_FALSE);
3807
3808 gc->pipe[pn].region.type = type;
3809 gc->pipe[pn].shader.prog = prog;
3810 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
3811 gc->pipe[pn].shader.cur_texm = 0;
3812 gc->pipe[pn].shader.tex_target = GL_TEXTURE_2D;
3813 gc->pipe[pn].shader.smooth = smooth;
3814 gc->pipe[pn].shader.mask_smooth = 0;
3815 gc->pipe[pn].shader.blend = blend;
3816 gc->pipe[pn].shader.render_op = gc->dc->render_op;
3817 gc->pipe[pn].shader.clip = 0;
3818 gc->pipe[pn].shader.cx = 0;
3819 gc->pipe[pn].shader.cy = 0;
3820 gc->pipe[pn].shader.cw = 0;
3821 gc->pipe[pn].shader.ch = 0;
3822 gc->pipe[pn].array.line = 0;
3823 gc->pipe[pn].array.use_vertex = 1;
3824 gc->pipe[pn].array.use_color = !nomul;
3825 gc->pipe[pn].array.use_texuv = 1;
3826 gc->pipe[pn].array.use_texuv2 = 0;
3827 gc->pipe[pn].array.use_texuv3 = 0;
3828 gc->pipe[pn].array.use_texsam = 0;
3829 gc->pipe[pn].array.use_mask = 0;
3830 gc->pipe[pn].array.use_masksam = 0;
3831
3832 pipe_region_expand(gc, pn, x, y, w, h);
3833 PIPE_GROW(gc, pn, 6);
3834
3835 _filter_data_alloc(gc, pn, 0);
3836
3837 pw = tex->pt->w;
3838 ph = tex->pt->h;
3839
3840 ox1 = x;
3841 oy1 = y;
3842 ox2 = x + w;
3843 oy2 = y;
3844 ox3 = x + w;
3845 oy3 = y + h;
3846 ox4 = x;
3847 oy4 = y + h;
3848
3849 offsetx = tex->x;
3850 offsety = tex->y;
3851
3852 tx1 = ((double)(offsetx) + ox1) / pw;
3853 ty1 = ((double)(offsety) + oy1) / ph;
3854 tx2 = ((double)(offsetx) + ox2) / pw;
3855 ty2 = ((double)(offsety) + oy2) / ph;
3856 tx3 = ((double)(offsetx) + ox3) / pw;
3857 ty3 = ((double)(offsety) + oy3) / ph;
3858 tx4 = ((double)(offsetx) + ox4) / pw;
3859 ty4 = ((double)(offsety) + oy4) / ph;
3860
3861 PUSH_6_VERTICES(pn, x, y, w, h);
3862 PUSH_6_QUAD(pn, tx1, ty1, tx2, ty2, tx3, ty3, tx4, ty4);
3863
3864 if (!nomul)
3865 PUSH_6_COLORS(pn, r, g, b, a);
3866}
3774// ---------------------------------------------------------------------------- 3867// ----------------------------------------------------------------------------
3775 3868
3776EAPI void 3869EAPI void
@@ -4208,7 +4301,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
4208 4301
4209 if (gc->pipe[i].array.line) 4302 if (gc->pipe[i].array.line)
4210 { 4303 {
4211 if (gc->pipe[i].array.anti_alias) 4304 //LINE_SMOOTH is supported at gles 1.x spec.
4305 if ((gc->gles_version == 1) && gc->pipe[i].array.anti_alias)
4212 { 4306 {
4213 glEnable(GL_BLEND); 4307 glEnable(GL_BLEND);
4214 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 4308 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_shader.c b/src/modules/evas/engines/gl_common/evas_gl_shader.c
index 7c33867..5702ce4 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_shader.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_shader.c
@@ -46,8 +46,9 @@ typedef enum {
46 SHADER_FLAG_FILTER_DIR_Y = (1 << 24), 46 SHADER_FLAG_FILTER_DIR_Y = (1 << 24),
47 SHADER_FLAG_FILTER_ALPHA_ONLY = (1 << 25), 47 SHADER_FLAG_FILTER_ALPHA_ONLY = (1 << 25),
48 SHADER_FLAG_FILTER_GRAYSCALE = (1 << 26), 48 SHADER_FLAG_FILTER_GRAYSCALE = (1 << 26),
49 SHADER_FLAG_FILTER_INVERSE_COLOR = (1 << 27),
49} Shader_Flag; 50} Shader_Flag;
50#define SHADER_FLAG_COUNT 27 51#define SHADER_FLAG_COUNT 28
51 52
52static const char *_shader_flags[SHADER_FLAG_COUNT] = { 53static const char *_shader_flags[SHADER_FLAG_COUNT] = {
53 "TEX", 54 "TEX",
@@ -77,6 +78,7 @@ static const char *_shader_flags[SHADER_FLAG_COUNT] = {
77 "FILTER_DIR_Y", 78 "FILTER_DIR_Y",
78 "ALPHA_ONLY", 79 "ALPHA_ONLY",
79 "FILTER_GRAYSCALE", 80 "FILTER_GRAYSCALE",
81 "FILTER_INVERSE_COLOR",
80}; 82};
81 83
82static Eina_Bool compiler_released = EINA_FALSE; 84static Eina_Bool compiler_released = EINA_FALSE;
@@ -829,6 +831,9 @@ evas_gl_common_shader_flags_get(Evas_GL_Shared *shared, Shader_Type type,
829 case SHD_FILTER_GRAYSCALE: 831 case SHD_FILTER_GRAYSCALE:
830 flags |= SHADER_FLAG_FILTER_GRAYSCALE; 832 flags |= SHADER_FLAG_FILTER_GRAYSCALE;
831 break; 833 break;
834 case SHD_FILTER_INVERSE_COLOR:
835 flags |= SHADER_FLAG_FILTER_INVERSE_COLOR;
836 break;
832 default: 837 default:
833 CRI("Impossible shader type."); 838 CRI("Impossible shader type.");
834 return 0; 839 return 0;
diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
index 73ca4be..d244b37 100644
--- a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
+++ b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
@@ -215,7 +215,12 @@ static const char fragment_glsl[] =
215 " c = vec4(c.a, c.a, c.a, c.a);\n" 215 " c = vec4(c.a, c.a, c.a, c.a);\n"
216 "#endif\n" 216 "#endif\n"
217 "#ifdef SHD_FILTER_GRAYSCALE\n" 217 "#ifdef SHD_FILTER_GRAYSCALE\n"
218 " c.rgb = 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;\n" 218 " c.r = 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;\n"
219 " c.g = c.r;\n"
220 " c.b = c.r;\n"
221 "#endif\n"
222 "#ifdef SHD_FILTER_INVERSE_COLOR\n"
223 " c.rgb = c.a - c.rgb;\n"
219 "#endif\n" 224 "#endif\n"
220 "#ifndef SHD_FILTER_BLUR\n" 225 "#ifndef SHD_FILTER_BLUR\n"
221 " gl_FragColor =\n" 226 " gl_FragColor =\n"
diff --git a/src/modules/evas/engines/gl_common/shader/fragment.glsl b/src/modules/evas/engines/gl_common/shader/fragment.glsl
index 39fccf1..0994796 100644
--- a/src/modules/evas/engines/gl_common/shader/fragment.glsl
+++ b/src/modules/evas/engines/gl_common/shader/fragment.glsl
@@ -231,7 +231,13 @@ vec4 fetch_pixel(float ox, float oy)
231#endif 231#endif
232 232
233#ifdef SHD_FILTER_GRAYSCALE 233#ifdef SHD_FILTER_GRAYSCALE
234 c.rgb = 0.3 * c.r + 0.59 * c.g + 0.11 * c.b; 234 c.r = 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;
235 c.g = c.r;
236 c.b = c.r;
237#endif
238
239#ifdef SHD_FILTER_INVERSE_COLOR
240 c.rgb = c.a - c.rgba;
235#endif 241#endif
236 242
237#ifndef SHD_FILTER_BLUR 243#ifndef SHD_FILTER_BLUR
diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c
index a5b4c7a..281ec9f 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -3,8 +3,6 @@
3#include "../gl_common/evas_gl_define.h" 3#include "../gl_common/evas_gl_define.h"
4#include "../software_generic/evas_native_common.h" 4#include "../software_generic/evas_native_common.h"
5 5
6#include <wayland-client.h>
7
8#ifdef HAVE_DLSYM 6#ifdef HAVE_DLSYM
9# include <dlfcn.h> /* dlopen,dlclose,etc */ 7# include <dlfcn.h> /* dlopen,dlclose,etc */
10#else 8#else
@@ -1461,7 +1459,7 @@ eng_image_native_set(void *engine, void *image, void *native)
1461 1459
1462 if (!n->ns_data.wl_surface.surface) 1460 if (!n->ns_data.wl_surface.surface)
1463 { 1461 {
1464 ERR("eglCreatePixmapSurface() for %p failed", wl_buf); 1462 WRN("eglCreatePixmapSurface() for %p failed", wl_buf);
1465 eina_hash_del(ob->gl_context->shared->native_wl_hash, 1463 eina_hash_del(ob->gl_context->shared->native_wl_hash,
1466 &wlid, img); 1464 &wlid, img);
1467 glsym_evas_gl_common_image_free(img); 1465 glsym_evas_gl_common_image_free(img);
diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c
index 9ea643c..4fa1252 100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -609,8 +609,6 @@ evas_outbuf_buffer_state_get(Outbuf *ob)
609 } 609 }
610 else 610 else
611 return MODE_FULL; 611 return MODE_FULL;
612
613 return ob->swap_mode;
614} 612}
615 613
616int 614int
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 3428cf5..ec14e2b 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -2712,14 +2712,15 @@ eng_ector_surface_cache_drop(void *engine, void *key)
2712 generic_cache_data_drop(e->software.surface_cache, key); 2712 generic_cache_data_drop(e->software.surface_cache, key);
2713} 2713}
2714 2714
2715static void 2715static Eina_Bool
2716eng_ector_begin(void *engine, void *surface, 2716eng_ector_begin(void *engine, void *surface,
2717 void *context EINA_UNUSED, Ector_Surface *ector, 2717 void *context EINA_UNUSED, Ector_Surface *ector,
2718 int x, int y, Eina_Bool clear, Eina_Bool do_async EINA_UNUSED) 2718 int x, int y, Eina_Bool do_async EINA_UNUSED)
2719{ 2719{
2720 if (use_gl) 2720 if (use_gl)
2721 { 2721 {
2722 //FIXME: No implementation yet 2722 //FIXME: No implementation yet
2723 return EINA_FALSE;
2723 } 2724 }
2724 else 2725 else
2725 { 2726 {
@@ -2729,16 +2730,17 @@ eng_ector_begin(void *engine, void *surface,
2729 int load_err; 2730 int load_err;
2730 2731
2731 glim = eng_image_data_get(engine, glim, EINA_TRUE, &pixels, &load_err,NULL); 2732 glim = eng_image_data_get(engine, glim, EINA_TRUE, &pixels, &load_err,NULL);
2733 if (!glim || !pixels) return EINA_FALSE;
2732 eng_image_stride_get(engine, glim, &stride); 2734 eng_image_stride_get(engine, glim, &stride);
2733 eng_image_size_get(engine, glim, &w, &h); 2735 eng_image_size_get(engine, glim, &w, &h);
2734 2736
2735 if (clear) memset(pixels, 0, stride * h); 2737 memset(pixels, 0, stride * h);
2736 2738
2737 // it just uses the software backend to draw for now 2739 // it just uses the software backend to draw for now
2738 ector_buffer_pixels_set(ector, pixels, w, h, stride, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE); 2740 ector_buffer_pixels_set(ector, pixels, w, h, stride, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
2739 ector_surface_reference_point_set(ector, x, y); 2741 ector_surface_reference_point_set(ector, x, y);
2740
2741 } 2742 }
2743 return EINA_TRUE;
2742} 2744}
2743 2745
2744static void 2746static void
@@ -3128,6 +3130,7 @@ _gfx_filter_func_get(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd)
3128 case EVAS_FILTER_MODE_MASK: funcptr = gl_filter_mask_func_get(re, cmd); break; 3130 case EVAS_FILTER_MODE_MASK: funcptr = gl_filter_mask_func_get(re, cmd); break;
3129 //case EVAS_FILTER_MODE_TRANSFORM: funcptr = gl_filter_transform_func_get(re, cmd); break; 3131 //case EVAS_FILTER_MODE_TRANSFORM: funcptr = gl_filter_transform_func_get(re, cmd); break;
3130 case EVAS_FILTER_MODE_GRAYSCALE: funcptr = gl_filter_grayscale_func_get(re, cmd); break; 3132 case EVAS_FILTER_MODE_GRAYSCALE: funcptr = gl_filter_grayscale_func_get(re, cmd); break;
3133 case EVAS_FILTER_MODE_INVERSE_COLOR: funcptr = gl_filter_inverse_color_func_get(re, cmd); break;
3131 default: return NULL; 3134 default: return NULL;
3132 } 3135 }
3133 3136
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 b1045d0..5b5d677 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
@@ -18,6 +18,7 @@ GL_Filter_Apply_Func gl_filter_fill_func_get(Render_Engine_GL_Generic *re, Evas_
18GL_Filter_Apply_Func gl_filter_mask_func_get(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd); 18GL_Filter_Apply_Func gl_filter_mask_func_get(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd);
19//GL_Filter_Apply_Func gl_filter_transform_func_get(Evas_Filter_Command *cmd); 19//GL_Filter_Apply_Func gl_filter_transform_func_get(Evas_Filter_Command *cmd);
20GL_Filter_Apply_Func gl_filter_grayscale_func_get(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd); 20GL_Filter_Apply_Func gl_filter_grayscale_func_get(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd);
21GL_Filter_Apply_Func gl_filter_inverse_color_func_get(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd);
21 22
22#undef DBG 23#undef DBG
23#undef INF 24#undef INF
diff --git a/src/modules/evas/engines/gl_generic/filters/gl_filter_inverse_color.c b/src/modules/evas/engines/gl_generic/filters/gl_filter_inverse_color.c
new file mode 100644
index 0000000..8319db6
--- /dev/null
+++ b/src/modules/evas/engines/gl_generic/filters/gl_filter_inverse_color.c
@@ -0,0 +1,53 @@
1#include "gl_engine_filter.h"
2
3static Eina_Bool
4_gl_filter_inverse_color(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd)
5{
6 Evas_Engine_GL_Context *gc;
7 Evas_GL_Image *image, *surface;
8 RGBA_Draw_Context *dc_save;
9 int w, h;
10
11 w = cmd->input->w;
12 h = cmd->input->h;
13 EINA_SAFETY_ON_FALSE_RETURN_VAL(w == cmd->output->w, EINA_FALSE);
14 EINA_SAFETY_ON_FALSE_RETURN_VAL(h == cmd->output->h, EINA_FALSE);
15
16 image = evas_ector_buffer_drawable_image_get(cmd->input->buffer);
17 EINA_SAFETY_ON_NULL_RETURN_VAL(image, EINA_FALSE);
18
19 surface = evas_ector_buffer_render_image_get(cmd->output->buffer);
20 EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
21
22 gc = gl_generic_context_find(re, 1);
23 evas_gl_common_context_target_surface_set(gc, surface);
24
25 dc_save = gc->dc;
26 gc->dc = evas_common_draw_context_new();
27 evas_common_draw_context_set_multiplier(gc->dc, cmd->draw.R, cmd->draw.G, cmd->draw.B, cmd->draw.A);
28
29 if (cmd->input == cmd->output)
30 gc->dc->render_op = EVAS_RENDER_COPY;
31 else
32 gc->dc->render_op = _gfx_to_evas_render_op(cmd->draw.rop);
33
34 evas_gl_common_filter_inverse_color_push(gc, image->tex, 0, 0, w, h);
35
36 evas_common_draw_context_free(gc->dc);
37 gc->dc = dc_save;
38
39 evas_ector_buffer_engine_image_release(cmd->input->buffer, image);
40 evas_ector_buffer_engine_image_release(cmd->output->buffer, surface);
41
42 return EINA_TRUE;
43}
44
45GL_Filter_Apply_Func
46gl_filter_inverse_color_func_get(Render_Engine_GL_Generic *re EINA_UNUSED, Evas_Filter_Command *cmd)
47{
48 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd, NULL);
49 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->output, NULL);
50 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, NULL);
51
52 return _gl_filter_inverse_color;
53}
diff --git a/src/modules/evas/engines/gl_generic/meson.build b/src/modules/evas/engines/gl_generic/meson.build
index d137eb2..6f7e9dc 100644
--- a/src/modules/evas/engines/gl_generic/meson.build
+++ b/src/modules/evas/engines/gl_generic/meson.build
@@ -13,6 +13,7 @@ engine_src = files([
13 join_paths('filters','gl_filter_fill.c'), 13 join_paths('filters','gl_filter_fill.c'),
14 join_paths('filters','gl_filter_mask.c'), 14 join_paths('filters','gl_filter_mask.c'),
15 join_paths('filters','gl_filter_grayscale.c'), 15 join_paths('filters','gl_filter_grayscale.c'),
16 join_paths('filters','gl_filter_inverse_color.c'),
16]) 17])
17common_engine_src = [ 18common_engine_src = [
18 'evas_gl_private.h', 19 'evas_gl_private.h',
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 1d63eaa..a22e9d9 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -1964,7 +1964,7 @@ _native_bind_cb(void *image)
1964 (void *)n->ns_data.x11.pixmap, 1964 (void *)n->ns_data.x11.pixmap,
1965 NULL); 1965 NULL);
1966 if (!n->ns_data.x11.surface) 1966 if (!n->ns_data.x11.surface)
1967 ERR("eglCreateImage() for Pixmap 0x%#lx failed: %#x", n->ns_data.x11.pixmap, eglGetError()); 1967 WRN("eglCreateImage() for Pixmap 0x%#lx failed: %#x", n->ns_data.x11.pixmap, eglGetError());
1968 1968
1969 } 1969 }
1970 if (glsym_glEGLImageTargetTexture2DOES) 1970 if (glsym_glEGLImageTargetTexture2DOES)
@@ -2567,7 +2567,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2567 2567
2568 if (!n->ns_data.x11.surface) 2568 if (!n->ns_data.x11.surface)
2569 { 2569 {
2570 ERR("eglCreateImage() for Pixmap %#lx failed: %#x", pm, eglGetError()); 2570 WRN("eglCreateImage() for Pixmap %#lx failed: %#x", pm, eglGetError());
2571 free(n); 2571 free(n);
2572 return NULL; 2572 return NULL;
2573 } 2573 }
@@ -2854,7 +2854,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2854 else 2854 else
2855 ERR("Try eglCreateImage on EGL with no support"); 2855 ERR("Try eglCreateImage on EGL with no support");
2856 if (!n->ns_data.tbm.surface) 2856 if (!n->ns_data.tbm.surface)
2857 ERR("eglCreateImage() for %p failed", buffer); 2857 WRN("eglCreateImage() for %p failed", buffer);
2858 im->native.yinvert = 1; 2858 im->native.yinvert = 1;
2859 im->native.loose = 0; 2859 im->native.loose = 0;
2860 im->native.disp = ob->egl_disp; 2860 im->native.disp = ob->egl_disp;
@@ -2965,7 +2965,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2965 2965
2966 if (!n->ns_data.wl_surface.surface) 2966 if (!n->ns_data.wl_surface.surface)
2967 { 2967 {
2968 ERR("eglCreatePixmapSurface() for %p failed", wl_buf); 2968 WRN("eglCreatePixmapSurface() for %p failed", wl_buf);
2969 eina_hash_del(gl_context->shared->native_wl_hash, 2969 eina_hash_del(gl_context->shared->native_wl_hash,
2970 &wlid, im); 2970 &wlid, im);
2971 glsym_evas_gl_common_image_free(im); 2971 glsym_evas_gl_common_image_free(im);
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 085f053..b548322 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -4463,23 +4463,22 @@ _draw_thread_ector_surface_set(void *data)
4463 eina_mempool_free(_mp_command_ector_surface, ector_surface); 4463 eina_mempool_free(_mp_command_ector_surface, ector_surface);
4464} 4464}
4465 4465
4466static void 4466static Eina_Bool
4467eng_ector_begin(void *engine EINA_UNUSED, void *surface, 4467eng_ector_begin(void *engine EINA_UNUSED, void *surface,
4468 void *context EINA_UNUSED, Ector_Surface *ector, 4468 void *context EINA_UNUSED, Ector_Surface *ector,
4469 int x, int y, Eina_Bool clear, Eina_Bool do_async) 4469 int x, int y, Eina_Bool do_async)
4470{ 4470{
4471 if (do_async) 4471 if (do_async)
4472 { 4472 {
4473 Evas_Thread_Command_Ector_Surface *nes; 4473 Evas_Thread_Command_Ector_Surface *nes;
4474 4474
4475 nes = eina_mempool_malloc(_mp_command_ector_surface, sizeof (Evas_Thread_Command_Ector_Surface)); 4475 nes = eina_mempool_malloc(_mp_command_ector_surface, sizeof (Evas_Thread_Command_Ector_Surface));
4476 if (!nes) return; 4476 if (!nes) return EINA_FALSE;
4477 4477
4478 nes->ector = ector; 4478 nes->ector = ector;
4479 nes->pixels = surface; 4479 nes->pixels = surface;
4480 nes->x = x; 4480 nes->x = x;
4481 nes->y = y; 4481 nes->y = y;
4482 nes->clear = clear;
4483 4482
4484 QCMD(_draw_thread_ector_surface_set, nes); 4483 QCMD(_draw_thread_ector_surface_set, nes);
4485 } 4484 }
@@ -4491,14 +4490,17 @@ eng_ector_begin(void *engine EINA_UNUSED, void *surface,
4491 unsigned int h = 0; 4490 unsigned int h = 0;
4492 4491
4493 pixels = evas_cache_image_pixels(&sf->cache_entry); 4492 pixels = evas_cache_image_pixels(&sf->cache_entry);
4493 if (!pixels) return EINA_FALSE;
4494
4494 w = sf->cache_entry.w; 4495 w = sf->cache_entry.w;
4495 h = sf->cache_entry.h; 4496 h = sf->cache_entry.h;
4496 // clear the surface before giving to ector 4497 // clear the surface before giving to ector
4497 if (clear) memset(pixels, 0, (w * h * 4)); 4498 memset(pixels, 0, (w * h * 4));
4498 4499
4499 ector_buffer_pixels_set(ector, pixels, w, h, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE); 4500 ector_buffer_pixels_set(ector, pixels, w, h, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
4500 ector_surface_reference_point_set(ector, x, y); 4501 ector_surface_reference_point_set(ector, x, y);
4501 } 4502 }
4503 return EINA_TRUE;
4502} 4504}
4503 4505
4504static void 4506static void
@@ -4545,6 +4547,7 @@ _gfx_filter_func_get(Evas_Filter_Command *cmd)
4545 case EVAS_FILTER_MODE_MASK: func = eng_filter_mask_func_get(cmd); break; 4547 case EVAS_FILTER_MODE_MASK: func = eng_filter_mask_func_get(cmd); break;
4546 case EVAS_FILTER_MODE_TRANSFORM: func = eng_filter_transform_func_get(cmd); break; 4548 case EVAS_FILTER_MODE_TRANSFORM: func = eng_filter_transform_func_get(cmd); break;
4547 case EVAS_FILTER_MODE_GRAYSCALE: func = eng_filter_grayscale_func_get(cmd); break; 4549 case EVAS_FILTER_MODE_GRAYSCALE: func = eng_filter_grayscale_func_get(cmd); break;
4550 case EVAS_FILTER_MODE_INVERSE_COLOR: func = eng_filter_inverse_color_func_get(cmd); break;
4548 default: return NULL; 4551 default: return NULL;
4549 } 4552 }
4550 4553
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 33998f9..bc6bbbd 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
@@ -14,5 +14,6 @@ Software_Filter_Func eng_filter_fill_func_get(Evas_Filter_Command *cmd);
14Software_Filter_Func eng_filter_mask_func_get(Evas_Filter_Command *cmd); 14Software_Filter_Func eng_filter_mask_func_get(Evas_Filter_Command *cmd);
15Software_Filter_Func eng_filter_transform_func_get(Evas_Filter_Command *cmd); 15Software_Filter_Func eng_filter_transform_func_get(Evas_Filter_Command *cmd);
16Software_Filter_Func eng_filter_grayscale_func_get(Evas_Filter_Command *cmd); 16Software_Filter_Func eng_filter_grayscale_func_get(Evas_Filter_Command *cmd);
17Software_Filter_Func eng_filter_inverse_color_func_get(Evas_Filter_Command *cmd);
17 18
18#endif // EVAS_ENGINE_FILTER_H 19#endif // EVAS_ENGINE_FILTER_H
diff --git a/src/modules/evas/engines/software_generic/filters/evas_filter_inverse_color.c b/src/modules/evas/engines/software_generic/filters/evas_filter_inverse_color.c
new file mode 100644
index 0000000..8079e3a
--- /dev/null
+++ b/src/modules/evas/engines/software_generic/filters/evas_filter_inverse_color.c
@@ -0,0 +1,57 @@
1#include "evas_engine_filter.h"
2
3static Eina_Bool
4_evas_filter_inverse_color(Evas_Filter_Command *cmd)
5{
6 int sw, sh, dw, dh, x, y, slen, dlen;
7 unsigned int src_len, src_stride, dst_len, dst_stride;
8 Eina_Bool ret = EINA_FALSE;
9 DATA32 *ts, *td, *src = NULL, *dst = NULL;
10
11 ector_buffer_size_get(cmd->input->buffer, &sw, &sh);
12 EINA_SAFETY_ON_FALSE_RETURN_VAL((sw > 0) && (sh > 0), ret);
13
14 ector_buffer_size_get(cmd->output->buffer, &dw, &dh);
15 EINA_SAFETY_ON_FALSE_RETURN_VAL((dw > 0) && (dh > 0), ret);
16
17 src = _buffer_map_all(cmd->input->buffer, &src_len, E_READ, E_ARGB, &src_stride);
18 EINA_SAFETY_ON_FALSE_GOTO(src, end);
19
20 dst = _buffer_map_all(cmd->output->buffer, &dst_len, E_WRITE, E_ARGB, &dst_stride);
21 EINA_SAFETY_ON_FALSE_GOTO(dst, end);
22
23 slen = src_stride / sizeof(*src);
24 dlen = dst_stride / sizeof(*dst);
25
26 ts = src;
27 td = dst;
28 for (y = 0; y < sh ; y++)
29 {
30 for (x = 0; x < sw; x++)
31 {
32 A_VAL(td + x) = A_VAL(ts + x);
33 R_VAL(td + x) = A_VAL(ts + x) - R_VAL(ts + x);
34 G_VAL(td + x) = A_VAL(ts + x) - G_VAL(ts + x);
35 B_VAL(td + x) = A_VAL(ts + x) - B_VAL(ts + x);
36 }
37 ts += slen;
38 td += dlen;
39 }
40
41 ret = EINA_TRUE;
42
43end:
44 if (src) ector_buffer_unmap(cmd->input->buffer, src, src_len);
45 if (dst) ector_buffer_unmap(cmd->output->buffer, dst, dst_len);
46 return ret;
47}
48
49Software_Filter_Func
50eng_filter_inverse_color_func_get(Evas_Filter_Command *cmd)
51{
52 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd, NULL);
53 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->output, NULL);
54 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, NULL);
55
56 return _evas_filter_inverse_color;
57}
diff --git a/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h b/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
index 45c0d91..d531ded 100644
--- a/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
+++ b/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
@@ -2,6 +2,7 @@
2# define _EVAS_ENGINE_WAYLAND_COMMON_H 2# define _EVAS_ENGINE_WAYLAND_COMMON_H
3 3
4#include "Ecore_Wl2.h" 4#include "Ecore_Wl2.h"
5#include "ecore_wl2_internal.h"
5 6
6typedef struct _Evas_Engine_Info_Wayland Evas_Engine_Info_Wayland; 7typedef struct _Evas_Engine_Info_Wayland Evas_Engine_Info_Wayland;
7 8
@@ -23,13 +24,9 @@ struct _Evas_Engine_Info_Wayland
23 /* non-blocking or blocking mode */ 24 /* non-blocking or blocking mode */
24 Evas_Engine_Render_Mode render_mode; 25 Evas_Engine_Render_Mode render_mode;
25 26
26 Eina_Bool indirect : 1;
27
28 Eina_Bool www_avail : 1;
29 Eina_Rectangle window; 27 Eina_Rectangle window;
30 int x_rel, y_rel; 28 int x_rel, y_rel;
31 int x_cursor, y_cursor; 29 int x_cursor, y_cursor;
32 int resizing;
33 uint32_t timestamp; 30 uint32_t timestamp;
34 /* window surface should be made with these config */ 31 /* window surface should be made with these config */
35 int depth_bits; 32 int depth_bits;
@@ -40,6 +37,9 @@ struct _Evas_Engine_Info_Wayland
40 Eina_Bool drag_start : 1; 37 Eina_Bool drag_start : 1;
41 Eina_Bool drag_stop : 1; 38 Eina_Bool drag_stop : 1;
42 Eina_Bool drag_ack : 1; 39 Eina_Bool drag_ack : 1;
40 Eina_Bool resizing : 1;
41 Eina_Bool indirect : 1;
42 Eina_Bool www_avail : 1;
43}; 43};
44 44
45#endif 45#endif
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 024e794..58eb54a 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -1317,7 +1317,7 @@ eng_image_native_set(void *engine, void *image, void *native)
1317 else 1317 else
1318 ERR("Try eglCreateImage on EGL with no support"); 1318 ERR("Try eglCreateImage on EGL with no support");
1319 if (!n->ns_data.tbm.surface) 1319 if (!n->ns_data.tbm.surface)
1320 ERR("eglCreateImage() for %p failed", buffer); 1320 WRN("eglCreateImage() for %p failed", buffer);
1321 img->native.yinvert = 1; 1321 img->native.yinvert = 1;
1322 img->native.loose = 0; 1322 img->native.loose = 0;
1323 img->native.disp = ob->egl_disp; 1323 img->native.disp = ob->egl_disp;
diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
index 95e59ce..cad8343 100644
--- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c
+++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
@@ -48,7 +48,7 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Output_Swap
48 48
49 wl_disp = ecore_wl2_display_get(gw->wl2_disp); 49 wl_disp = ecore_wl2_display_get(gw->wl2_disp);
50 const char *s = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); 50 const char *s = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
51 if (strstr(s, "EXT_platform_base")) 51 if (s && strstr(s, "EXT_platform_base"))
52 { 52 {
53 EGLDisplay (*func) (EGLenum platform, void *native_display, const EGLint *attrib_list); 53 EGLDisplay (*func) (EGLenum platform, void *native_display, const EGLint *attrib_list);
54 func = (void *)eglGetProcAddress("eglGetPlatformDisplayEXT"); 54 func = (void *)eglGetProcAddress("eglGetPlatformDisplayEXT");