summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Makefile_Evas.am34
-rw-r--r--src/lib/evas/canvas/evas_filter.c1428
-rw-r--r--src/lib/evas/canvas/evas_object_image.c209
-rw-r--r--src/lib/evas/canvas/evas_object_main.c3
-rw-r--r--src/lib/evas/common/evas_image_main.c13
-rw-r--r--src/lib/evas/include/evas_common.h18
-rw-r--r--src/lib/evas/include/evas_private.h39
-rw-r--r--src/modules/evas/engines/gl_cocoa/evas_engine.c38
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h26
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_filter.c181
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c13
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_shader.c178
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_blur.h24
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_blur.shd24
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_blur_bgra.h24
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_blur_bgra.shd24
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_blur_bgra_nomul.h24
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_blur_bgra_nomul.shd24
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_blur_nomul.h24
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_blur_nomul.shd24
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_blur_vert.h29
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_blur_vert.shd29
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_greyscale.h15
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_greyscale.shd15
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra.h15
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra.shd15
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra_nomul.h14
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra_nomul.shd14
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_greyscale_nomul.h14
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_greyscale_nomul.shd14
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_invert.h14
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_invert.shd14
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_invert_bgra.h14
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_invert_bgra.shd14
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_invert_bgra_nomul.h15
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_invert_bgra_nomul.shd15
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_invert_nomul.h14
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_invert_nomul.shd14
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_sepia.h20
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_sepia.shd20
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_sepia_bgra.h20
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_sepia_bgra.shd20
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_sepia_bgra_nomul.h18
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_sepia_bgra_nomul.shd18
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_sepia_nomul.h18
-rw-r--r--src/modules/evas/engines/gl_common/shader/filter_sepia_nomul.shd18
-rw-r--r--src/modules/evas/engines/gl_sdl/evas_engine.c6
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c40
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c88
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c40
50 files changed, 0 insertions, 2986 deletions
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index bcd5fe73a7..497d092963 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -45,7 +45,6 @@ lib/evas/canvas/evas_common_interface.c \
45lib/evas/canvas/evas_data.c \ 45lib/evas/canvas/evas_data.c \
46lib/evas/canvas/evas_device.c \ 46lib/evas/canvas/evas_device.c \
47lib/evas/canvas/evas_events.c \ 47lib/evas/canvas/evas_events.c \
48lib/evas/canvas/evas_filter.c \
49lib/evas/canvas/evas_focus.c \ 48lib/evas/canvas/evas_focus.c \
50lib/evas/canvas/evas_key.c \ 49lib/evas/canvas/evas_key.c \
51lib/evas/canvas/evas_key_grab.c \ 50lib/evas/canvas/evas_key_grab.c \
@@ -490,7 +489,6 @@ modules/evas/engines/gl_common/evas_gl_image.c \
490modules/evas/engines/gl_common/evas_gl_font.c \ 489modules/evas/engines/gl_common/evas_gl_font.c \
491modules/evas/engines/gl_common/evas_gl_polygon.c \ 490modules/evas/engines/gl_common/evas_gl_polygon.c \
492modules/evas/engines/gl_common/evas_gl_line.c \ 491modules/evas/engines/gl_common/evas_gl_line.c \
493modules/evas/engines/gl_common/evas_gl_filter.c \
494modules/evas/engines/gl_common/evas_gl_core.c \ 492modules/evas/engines/gl_common/evas_gl_core.c \
495modules/evas/engines/gl_common/evas_gl_api_ext.h \ 493modules/evas/engines/gl_common/evas_gl_api_ext.h \
496modules/evas/engines/gl_common/evas_gl_api_ext_def.h \ 494modules/evas/engines/gl_common/evas_gl_api_ext_def.h \
@@ -524,22 +522,6 @@ modules/evas/engines/gl_common/shader/tex_frag.h \
524modules/evas/engines/gl_common/shader/tex_vert.h \ 522modules/evas/engines/gl_common/shader/tex_vert.h \
525modules/evas/engines/gl_common/shader/tex_nomul_frag.h \ 523modules/evas/engines/gl_common/shader/tex_nomul_frag.h \
526modules/evas/engines/gl_common/shader/tex_nomul_vert.h \ 524modules/evas/engines/gl_common/shader/tex_nomul_vert.h \
527modules/evas/engines/gl_common/shader/filter_invert.h \
528modules/evas/engines/gl_common/shader/filter_invert_nomul.h \
529modules/evas/engines/gl_common/shader/filter_invert_bgra.h \
530modules/evas/engines/gl_common/shader/filter_invert_bgra_nomul.h \
531modules/evas/engines/gl_common/shader/filter_sepia.h \
532modules/evas/engines/gl_common/shader/filter_sepia_nomul.h \
533modules/evas/engines/gl_common/shader/filter_sepia_bgra.h \
534modules/evas/engines/gl_common/shader/filter_sepia_bgra_nomul.h \
535modules/evas/engines/gl_common/shader/filter_greyscale.h \
536modules/evas/engines/gl_common/shader/filter_greyscale_nomul.h \
537modules/evas/engines/gl_common/shader/filter_greyscale_bgra.h \
538modules/evas/engines/gl_common/shader/filter_greyscale_bgra_nomul.h \
539modules/evas/engines/gl_common/shader/filter_blur.h \
540modules/evas/engines/gl_common/shader/filter_blur_nomul.h \
541modules/evas/engines/gl_common/shader/filter_blur_bgra.h \
542modules/evas/engines/gl_common/shader/filter_blur_bgra_nomul.h \
543modules/evas/engines/gl_common/shader/yuy2_frag.h \ 525modules/evas/engines/gl_common/shader/yuy2_frag.h \
544modules/evas/engines/gl_common/shader/yuy2_vert.h \ 526modules/evas/engines/gl_common/shader/yuy2_vert.h \
545modules/evas/engines/gl_common/shader/yuy2_nomul_frag.h \ 527modules/evas/engines/gl_common/shader/yuy2_nomul_frag.h \
@@ -570,22 +552,6 @@ modules/evas/engines/gl_common/shader/tex_frag.shd \
570modules/evas/engines/gl_common/shader/tex_vert.shd \ 552modules/evas/engines/gl_common/shader/tex_vert.shd \
571modules/evas/engines/gl_common/shader/tex_nomul_frag.shd \ 553modules/evas/engines/gl_common/shader/tex_nomul_frag.shd \
572modules/evas/engines/gl_common/shader/tex_nomul_vert.shd \ 554modules/evas/engines/gl_common/shader/tex_nomul_vert.shd \
573modules/evas/engines/gl_common/shader/filter_invert.shd \
574modules/evas/engines/gl_common/shader/filter_invert_nomul.shd \
575modules/evas/engines/gl_common/shader/filter_invert_bgra.shd \
576modules/evas/engines/gl_common/shader/filter_invert_bgra_nomul.shd \
577modules/evas/engines/gl_common/shader/filter_greyscale.shd \
578modules/evas/engines/gl_common/shader/filter_greyscale_nomul.shd \
579modules/evas/engines/gl_common/shader/filter_greyscale_bgra.shd \
580modules/evas/engines/gl_common/shader/filter_greyscale_bgra_nomul.shd \
581modules/evas/engines/gl_common/shader/filter_sepia.shd \
582modules/evas/engines/gl_common/shader/filter_sepia_nomul.shd \
583modules/evas/engines/gl_common/shader/filter_sepia_bgra.shd \
584modules/evas/engines/gl_common/shader/filter_sepia_bgra_nomul.shd \
585modules/evas/engines/gl_common/shader/filter_blur.shd \
586modules/evas/engines/gl_common/shader/filter_blur_nomul.shd \
587modules/evas/engines/gl_common/shader/filter_blur_bgra.shd \
588modules/evas/engines/gl_common/shader/filter_blur_bgra_nomul.shd \
589modules/evas/engines/gl_common/shader/nv12_frag.h \ 555modules/evas/engines/gl_common/shader/nv12_frag.h \
590modules/evas/engines/gl_common/shader/nv12_frag.shd \ 556modules/evas/engines/gl_common/shader/nv12_frag.shd \
591modules/evas/engines/gl_common/shader/nv12_nomul_frag.h \ 557modules/evas/engines/gl_common/shader/nv12_nomul_frag.h \
diff --git a/src/lib/evas/canvas/evas_filter.c b/src/lib/evas/canvas/evas_filter.c
deleted file mode 100644
index 80a11b4313..0000000000
--- a/src/lib/evas/canvas/evas_filter.c
+++ /dev/null
@@ -1,1428 +0,0 @@
1/*
2 * Filter implementation for evas
3 */
4
5#if 0 // filtering disabled
6typedef enum
7{
8 /** Apply any filter effects to this object (Default) */
9 EVAS_FILTER_MODE_OBJECT,
10 /** Filter all objects beneath this object on the canvas */
11 EVAS_FILTER_MODE_BELOW,
12} Evas_Filter_Mode;
13typedef enum
14{
15 /** No filter: Default */
16 EVAS_FILTER_NONE,
17 /** A blur filter. Params are quality (float), and radius (int). */
18 EVAS_FILTER_BLUR,
19 /** Negates the colors of an image. Also called solarize */
20 EVAS_FILTER_INVERT,
21 EVAS_FILTER_SOLARIZE = EVAS_FILTER_INVERT,
22 /** Makes a sepia version of the image. */
23 EVAS_FILTER_SEPIA,
24 /** Makes a greyscale version of the image. Params are 'red',
25 * 'green', 'blue' (all floats) which must add to 1. The defaults are
26 * 0.3, 0.59 and 0.11 which approximates human vision. Setting 'all'
27 * sets rgb to the same value. */
28 EVAS_FILTER_GREYSCALE,
29 EVAS_FILTER_GRAYSCALE = EVAS_FILTER_GREYSCALE,
30 /** Brighten (or darken) image. Param 'adjust' float (-1.0 to 1.0)
31 * amount to adjust. */
32 EVAS_FILTER_BRIGHTNESS,
33 /** Enhance contrast on image. Param 'adjust' float (-1.0 to 1.0)
34 * amount to adjust. */
35 EVAS_FILTER_CONTRAST,
36
37 EVAS_FILTER_LAST = EVAS_FILTER_CONTRAST
38} Evas_Filter;
39
40/**
41 * Set the filter mode for an object.
42 *
43 * There are two valid filtering modes currently:
44 * - EVAS_FILTER_MODE_OBJECT: which applies the filter to the object itself
45 * - EVAS_FILTER_MODE_BELOW: which makes the object invisible and filters
46 * what is below the object.
47 *
48 * The default filter mode is EVAS_FILTER_MODE_OBJECT.
49 *
50 * @param o Object to set filter mode on.
51 * @param mode Mode to set.
52 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
53 */
54 EAPI Eina_Bool evas_object_filter_mode_set (Evas_Object *o, Evas_Filter_Mode mode);
55
56/**
57 * Get the current filtering mode for an object.
58 *
59 * By default all objects are in object filtering mode, even if no filter is
60 * set.
61 *
62 * @param o Object to get filter mode of.
63 * @return Filter mode (default EVAS_FILTER_MODE_OBJECT)
64 */
65 EAPI Evas_Filter_Mode evas_object_filter_mode_get (Evas_Object *o);
66
67/**
68 * Set the current filter type.
69 *
70 * This sets the filter type, whether a blur, color filter or some other type
71 * of filter. This is normally the only filter call necessary, although some
72 * filters require additional parameters.
73 *
74 * If the object has a filter already, and existing parameters will be
75 * cleared.
76 *
77 * Setting the blur to EVAS_FILTER_NONE removes any filter.
78 *
79 * @param o Object to set the filter on.
80 * @param filter Filter to set.
81 * @return @c EINA_TRUE on success.
82 */
83 EAPI Eina_Bool evas_object_filter_set (Evas_Object *o, Evas_Filter filter);
84
85/**
86 * Get the current filter.
87 *
88 * @param o Object to get filter of.
89 * @return The filter if set, or EVAS_FILTER_NONE.
90 */
91 EAPI Evas_Filter evas_object_filter_get (Evas_Object *o);
92
93/**
94 * Set an integer parameter of a filter.
95 *
96 * This sets an integer parameter of a filter, if such parameter is known to
97 * the filter. Note that some parameters may actually set multiple fields.
98 * The individual filters define the specific parameters available.
99 *
100 * It should be noted that filter parameters are lost after the filter type
101 * changes, so set the filter type, then the parameters.
102 *
103 * @param o Object to set parameter on.
104 * @param param Name of parameter to set.
105 * @param val Value to set.
106 * @return @c EINA_TRUE if at least one parameter was set, @c EINA_FALSE
107 * otherwise.
108 */
109 EAPI Eina_Bool evas_object_filter_param_int_set (Evas_Object *o, const char *param, int val);
110
111/**
112 * Get an integer value parameter from a filter.
113 *
114 * Gets the first matching parameter for a filter. Note there is no way to
115 * later fields if they do not have their own accessor name.
116 *
117 * Also note that there is no way to tell the difference between a -1 as a
118 * value, and the error code. Ask your filter writer to use a different
119 * range.
120 *
121 * @param o The object.
122 * @Param param Name of the parameter to get.
123 * @return The value, or -1 on error.
124 */
125 EAPI int evas_object_filter_param_int_get (Evas_Object *o, const char *param);
126
127/**
128 * Set a string parameter on a filter
129 *
130 * Currently unimplemented as no filters use this yet
131 */
132 EAPI Eina_Bool evas_object_filter_param_str_set (Evas_Object *o, const char *param, const char *val);
133
134/**
135 * Get a string parameter from a filter
136 *
137 * Currently unimplemented as no filters use this yet
138 */
139 EAPI const char *evas_object_filter_param_str_get (Evas_Object *o, const char *param);
140
141/**
142 * Set an object parameter on a filter
143 *
144 * Currently unimplemented as no filters use this yet
145 */
146 EAPI Eina_Bool evas_object_filter_param_obj_set (Evas_Object *o, const char *param, Evas_Object *val);
147
148/**
149 * get an object parameter from a filter
150 *
151 * Currently unimplemented as no filters use this yet
152 */
153 EAPI Evas_Object *evas_object_filter_param_obj_get (Evas_Object *o, const char *param);
154
155/**
156 * Set a float parameter of a filter.
157 *
158 * This is the same as evas_object_filter_param_int_set(), but for floating
159 * point values.
160 *
161 * @param o Object to set value on.
162 * @param param Name of the parameter to set.
163 * @param @c EINA_TRUE if at least one parameter was set, @c EINA_FALSE
164 * otherwise.
165 */
166 EAPI Eina_Bool evas_object_filter_param_float_set(Evas_Object *o, const char *param, double val);
167
168/**
169 * Get a float parameter of a filter.
170 *
171 * This is the same as evas_object_filter_param_int_get(), but for floating
172 * point values.
173 *
174 * @param o Object to set value on.
175 * @param param Name of the parameter to set.
176 * @return The value, or -1 on error.
177 */
178 EAPI double evas_object_filter_param_float_get(Evas_Object *o, const char *param);
179
180#include <stddef.h> // offsetof
181
182#include "evas_common.h"
183#include "evas_private.h"
184
185#include <assert.h>
186/* disable neon - even after fixes:
187 * Error: ARM register expected -- vdup.u32 q14,$0xff000000'
188 * not going to fix now
189#ifdef BUILD_NEON
190# define BUILD_NEON0 1
191#else
192# define BUILD_NEON0 0
193#endif
194*/
195
196#define BUILD_NEON0 0
197
198typedef struct Evas_Filter_Info_Blur
199{
200 double quality;
201 int radius;
202} Evas_Filter_Info_Blur;
203
204typedef struct Evas_Filter_Info_GreyScale
205{
206 double r,g,b;
207} Evas_Filter_Info_GreyScale;
208
209typedef struct Evas_Filter_Info_Brightness
210{
211 double adjust;
212} Evas_Filter_Info_Brightness;
213
214typedef struct Evas_Filter_Info_Contrast
215{
216 double adjust;
217} Evas_Filter_Info_Contrast;
218
219typedef int (*Filter_Size_FN)(Evas_Filter_Info *,int,int,int*,int*,Eina_Bool);
220typedef uint8_t *(*Key_FN)(const Evas_Filter_Info *, uint32_t *);
221
222struct fieldinfo
223{
224 const char *field;
225 int type;
226 size_t offset;
227};
228
229struct filterinfo
230{
231 Evas_Software_Filter_Fn filter;
232 const size_t datasize;
233 Filter_Size_FN sizefn;
234 Key_FN keyfn;
235 Eina_Bool alwaysalpha;
236};
237
238enum
239{
240 TYPE_INT,
241 TYPE_FLOAT
242};
243
244static int blur_size_get(Evas_Filter_Info*, int, int, int *, int *, Eina_Bool);
245static uint8_t *gaussian_key_get(const Evas_Filter_Info *, uint32_t *);
246
247static Eina_Bool gaussian_filter(Evas_Filter_Info *, RGBA_Image*, RGBA_Image*);
248static Eina_Bool negation_filter(Evas_Filter_Info *, RGBA_Image*, RGBA_Image*);
249static Eina_Bool sepia_filter(Evas_Filter_Info *, RGBA_Image*, RGBA_Image*);
250static Eina_Bool greyscale_filter(Evas_Filter_Info*, RGBA_Image*, RGBA_Image*);
251static Eina_Bool brightness_filter(Evas_Filter_Info*, RGBA_Image*, RGBA_Image*);
252static Eina_Bool contrast_filter(Evas_Filter_Info *, RGBA_Image*, RGBA_Image*);
253
254struct filterinfo filterinfo[] =
255{
256 /* None */
257 { NULL, 0, NULL, NULL, EINA_FALSE},
258 /* Blur */
259 { gaussian_filter, sizeof(Evas_Filter_Info_Blur), blur_size_get, gaussian_key_get, EINA_TRUE },
260 /* Negation */
261 { negation_filter, 0, NULL, NULL, EINA_FALSE },
262 /* Sepia */
263 { sepia_filter, 0, NULL, NULL, EINA_FALSE },
264 /* Greyscale */
265 { greyscale_filter, sizeof(Evas_Filter_Info_GreyScale), NULL, NULL, EINA_FALSE },
266 /* Brightness */
267 { brightness_filter, sizeof(Evas_Filter_Info_Brightness), NULL, NULL, EINA_FALSE },
268 /* Contrast */
269 { contrast_filter, sizeof(Evas_Filter_Info_Contrast), NULL, NULL, EINA_FALSE},
270};
271
272
273static struct fieldinfo blurfields[] =
274{
275 { "quality", TYPE_FLOAT, offsetof(Evas_Filter_Info_Blur, quality) },
276 { "radius", TYPE_INT, offsetof(Evas_Filter_Info_Blur, radius) },
277 { NULL, 0, 0 },
278};
279
280static struct fieldinfo greyfields[] =
281{
282 { "red", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, r) },
283 { "green", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, g) },
284 { "blue", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, b) },
285
286 { "all", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, r) },
287 { "all", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, g) },
288 { "all", TYPE_FLOAT, offsetof(Evas_Filter_Info_GreyScale, b) },
289 { NULL, 0, 0 },
290};
291
292static struct fieldinfo brightnessfields[] =
293{
294 { "adjust", TYPE_FLOAT, offsetof(Evas_Filter_Info_Brightness, adjust) },
295 { NULL, 0, 0 },
296};
297
298static struct fieldinfo contrastfields[] =
299{
300 { "adjust", TYPE_FLOAT, offsetof(Evas_Filter_Info_Contrast, adjust) },
301 { NULL, 0, 0 },
302};
303
304static struct fieldinfo *filterfields[] =
305{
306 NULL,
307 blurfields,
308 NULL,
309 NULL,
310 greyfields,
311 brightnessfields,
312 contrastfields,
313};
314
315static Evas_Filter_Info *filter_alloc(Evas_Object *o);
316
317EAPI Eina_Bool
318evas_object_filter_mode_set(Evas_Object *o, Evas_Filter_Mode mode)
319{
320 Evas_Filter_Info *info;
321
322 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
323 return EINA_FALSE;
324 MAGIC_CHECK_END();
325
326 if ((mode != EVAS_FILTER_MODE_OBJECT) && (mode != EVAS_FILTER_MODE_BELOW))
327 return EINA_FALSE;
328
329 if (!o->filter)
330 {
331 filter_alloc(o);
332 }
333 if (!o->filter) return EINA_FALSE;
334 info = o->filter;
335
336 if (info->mode == mode) return EINA_TRUE; /* easy case */
337 info->mode = mode;
338 info->dirty = 1;
339 return EINA_TRUE;
340}
341
342EAPI Evas_Filter_Mode
343evas_object_filter_mode_get(Evas_Object *o)
344{
345 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
346 return EVAS_FILTER_MODE_OBJECT;
347 MAGIC_CHECK_END();
348
349 if (!o->filter) return EVAS_FILTER_MODE_OBJECT;
350 return o->filter->mode;
351}
352
353EAPI Eina_Bool
354evas_object_filter_set(Evas_Object *o, Evas_Filter filter)
355{
356 Evas_Filter_Info *info;
357 struct filterinfo *finfo;
358
359 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
360 return EINA_FALSE;
361 MAGIC_CHECK_END();
362
363 /* force filter to be signed: else gcc complains, but enums may always be
364 * signed */
365 if (((int)filter < (int)EVAS_FILTER_NONE) || (filter > EVAS_FILTER_LAST))
366 return EINA_FALSE;
367
368 /* Don't alloc on no-op */
369 if (!o-filter && filter == EVAS_FILTER_NONE) return EINA_TRUE;
370
371 if (!o->filter) filter_alloc(o);
372 if (!o->filter) return EINA_FALSE;
373
374 info = o->filter;
375
376 if (info->filter == filter) return EINA_TRUE;
377
378 finfo = filterinfo + filter;
379 info->filter = filter;
380 info->dirty = 1;
381 if (info->data)
382 {
383 if (info->data_free)
384 info->data_free(info->data);
385 else
386 free(info->data);
387 }
388 info->datalen = finfo->datasize;
389 if (finfo->datasize)
390 {
391 info->data = calloc(1, finfo->datasize);
392 if (!info->data)
393 {
394 o->filter = EVAS_FILTER_NONE;
395 return EINA_FALSE;
396 }
397 }
398 else
399 info->data = NULL;
400 info->data_free = NULL;
401
402 return EINA_TRUE;
403}
404
405EAPI Evas_Filter
406evas_object_filter_get(Evas_Object *o)
407{
408 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
409 return EVAS_FILTER_NONE;
410 MAGIC_CHECK_END();
411
412 if (!o->filter) return EVAS_FILTER_NONE;
413 return o->filter->filter;
414}
415
416EAPI Eina_Bool
417evas_object_filter_param_int_set(Evas_Object *o, const char *param, int val)
418{
419 char *data;
420 const struct fieldinfo *fields;
421 Eina_Bool found;
422 int i;
423
424 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
425 return EINA_FALSE;
426 MAGIC_CHECK_END();
427
428 if ((!o->filter) || (!o->filter->data)) return EINA_FALSE;
429
430 fields = filterfields[o->filter->filter];
431 data = o->filter->data;
432 found = EINA_FALSE;
433 for (i = 0; fields[i].field; i++)
434 {
435 if (!strcmp(fields[i].field, param))
436 {
437 if (fields[i].type != TYPE_INT) continue;
438 *(int *)(data + fields[i].offset) = val;
439 o->filter->dirty = 1;
440 evas_object_change(o);
441 found = EINA_TRUE;
442 }
443 }
444 return found;
445}
446
447EAPI int
448evas_object_filter_param_int_get(Evas_Object *o, const char *param)
449{
450 char *data;
451 const struct fieldinfo *fields;
452 int val;
453 int i;
454
455 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
456 return -1;
457 MAGIC_CHECK_END();
458
459 if ((!o->filter) || (!o->filter->data)) return -1;
460
461 fields = filterfields[o->filter->filter];
462 if (!fields) return -1;
463 data = o->filter->data;
464
465 for (i = 0; fields[i].field; i++)
466 {
467 if (!strcmp(fields[i].field, param))
468 {
469 if (fields[i].type != TYPE_INT) continue;
470 val = *(int *)(data + fields[i].offset);
471 return val;
472 }
473 }
474 return -1;
475}
476
477EAPI Eina_Bool
478evas_object_filter_param_str_set(Evas_Object *o EINA_UNUSED,
479 const char *param EINA_UNUSED,
480 const char *val EINA_UNUSED)
481{
482 return EINA_FALSE;
483}
484
485EAPI const char *
486evas_object_filter_param_str_get(Evas_Object *o EINA_UNUSED,
487 const char *param EINA_UNUSED)
488{
489 return NULL;
490}
491
492EAPI Eina_Bool
493evas_object_filter_param_obj_set(Evas_Object *o EINA_UNUSED,
494 const char *param EINA_UNUSED,
495 Evas_Object *val EINA_UNUSED)
496{
497 return EINA_FALSE;
498}
499
500EAPI Evas_Object *
501evas_object_filter_param_obj_get(Evas_Object *o EINA_UNUSED,
502 const char *param EINA_UNUSED)
503{
504 return NULL;
505}
506
507EAPI Eina_Bool
508evas_object_filter_param_float_set(Evas_Object *o, const char *param,
509 double val)
510{
511 char *data;
512 const struct fieldinfo *fields;
513 int i;
514 Eina_Bool rv;
515
516 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
517 return EINA_FALSE;
518 MAGIC_CHECK_END();
519
520 if ((!o->filter) || (!o->filter->data)) return EINA_FALSE;
521
522 rv = EINA_FALSE;
523 fields = filterfields[o->filter->filter];
524 if (!fields) return EINA_FALSE;
525
526 data = o->filter->data;
527
528 for (i = 0; fields[i].field; i++)
529 {
530 if (!strcmp(fields[i].field, param))
531 {
532 if (fields[i].type != TYPE_FLOAT) continue;
533 *(double *)(data + fields[i].offset) = val;
534 o->filter->dirty = 1;
535 o->changed = 1;
536 evas_object_change(o);
537 rv = EINA_TRUE;
538 }
539 }
540 return rv;
541}
542
543EAPI double
544evas_object_filter_param_float_get(Evas_Object *o, const char *param)
545{
546 char *data;
547 const struct fieldinfo *fields;
548 double val;
549 int i;
550
551 MAGIC_CHECK(o, Evas_Object, MAGIC_OBJ);
552 return -1;
553 MAGIC_CHECK_END();
554
555 if ((!o->filter) || (!o->filter->data)) return -1;
556
557 fields = filterfields[o->filter->filter];
558 if (!fields) return -1;
559 data = o->filter->data;
560
561 for (i = 0; fields[i].field; i++)
562 {
563 if (!strcmp(fields[i].field, param))
564 {
565 if (fields[i].type != TYPE_FLOAT) continue;
566 val = *(double *)(data + fields[i].offset);
567 return val;
568 }
569 }
570 return -1;
571}
572
573
574
575
576
577/*
578 * Internal call
579 */
580int
581evas_filter_get_size(Evas_Filter_Info *info, int inw, int inh,
582 int *outw, int *outh, Eina_Bool inv)
583{
584 if (!info) return -1;
585 if ((!outw) && (!outh)) return 0;
586
587 if (filterinfo[info->filter].sizefn)
588 return filterinfo[info->filter].sizefn(info, inw, inh, outw, outh, inv);
589
590 if (outw) *outw = inw;
591 if (outh) *outh = inh;
592 return 0;
593}
594
595Eina_Bool
596evas_filter_always_alpha(Evas_Filter_Info *info)
597{
598 if (!info) return EINA_FALSE;
599 return filterinfo[info->filter].alwaysalpha;
600}
601
602/*
603 * Another internal call:
604 * Given a filterinfo, generate a unique key for it
605 *
606 * For simple filters, it's just the filter type.
607 * for more complex filters, it's the type, with it's params.
608 *
609 * Note management of the key data is up to the caller, that is it should
610 * probably be freed after use.
611 *
612 * Note the automatic fallback generation places the single byte at the end so
613 * the memcpy will be aligned. Micro-optimisations FTW!
614 *
615 * @param info Filter info to generate from
616 * @param len Length of the buffer returned.
617 * @return key Key buffer
618 */
619uint8_t *
620evas_filter_key_get(const Evas_Filter_Info *info, uint32_t *lenp)
621{
622 struct filterinfo *finfo;
623 uint8_t *key;
624 int len;
625
626 if (!info) return NULL;
627
628 finfo = filterinfo + info->filter;
629 if (finfo->keyfn) return finfo->keyfn(info, lenp);
630
631 len = 1 + finfo->datasize;
632 key = malloc(len);
633 if (!key) return NULL;
634 if (finfo->datasize) memcpy(key, info->data, finfo->datasize);
635 key[finfo->datasize] = info->filter;
636 if (lenp) *lenp = len;
637 return key;
638}
639
640Evas_Software_Filter_Fn
641evas_filter_software_get(Evas_Filter_Info *info)
642{
643 return filterinfo[info->filter].filter;
644}
645
646void
647evas_filter_free(Evas_Object *o)
648{
649 if (!o->filter) return;
650 if (o->filter->key) free(o->filter->key);
651 free(o->filter);
652 o->filter = NULL;
653}
654
655
656
657
658/*
659 * Private calls
660 */
661static Evas_Filter_Info *
662filter_alloc(Evas_Object *o)
663{
664 Evas_Filter_Info *info;
665
666 if (!o) return NULL;
667 info = calloc(1,sizeof(struct Evas_Filter_Info));
668 if (!info) return NULL;
669 info->dirty = 1;
670 info->filter = EVAS_FILTER_NONE;
671 info->mode = EVAS_FILTER_MODE_OBJECT;
672 info->datalen = 0;
673
674 o->filter = info;
675
676 return info;
677}
678
679static int
680blur_size_get(Evas_Filter_Info *info, int inw, int inh, int *outw, int *outh,
681 Eina_Bool inv)
682{
683 Evas_Filter_Info_Blur *blur = info->data;
684
685 if (inv)
686 {
687 if (outw) *outw = MAX(inw - (blur->radius * 2), 0);
688 if (outh) *outh = MAX(inh - (blur->radius * 2), 0);
689 }
690 else
691 {
692 if (outw) *outw = inw + (blur->radius * 2);
693 if (outh) *outh = inh + (blur->radius * 2);
694 }
695 return 0;
696}
697
698/*
699 * Generate a key for the Gaussian generator.
700 *
701 * The size is:
702 * - 1 byte for the type (blur)
703 * - 1 byte for the quality (0-1 -> 0-255)
704 * - 2 bytes for radius (max is 508 anyway)
705 *
706 * @param info Filter info
707 * @param len Length of the returned buffer
708 * @return new buffer
709 */
710static uint8_t *
711gaussian_key_get(const Evas_Filter_Info *info, uint32_t *lenp)
712{
713 struct Evas_Filter_Info_Blur *blur;
714 uint8_t *key;
715
716 if ((!info) || (!info->data)) return NULL;
717 blur = info->data;
718
719 if (lenp) *lenp = 4;
720 key = malloc(4);
721 if (!key) return NULL;
722 key[0] = EVAS_FILTER_BLUR;
723 key[1] = blur->quality * 255;
724 key[2] = blur->radius >> 8;
725 key[3] = blur->radius;
726
727 return key;
728}
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748/**
749 * Software implementations
750 */
751#define all(OP, A, R, G, B, W, I) \
752 do { \
753 A OP A_VAL(I) * W; \
754 R OP R_VAL(I) * W; \
755 G OP G_VAL(I) * W; \
756 B OP B_VAL(I) * W; \
757 } while (0)
758#define wavg(x,n) (((x) / (n)) & 0xff)
759#define wavgd(x,n) ((uint32_t)((x) / (n)) & 0xff)
760
761typedef int (*FilterH)(int, uint32_t *, int, uint32_t *);
762typedef int (*FilterV)(int, uint32_t *, int, int, uint32_t *);
763
764static int gaussian_filter_h(int rad, uint32_t *in, int w, uint32_t *out);
765static int gaussian_filter_h64(int rad, uint32_t *in, int w, uint32_t *out);
766static int gaussian_filter_hd(int rad, uint32_t *in, int w, uint32_t *out);
767static int gaussian_filter_v(int rad, uint32_t *in, int h, int skip, uint32_t *out);
768static int gaussian_filter_v64(int rad, uint32_t *in, int h, int skip, uint32_t *out);
769static int gaussian_filter_vd(int rad, uint32_t *in, int h, int skip, uint32_t *out);
770static const uint32_t *gaussian_row_get(int row, int *npoints, uint32_t *weight);
771static const uint64_t *gaussian_row_get64(int row, int *npoints, uint64_t *weight);
772static const double *gaussian_row_getd(int row, int *npoints, double *weight);
773
774static Eina_Bool
775gaussian_filter(Evas_Filter_Info *filter, RGBA_Image *src, RGBA_Image *dst)
776{
777 int i;
778 uint32_t nw, nh;
779 uint32_t *in, *tmp, *out;
780 FilterV filter_v = gaussian_filter_v;
781 FilterH filter_h = gaussian_filter_h;
782 Evas_Filter_Info_Blur *blur;
783 int w, h;
784
785 blur = filter->data;
786
787 /* Use 64 bit version if we are going to overflow */
788 if (blur->radius > 508) /** too big for doubles: Bail out */
789 return EINA_FALSE;
790 else if (blur->radius > 28)
791 {
792 filter_v = gaussian_filter_vd;
793 filter_h = gaussian_filter_hd;
794 }
795 else if (blur->radius > 12)
796 {
797 filter_v = gaussian_filter_v64;
798 filter_h = gaussian_filter_h64;
799 }
800
801 w = src->cache_entry.w;
802 h = src->cache_entry.h;
803 in = src->image.data;
804
805 if (!in) return EINA_FALSE;
806
807 nw = w + (2 * blur->radius);
808 nh = h + (2 * blur->radius);
809
810 out = dst->image.data;
811 if (!out) return EINA_FALSE;
812 tmp = malloc(nw * h * sizeof(uint32_t));
813
814 for (i = 0; i < h; i++)
815 filter_h(blur->radius,in + (i * w), w, tmp + (i * nw));
816
817 for (i = 0; i < (int)nw; i++)
818 filter_v(blur->radius,tmp + i, h, nw, out + i);
819
820 free(tmp);
821 return EINA_TRUE;
822}
823
824/* Blur only horizontally */
825static int
826gaussian_filter_h(int rad, uint32_t *in, int w, uint32_t *out)
827{
828 const uint32_t *points;
829 int npoints = 0;
830 uint32_t weight = 0;
831 int i = 0, k = 0;
832 uint32_t r, g, b, a;
833
834 /* Get twice the radius: even rows have 1 element */
835 points = gaussian_row_get(rad * 2, &npoints, &weight);
836 for (i = -rad; i < (w + rad); i++)
837 {
838 r = g = b = a = 0;
839 for (k = -rad; k <= rad; k++)
840 {
841 if ((k + i) < 0) continue;
842 if ((k + i) >= w) continue;
843 all(+=, a, r, g, b, points[k + rad], in + k + i);
844 }
845 *(out) = ARGB_JOIN(wavg(a, weight),
846 wavg(r, weight),
847 wavg(g, weight),
848 wavg(b, weight));
849 out++;
850 }
851 return 0;
852}
853
854/* Blur only horizontally */
855static int
856gaussian_filter_hd(int rad, uint32_t *in, int w, uint32_t *out)
857{
858 const double *points;
859 int npoints = 0;
860 double weight = 0.0;
861 int i = 0, k = 0;
862 double r, g, b, a;
863
864 /* Get twice the radius: even rows have 1 element */
865 points = gaussian_row_getd(rad * 2, &npoints, &weight);
866 for (i = -rad; i < (w + rad); i++)
867 {
868 r = g = b = a = 0;
869 for (k = -rad; k <= rad; k++)
870 {
871 if ((k + i) < 0) continue;
872 if ((k + i) >= w) continue;
873 all(+=, a, r, g, b, points[k + rad], in + k + i);
874 }
875 *(out) = ARGB_JOIN(wavgd(a, weight),
876 wavgd(r, weight),
877 wavgd(g, weight),
878 wavgd(b, weight));
879 out++;
880 }
881 return 0;
882}
883
884
885/* Blur only horizontally */
886static int
887gaussian_filter_h64(int rad, uint32_t *in, int w, uint32_t *out)
888{
889 const uint64_t *points;
890 int npoints = 0;
891 uint64_t weight = 0;
892 int i = 0, k = 0;
893 uint64_t r, g, b, a;
894
895 /* Get twice the radius: even rows have 1 element */
896 points = gaussian_row_get64(rad * 2, &npoints, &weight);
897 for (i = -rad ; i < w + rad; i ++){
898 r = g = b = a = 0;
899 for (k = -rad ; k <= rad ; k ++){
900 if ((k + i) < 0) continue;
901 if ((k + i) >= w) continue;
902 all(+=, a, r, g, b, points[k + rad], in + k + i);
903 }
904 *(out) = ARGB_JOIN(wavg(a, weight),
905 wavg(r, weight),
906 wavg(g, weight),
907 wavg(b, weight));
908 out++;
909 }
910 return 0;
911}
912
913static int
914gaussian_filter_v(int rad, uint32_t *in, int h, int skip, uint32_t *out)
915{
916 const uint32_t *points;
917 int npoints = 0;
918 uint32_t weight = 0;
919 int i = 0, k = 0;
920 uint32_t r, g, b, a;
921
922 /* Get twice the radius: even rows have 1 element */
923 points = gaussian_row_get(rad * 2, &npoints, &weight);
924 weight = 0;
925 for (i = 0; i < npoints; i++) weight += points[i];
926
927 for (i = -rad; i < (h + rad); i++)
928 {
929 r = g = b = a = 0;
930 for (k = -rad; k <= rad; k++)
931 {
932 if ((k + i) < 0) continue;
933 if ((k + i) >= h) continue;
934 all(+=, a, r, g, b, points[k + rad], in + (skip * (k + i)));
935 }
936 *(out) = ARGB_JOIN(wavg(a, weight),
937 wavg(r, weight),
938 wavg(g, weight),
939 wavg(b, weight));
940 out += skip;
941 }
942 return 0;
943}
944
945static int
946gaussian_filter_v64(int rad, uint32_t *in, int h, int skip, uint32_t *out)
947{
948 const uint64_t *points;
949 int npoints = 0;
950 uint64_t weight;
951 int i = 0, k = 0;
952 uint64_t r, g, b, a;
953
954 /* Get twice the radius: even rows have 1 element */
955 points = gaussian_row_get64(rad * 2, &npoints, &weight);
956 weight = 0;
957 for (i = 0; i < npoints; i++) weight += points[i];
958
959 for (i = -rad; i < (h + rad); i++)
960 {
961 r = g = b = a = 0;
962 for (k = -rad ; k <= rad ; k++)
963 {
964 if ((k + i) < 0) continue;
965 if ((k + i) >= h) continue;
966 all(+=, a, r, g, b, points[k + rad], in + (skip * (k + i)));
967 }
968 *(out) = ARGB_JOIN(wavg(a, weight),
969 wavg(r, weight),
970 wavg(g, weight),
971 wavg(b, weight));
972 out += skip;
973 }
974 return 0;
975}
976
977static int
978gaussian_filter_vd(int rad, uint32_t *in, int h, int skip, uint32_t *out)
979{
980 const double *points;
981 int npoints = 0;
982 double weight = 0.0;
983 int i = 0, k = 0;
984 double r, g, b, a;
985
986 /* Get twice the radius: even rows have 1 element */
987 points = gaussian_row_getd(rad * 2, &npoints, &weight);
988 weight = 0;
989 for (i = 0 ; i < npoints ; i ++) weight += points[i];
990
991 for (i = -rad ; i < h + rad; i ++)
992 {
993 r = g = b = a = 0;
994 for (k = -rad ; k <= rad ; k ++)
995 {
996 if ((k + i) < 0) continue;
997 if ((k + i) >= h) continue;
998 all(+=, a, r, g, b, points[k + rad], in + (skip * (k + i)));
999 }
1000 *(out) = ARGB_JOIN(wavgd(a, weight),
1001 wavgd(r, weight),
1002 wavgd(g, weight),
1003 wavgd(b, weight));
1004 out += skip;
1005 }
1006 return 0;
1007}
1008
1009static const uint32_t *
1010gaussian_row_get(int row, int *npoints, uint32_t *weight)
1011{
1012 static uint32_t *points = NULL;
1013 static int last = -1;
1014 static uint32_t lastweight = -1;
1015 int c, k;
1016
1017 if (row < 0) return NULL;
1018
1019 if (npoints) *npoints = row + 1;
1020
1021 if (last == row)
1022 {
1023 if (weight) *weight = lastweight;
1024 return points;
1025 }
1026 if (points) free(points);
1027
1028 points = malloc((row + 1) * sizeof(uint32_t));
1029 if (!points)
1030 {
1031 last = -1;
1032 return NULL;
1033 }
1034 last = row;
1035
1036 c = 1;
1037 for (k = 0; k <= row; k++)
1038 {
1039 points[k] = c;
1040 c = c * (row - k) / (k + 1);
1041 }
1042
1043 for (k = 0, lastweight = 0; k <= row; k++) lastweight += points[k];
1044 if (weight) *weight = lastweight;
1045 return points;
1046}
1047
1048static const uint64_t *
1049gaussian_row_get64(int row, int *npoints, uint64_t *weight)
1050{
1051 static uint64_t *points = NULL;
1052 static int last = -1;
1053 static uint64_t lastweight = -1;
1054 uint64_t c;
1055 int k;
1056
1057 if (row < 0) return NULL;
1058
1059 if (npoints) *npoints = row + 1;
1060 if (last == row)
1061 {
1062 if (weight) *weight = lastweight;
1063 return points;
1064 }
1065 if (points) free(points);
1066
1067 points = malloc((row + 1) * sizeof(uint64_t));
1068 if (!points)
1069 {
1070 last = -1;
1071 return NULL;
1072 }
1073 last = row;
1074
1075 c = 1;
1076 for (k = 0; k <= row; k++)
1077 {
1078 points[k] = c;
1079 c = c * (row - k) / (k + 1);
1080 }
1081
1082 for (k = 0, lastweight = 0; k <= row; k ++) lastweight += points[k];
1083 if (weight) *weight = lastweight;
1084
1085 return points;
1086}
1087
1088static const double *
1089gaussian_row_getd(int row, int *npoints, double *weight)
1090{
1091 static double *points = NULL;
1092 static int last = -1;
1093 static double lastweight = -1;
1094 double c;
1095 int k;
1096
1097 if (row < 0) return NULL;
1098
1099 if (last == row)
1100 {
1101 if (weight) *weight = lastweight;
1102 return points;
1103 }
1104
1105 if (points) free(points);
1106 points = malloc((row + 1) * sizeof(double));
1107 if (!points)
1108 {
1109 last = -1;
1110 return NULL;
1111 }
1112 last = row;
1113
1114 if (npoints) *npoints = row + 1;
1115
1116 c = 1;
1117 for (k = 0; k <= row; k++)
1118 {
1119 points[k] = c;
1120 c = c * (row - k) / (k + 1);
1121 }
1122
1123 for (k = 0, lastweight = 0; k <= row; k++) lastweight += points[k];
1124 if (weight) *weight = lastweight;
1125
1126 return points;
1127}
1128
1129#if BUILD_NEON0
1130static Eina_Bool
1131negation_filter_neon(Evas_Filter_Info *info, RGBA_Image *src, RGBA_Image *dst)
1132{
1133 uint32_t tmp;
1134
1135 if (src->cache_entry.flags.alpha)
1136 {
1137 // FIXME: not implemented
1138 }
1139 else
1140 {
1141 /* No alpha */
1142#define AP "NEG_FILTER_NA"
1143 asm volatile (
1144
1145 ".fpu neon \n\t"
1146 "vdup.u32 q14, $0xff000000 \n\t"
1147 "vmvn.u32 q15, q1 \n\t"
1148
1149 // fixme: do check for small loops
1150 AP"loopinit: \n\t"
1151 "sub %[tmp], %[e], #31 \n\t"
1152
1153 AP"loop: \n\t"
1154 "vldm %[s]!, {d0,d1,d2,d3} \n\t"
1155 "vand q2, q0, q15 \n\t"
1156 "vand q3, q1, q15 \n\t"
1157 "vand q4, q0, q14 \n\t"
1158 "vand q5, q1, q14 \n\t"
1159 // fixme: can i do this with xor
1160 "cmp %[tmp], %[s] \n\t"
1161
1162 "vmvn q6, q2 \n\t"
1163 "vmvn q7, q3 \n\t"
1164
1165 "vorr q0, q6,q4 \n\t"
1166 "vorr q1, q7,q5 \n\t"
1167
1168 "vstm %[d]!, {d0,d1,d2,d3} \n\t"
1169
1170 "bhi "AP"loop \n\t"
1171
1172 : // no out
1173 : // input
1174 [e] "r" (src->image.data+ src->cache_entry.w*src->cache_entry.h),
1175 [s] "r" (src->image.data),
1176 [tmp] "r" (tmp),
1177 [d] "r" (dst->image.data)
1178 : "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q14", "q15",
1179 "memory"
1180 );
1181#undef AP
1182 }
1183 return EINA_TRUE;
1184}
1185#endif
1186
1187static Eina_Bool
1188negation_filter(Evas_Filter_Info *info, RGBA_Image *src, RGBA_Image *dst)
1189{
1190 uint32_t *in, *out;
1191 int i,j;
1192 int w,h;
1193 uint32_t a;
1194 uint8_t r,g,b;
1195
1196#if BUILD_NEON0
1197 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON) &&
1198 (!src->cache_entry.flags.alpha))
1199 return negation_filter_neon(info, src, dst);
1200#endif
1201
1202 in = src->image.data;
1203 out = dst->image.data;
1204 w = src->cache_entry.w;
1205 h = src->cache_entry.h;
1206
1207 if (src->cache_entry.flags.alpha)
1208 {
1209 for (i = 0; i < h; i++)
1210 {
1211 for (j = 0; j < w; j++)
1212 {
1213 a = A_VAL(in);
1214 r = R_VAL(in);
1215 g = G_VAL(in);
1216 b = B_VAL(in);
1217 *out = ARGB_JOIN(a, a - r, a - g, a - b);
1218 out++;
1219 in++;
1220 }
1221 }
1222 }
1223 else
1224 {
1225 for (i = 0; i < h; i++)
1226 {
1227 for (j = 0; j < w; j++)
1228 {
1229 a = A_VAL(in);
1230 r = R_VAL(in);
1231 g = G_VAL(in);
1232 b = B_VAL(in);
1233 *out = ARGB_JOIN(a, ~r, ~g, ~b);
1234 out++;
1235 in++;
1236 }
1237 }
1238 }
1239 return EINA_TRUE;
1240 info = NULL;
1241}
1242
1243static Eina_Bool
1244sepia_filter(Evas_Filter_Info *info EINA_UNUSED, RGBA_Image *src, RGBA_Image *dst)
1245{
1246 uint32_t *in, *out;
1247 int i, j;
1248 int w, h;
1249 uint32_t a, r, g, b, nr, ng, nb;
1250
1251 in = src->image.data;
1252 out = dst->image.data;
1253 w = src->cache_entry.w;
1254 h = src->cache_entry.h;
1255
1256 for (i = 0; i < h; i++)
1257 {
1258 for (j = 0; j < w; j++)
1259 {
1260 a = A_VAL(in);
1261 r = R_VAL(in);
1262 g = G_VAL(in);
1263 b = B_VAL(in);
1264 nr = ((uint32_t)((r * 0.393) + (g * 0.769) + (b * 0.189)));
1265 ng = ((uint32_t)((r * 0.349) + (g * 0.686) + (b * 0.168)));
1266 nb = ((uint32_t)((r * 0.272) + (g * 0.534) + (b * 0.131)));
1267 if (nr > 255) nr = 255;
1268 if (ng > 255) ng = 255;
1269 if (nb > 255) nb = 255;
1270 *out = ARGB_JOIN(a, nr, ng, nb);
1271 out++;
1272 in++;
1273 }
1274 }
1275
1276 return EINA_TRUE;
1277
1278}
1279
1280static Eina_Bool
1281greyscale_filter(Evas_Filter_Info *info EINA_UNUSED, RGBA_Image *src, RGBA_Image *dst)
1282{
1283 uint32_t *in, *out;
1284 int i, j;
1285 int w, h;
1286 uint32_t cur;
1287 uint32_t a, r, g, b;
1288
1289 in = src->image.data;
1290 out = dst->image.data;
1291 w = src->cache_entry.w;
1292 h = src->cache_entry.h;
1293
1294 if (src->cache_entry.flags.alpha)
1295 {
1296 for (i = 0; i < h; i++)
1297 {
1298 for (j = 0; j < w; j++)
1299 {
1300 a = A_VAL(in);
1301 r = R_VAL(in);
1302 g = G_VAL(in);
1303 b = B_VAL(in);
1304 cur = (r * 0.3) + (g * 0.59) + (b * 0.11);
1305 *out = ARGB_JOIN(a, r, g, b);
1306 out++;
1307 in++;
1308 }
1309 }
1310 }
1311 else
1312 {
1313 for (i = 0 ; i < h ; i ++)
1314 {
1315 for (j = 0; j < w ; j ++)
1316 {
1317 r = R_VAL(in);
1318 g = G_VAL(in);
1319 b = B_VAL(in);
1320 cur = r * 0.3 + g * 0.59 + b * 0.11;
1321 *out = ARGB_JOIN(255, r, g, b);
1322 out++;
1323 in++;
1324 }
1325 }
1326 }
1327 return EINA_TRUE;
1328}
1329
1330static Eina_Bool
1331brightness_filter(Evas_Filter_Info *info, RGBA_Image *src, RGBA_Image *dst)
1332{
1333 uint32_t *in, *out;
1334 int i, j;
1335 int w, h;
1336 int a,r,g,b;
1337 int delta;
1338 int adjdelta;
1339 Evas_Filter_Info_Brightness *bness;
1340
1341 in = src->image.data;
1342 out = dst->image.data;
1343 w = src->cache_entry.w;
1344 h = src->cache_entry.h;
1345 bness = info->data;
1346
1347 delta = bness->adjust * 255;
1348 if (delta > 255)
1349 delta = 255;
1350 else if (delta < -255)
1351 delta = -255;
1352
1353 /* Note we could optimise the -255, 0 and 255 cases, but why would people
1354 * be doing that */
1355 if (delta >= 0)
1356 {
1357 for (i = 0; i < h; i++)
1358 {
1359 for (j = 0; j < w; j++)
1360 {
1361 a = A_VAL(in);
1362 r = R_VAL(in);
1363 g = G_VAL(in);
1364 b = B_VAL(in);
1365 adjdelta = (a * delta) >> 8;
1366 r = MIN(r + adjdelta, a);
1367 g = MIN(g + adjdelta, a);
1368 b = MIN(b + adjdelta, a);
1369 *out = ARGB_JOIN(a, r ,g, b);
1370 out++;
1371 in++;
1372 }
1373 }
1374 }
1375 else
1376 {
1377 /* Delta negative */
1378 for (i = 0; i < h; i++)
1379 {
1380 for (j = 0; j < w; j++)
1381 {
1382 a = A_VAL(in);
1383 r = R_VAL(in);
1384 g = G_VAL(in);
1385 b = B_VAL(in);
1386 adjdelta = (a * delta) >> 8;
1387 r = MAX(r + adjdelta, 0);
1388 g = MAX(g + adjdelta, 0);
1389 b = MAX(b + adjdelta, 0);
1390 *out = ARGB_JOIN(a, r ,g, b);
1391 out++;
1392 in++;
1393 }
1394 }
1395 }
1396
1397 return EINA_TRUE;
1398
1399}
1400
1401static Eina_Bool
1402contrast_filter(Evas_Filter_Info *info EINA_UNUSED, RGBA_Image *src, RGBA_Image *dst)
1403{
1404 uint32_t *in, *out;
1405 int i, j;
1406 int w, h;
1407
1408 in = src->image.data;
1409 out = dst->image.data;
1410 w = src->cache_entry.w;
1411 h = src->cache_entry.h;
1412
1413 for (i = 0; i < h; i++)
1414 {
1415 for (j = 0; j < w; j++)
1416 {
1417 // FIXME: not even implemented
1418 out++;
1419 in++;
1420 }
1421 }
1422
1423 return EINA_TRUE;
1424
1425}
1426#endif
1427
1428/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index dd26568758..0831946105 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -2873,158 +2873,6 @@ _proxy_subrender(Evas *eo_e, Evas_Object *eo_source)
2873 */ 2873 */
2874} 2874}
2875 2875
2876#if 0 // filtering disabled
2877/*
2878 *
2879 * Note that this is similar to proxy_subrender_recurse. It should be
2880 * possible to merge I guess
2881 */
2882static void
2883image_filter_draw_under_recurse(Evas *eo_e, Evas_Object *eo_obj, Evas_Object *stop,
2884 void *output, void *ctx, void *surface,
2885 int x, int y)
2886{
2887 Evas_Object *eo_obj2;
2888
2889 if (obj->clip.clipees) return;
2890 /* FIXME: Doing bounding box test */
2891 if (!evas_object_is_in_output_rect(eo_obj, stop->cur.geometry.x,
2892 stop->cur.geometry.y,
2893 stop->cur.geometry.w,
2894 stop->cur.geometry.h))
2895 return;
2896
2897 if (!evas_object_is_visible(eo_obj)) return;
2898 obj->pre_render_done = 1;
2899 ctx = e->engine.func->context_new(output);
2900
2901 if (obj->is_smart)
2902 {
2903 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj2)
2904 {
2905 if (obj2 == stop) return;
2906 image_filter_draw_under_recurse(e, obj2, stop, output, surface,
2907 ctx, x, y);
2908 }
2909 }
2910 else
2911 obj->func->render(eo_obj, output, ctx, surface, x ,y);
2912 e->engine.func->context_free(output, ctx);
2913}
2914
2915/*
2916 * Draw all visible objects intersecting an object which are _beneath_ it.
2917 */
2918static void
2919image_filter_draw_under(Evas *eo_e, Evas_Object *stop, void *output, void *ctx, void *surface, int dx, int dy)
2920{
2921 Evas_Layer *lay;
2922 int x, y;
2923
2924 x = stop->cur.geometry.x - dx;
2925 y = stop->cur.geometry.y - dy;
2926
2927 EINA_INLIST_FOREACH(e->layers, lay)
2928 {
2929 Evas_Object *eo_obj;
2930 EINA_INLIST_FOREACH(lay->objects, obj)
2931 {
2932 if (obj->delete_me) continue;
2933 if (obj == stop) return;
2934 /* FIXME: Do bounding box check */
2935 image_filter_draw_under_recurse(e, obj, stop, output, ctx,
2936 surface, -x, -y);
2937 }
2938 }
2939 e->engine.func->image_dirty_region(output, surface, 0, 0, 300, 300);
2940 e->engine.func->output_flush(output);
2941}
2942
2943/*
2944 * Update the filtered object.
2945 *
2946 * Creates a new context, and renders stuff (filtered) onto that.
2947 */
2948Filtered_Image *
2949image_filter_update(Evas *eo_e, Evas_Object *eo_obj, void *src, int imagew, int imageh, int *outw, int *outh)
2950{
2951 int w, h;
2952 void *ctx;
2953 Evas_Filter_Info *info;
2954 void *surface;
2955 Eina_Bool alpha;
2956
2957 info = obj->filter;
2958
2959 if (info->mode == EVAS_FILTER_MODE_BELOW)
2960 {
2961 w = obj->cur.geometry.w;
2962 h = obj->cur.geometry.h;
2963 evas_filter_get_size(info, w, h, &imagew, &imageh, EINA_TRUE);
2964 alpha = EINA_FALSE;
2965 }
2966 else
2967 {
2968 evas_filter_get_size(info, imagew, imageh, &w, &h, EINA_FALSE);
2969 alpha = e->engine.func->image_alpha_get(e->engine.data.output, src);
2970 }
2971
2972 /* Certain filters may make alpha images anyway */
2973 if (alpha == EINA_FALSE) alpha = evas_filter_always_alpha(info);
2974
2975 surface = e->engine.func->image_map_surface_new(e->engine.data.output, w, h,
2976 alpha);
2977
2978 if (info->mode == EVAS_FILTER_MODE_BELOW)
2979 {
2980 void *subsurface;
2981 int disw, dish;
2982 int dx, dy;
2983 disw = obj->cur.geometry.w;
2984 dish = obj->cur.geometry.h;
2985 dx = (imagew - w) >> 1;
2986 dy = (imageh - h) >> 1;
2987 subsurface = e->engine.func->image_map_surface_new
2988 (e->engine.data.output, imagew, imageh, 1);
2989 ctx = e->engine.func->context_new(e->engine.data.output);
2990 e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 255, 0, 255);
2991 e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_RENDER_COPY);
2992 e->engine.func->rectangle_draw(e->engine.data.output, ctx,
2993 subsurface, 0, 0, imagew, imageh);
2994
2995 image_filter_draw_under(e, obj, e->engine.data.output, ctx,
2996 subsurface, dx, dy);
2997
2998 e->engine.func->context_free(e->engine.data.output, ctx);
2999
3000 ctx = e->engine.func->context_new(e->engine.data.output);
3001
3002 e->engine.func->image_draw_filtered(e->engine.data.output,
3003 ctx, surface, subsurface, info);
3004
3005 e->engine.func->context_free(e->engine.data.output, ctx);
3006
3007 e->engine.func->image_map_surface_free(e->engine.data.output,
3008 subsurface);
3009 }
3010 else
3011 {
3012 ctx = e->engine.func->context_new(e->engine.data.output);
3013 e->engine.func->image_draw_filtered(e->engine.data.output,
3014 ctx, surface, src, info);
3015 e->engine.func->context_free(e->engine.data.output, ctx);
3016 }
3017
3018 e->engine.func->image_dirty_region(e->engine.data.output, surface,
3019 0, 0, w, h);
3020 if (outw) *outw = w;
3021 if (outh) *outh = h;
3022 return e->engine.func->image_filtered_save(src, surface,
3023 obj->filter->key,
3024 obj->filter->len);
3025}
3026#endif
3027
3028static void 2876static void
3029evas_object_image_unload(Evas_Object *eo_obj, Eina_Bool dirty) 2877evas_object_image_unload(Evas_Object *eo_obj, Eina_Bool dirty)
3030{ 2878{
@@ -3365,57 +3213,6 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3365 o->proxyrendering = EINA_FALSE; 3213 o->proxyrendering = EINA_FALSE;
3366 } 3214 }
3367 3215
3368#if 0 // filtering disabled
3369 /* Now check/update filter */
3370 if (obj->filter && obj->filter->filter)
3371 {
3372 Filtered_Image *fi = NULL;
3373 //printf("%p has filter: %s\n", obj,obj->filter->dirty?"dirty":"clean");
3374 if (obj->filter->dirty)
3375 {
3376 if (obj->filter->mode != EVAS_FILTER_MODE_BELOW)
3377 {
3378 uint32_t len;
3379 uint8_t *key;
3380
3381 if (obj->filter->key) free(obj->filter->key);
3382 obj->filter->key = NULL;
3383 obj->filter->len = 0;
3384 key = evas_filter_key_get(obj->filter, &len);
3385 if (key)
3386 {
3387 obj->filter->key = key;
3388 obj->filter->len = len;
3389 fi = obj->layer->evas->engine.func->image_filtered_get
3390 (o->engine_data, key, len);
3391 if (obj->filter->cached && fi != obj->filter->cached)
3392 {
3393 obj->layer->evas->engine.func->image_filtered_free
3394 (o->engine_data, obj->filter->cached);
3395 obj->filter->cached = NULL;
3396 }
3397 }
3398 }
3399 else if (obj->filter->cached)
3400 {
3401 obj->layer->evas->engine.func->image_filtered_free
3402 (o->engine_data, obj->filter->cached);
3403 }
3404 if (!fi)
3405 fi = image_filter_update(obj->layer->evas, obj, pixels,
3406 imagew, imageh, &imagew, &imageh);
3407 pixels = fi->image;
3408 obj->filter->dirty = 0;
3409 obj->filter->cached = fi;
3410 }
3411 else
3412 {
3413 fi = obj->filter->cached;
3414 pixels = fi->image;
3415 }
3416 }
3417#endif
3418
3419 if (pixels) 3216 if (pixels)
3420 { 3217 {
3421 Evas_Coord idw, idh, idx, idy; 3218 Evas_Coord idw, idh, idx, idy;
@@ -3944,12 +3741,6 @@ evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
3944 } 3741 }
3945 } 3742 }
3946 } 3743 }
3947#if 0 // filtering disabled
3948 if (obj->filter && obj->filter->dirty)
3949 {
3950 evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
3951 }
3952#endif
3953 /* it obviously didn't change - add a NO obscure - this "unupdates" this */ 3744 /* it obviously didn't change - add a NO obscure - this "unupdates" this */
3954 /* area so if there were updates for it they get wiped. don't do it if we */ 3745 /* area so if there were updates for it they get wiped. don't do it if we */
3955 /* aren't fully opaque and we are visible */ 3746 /* aren't fully opaque and we are visible */
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index 6a9bce835f..8cde87ab5f 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -88,9 +88,6 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
88 88
89 int was_smart_child = 0; 89 int was_smart_child = 0;
90 90
91#if 0 // filtering disabled
92 evas_filter_free(eo_obj);
93#endif
94 if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(eo_obj, NULL); 91 if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(eo_obj, NULL);
95 evas_object_map_set(eo_obj, NULL); 92 evas_object_map_set(eo_obj, NULL);
96 if (obj->prev.map) evas_map_free(obj->prev.map); 93 if (obj->prev.map) evas_map_free(obj->prev.map);
diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c
index 05cc9aaf2c..5262d5fd58 100644
--- a/src/lib/evas/common/evas_image_main.c
+++ b/src/lib/evas/common/evas_image_main.c
@@ -203,20 +203,7 @@ _evas_common_rgba_image_delete(Image_Entry *ie)
203 ie->file, ie->key); 203 ie->file, ie->key);
204 // if (ie->data1) evas_cserve2_image_free(ie); 204 // if (ie->data1) evas_cserve2_image_free(ie);
205#endif 205#endif
206/*
207 * FIXME: This doesn't seem to be needed... But I'm not sure why.
208 * -- nash
209 {
210 Filtered_Image *fi;
211 206
212 EINA_LIST_FREE(im->filtered, fi)
213 {
214 free(fi->key);
215 _evas_common_rgba_image_delete((Image_Entry *)(fi->image));
216 free(fi);
217 }
218 }
219*/
220 if (ie->frames) 207 if (ie->frames)
221 { 208 {
222 Eina_List *l; 209 Eina_List *l;
diff --git a/src/lib/evas/include/evas_common.h b/src/lib/evas/include/evas_common.h
index cdc6a0e47a..349598bee0 100644
--- a/src/lib/evas/include/evas_common.h
+++ b/src/lib/evas/include/evas_common.h
@@ -487,10 +487,6 @@ typedef enum _Font_Rend_Flags
487 487
488/*****************************************************************************/ 488/*****************************************************************************/
489 489
490#if 0 // filtering disabled
491typedef struct _Filtered_Image Filtered_Image;
492#endif
493
494struct _RGBA_Image_Loadopts 490struct _RGBA_Image_Loadopts
495{ 491{
496 int scale_down_by; // if > 1 then use this 492 int scale_down_by; // if > 1 then use this
@@ -806,10 +802,6 @@ struct _RGBA_Image
806 Eina_Bool dirty: 1; 802 Eina_Bool dirty: 1;
807 } mask; 803 } mask;
808 804
809#if 0 // filtering disabled
810 Eina_List *filtered;
811#endif
812
813 struct { 805 struct {
814 LK(lock); 806 LK(lock);
815 Eina_List *list; 807 Eina_List *list;
@@ -859,16 +851,6 @@ struct _RGBA_Map
859 RGBA_Map_Point pts[1]; 851 RGBA_Map_Point pts[1];
860}; 852};
861 853
862#if 0 // filtering disabled
863struct _Filtered_Image
864{
865 void *key;
866 size_t keylen;
867 RGBA_Image *image;
868 int ref;
869};
870#endif
871
872// for fonts... 854// for fonts...
873///// 855/////
874typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map; 856typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map;
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 357eae0cbf..de5903f2a8 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -487,35 +487,6 @@ struct _Evas_Map
487 Evas_Map_Point points[]; // actual points 487 Evas_Map_Point points[]; // actual points
488}; 488};
489 489
490#if 0 // filtering disabled
491/* nash: Split into two bits */
492typedef struct Evas_Filter_Info
493{
494 Evas_Filter filter;
495 Evas_Filter_Mode mode;
496
497 Eina_Bool dirty : 1;
498
499 int datalen;
500 void *data;
501 void (*data_free)(void *);
502
503 uint8_t *key;
504 uint32_t len;
505 Filtered_Image *cached;
506} Evas_Filter_Info;
507
508typedef Eina_Bool (*Evas_Software_Filter_Fn)(Evas_Filter_Info *, RGBA_Image *, RGBA_Image *);
509
510int evas_filter_get_size(Evas_Filter_Info *info, int inw, int inh,
511 int *outw, int *outh, Eina_Bool inv);
512Eina_Bool evas_filter_always_alpha(Evas_Filter_Info *info);
513uint8_t *evas_filter_key_get(const Evas_Filter_Info *info, uint32_t *lenp);
514// expose for use in engines
515EAPI Evas_Software_Filter_Fn evas_filter_software_get(Evas_Filter_Info *info);
516void evas_filter_free(Evas_Object *o);
517#endif
518
519struct _Evas_Object_Protected_Data 490struct _Evas_Object_Protected_Data
520{ 491{
521 EINA_INLIST; 492 EINA_INLIST;
@@ -601,9 +572,6 @@ struct _Evas_Object_Protected_Data
601 572
602 // Pointer to the Evas_Object itself 573 // Pointer to the Evas_Object itself
603 Evas_Object *object; 574 Evas_Object *object;
604#if 0 // filtering disabled
605 Evas_Filter_Info *filter;
606#endif
607 575
608 Evas_Size_Hints *size_hints; 576 Evas_Size_Hints *size_hints;
609 577
@@ -903,13 +871,6 @@ struct _Evas_Func
903 Eina_Bool (*font_text_props_info_create) (void *data, Evas_Font_Instance *fi, const Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len, Evas_Text_Props_Mode mode); 871 Eina_Bool (*font_text_props_info_create) (void *data, Evas_Font_Instance *fi, const Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len, Evas_Text_Props_Mode mode);
904 int (*font_right_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props); 872 int (*font_right_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
905 873
906#if 0 // filtering disabled
907 void (*image_draw_filtered) (void *data, void *context, void *surface, void *image, Evas_Filter_Info *filter);
908 Filtered_Image *(*image_filtered_get) (void *image, uint8_t *key, size_t len);
909 Filtered_Image *(*image_filtered_save) (void *image, void *filtered, uint8_t *key, size_t len);
910 void (*image_filtered_free) (void *image, Filtered_Image *);
911#endif
912
913 /* EFL-GL Glue Layer */ 874 /* EFL-GL Glue Layer */
914 void *(*gl_surface_create) (void *data, void *config, int w, int h); 875 void *(*gl_surface_create) (void *data, void *config, int w, int h);
915 int (*gl_surface_destroy) (void *data, void *surface); 876 int (*gl_surface_destroy) (void *data, void *surface);
diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.c b/src/modules/evas/engines/gl_cocoa/evas_engine.c
index 73c245f43c..df3f6ac7ef 100644
--- a/src/modules/evas/engines/gl_cocoa/evas_engine.c
+++ b/src/modules/evas/engines/gl_cocoa/evas_engine.c
@@ -564,40 +564,6 @@ eng_image_colorspace_set(void *data, void *image, int cspace)
564// drivers? 564// drivers?
565// 565//
566//#define GLX_TEX_PIXMAP_RECREATE 1 566//#define GLX_TEX_PIXMAP_RECREATE 1
567#if 0
568static void
569eng_image_draw_filtered(void *data, void *context, void *surface,
570 void *image, Evas_Filter_Info *filter)
571{
572 Render_Engine *re = data;
573
574 if (!image) return;
575 eng_window_use(re->win);
576 evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
577 re->win->gl_context->dc = context;
578
579 evas_gl_common_filter_draw(re->win->gl_context, image, filter);
580}
581
582static Filtered_Image *
583eng_image_filtered_get(void *im, uint8_t *key, size_t keylen)
584{
585 return evas_gl_common_image_filtered_get(im, key, keylen);
586}
587
588static Filtered_Image *
589eng_image_filtered_save(void *im, void *fim, uint8_t *key, size_t keylen)
590{
591 return evas_gl_common_image_filtered_save(im, fim, key, keylen);
592}
593
594static void
595eng_image_filtered_free(void *im, Filtered_Image *fim)
596{
597 evas_gl_common_image_filtered_free(im, fim);
598}
599
600#endif
601 567
602// 568//
603// 569//
@@ -1419,10 +1385,6 @@ module_open(Evas_Module *em)
1419 ORD(image_mask_create); 1385 ORD(image_mask_create);
1420 // ORD(image_native_set); 1386 // ORD(image_native_set);
1421 // ORD(image_native_get); 1387 // ORD(image_native_get);
1422 // ORD(image_draw_filtered);
1423 // ORD(image_filtered_get);
1424 // ORD(image_filtered_save);
1425 // ORD(image_filtered_free);
1426 1388
1427 ORD(font_draw); 1389 ORD(font_draw);
1428 1390
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 67507b3a93..2110a52fb5 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -483,25 +483,6 @@ extern Evas_GL_Program_Source shader_tex_frag_src;
483extern Evas_GL_Program_Source shader_tex_vert_src; 483extern Evas_GL_Program_Source shader_tex_vert_src;
484extern Evas_GL_Program_Source shader_tex_nomul_frag_src; 484extern Evas_GL_Program_Source shader_tex_nomul_frag_src;
485extern Evas_GL_Program_Source shader_tex_nomul_vert_src; 485extern Evas_GL_Program_Source shader_tex_nomul_vert_src;
486
487extern Evas_GL_Program_Source shader_filter_invert_frag_src;
488extern Evas_GL_Program_Source shader_filter_invert_nomul_frag_src;
489extern Evas_GL_Program_Source shader_filter_invert_bgra_frag_src;
490extern Evas_GL_Program_Source shader_filter_invert_bgra_nomul_frag_src;
491extern Evas_GL_Program_Source shader_filter_sepia_frag_src;
492extern Evas_GL_Program_Source shader_filter_sepia_nomul_frag_src;
493extern Evas_GL_Program_Source shader_filter_sepia_bgra_frag_src;
494extern Evas_GL_Program_Source shader_filter_sepia_bgra_nomul_frag_src;
495extern Evas_GL_Program_Source shader_filter_greyscale_frag_src;
496extern Evas_GL_Program_Source shader_filter_greyscale_nomul_frag_src;
497extern Evas_GL_Program_Source shader_filter_greyscale_bgra_frag_src;
498extern Evas_GL_Program_Source shader_filter_greyscale_bgra_nomul_frag_src;
499/* blur (annoyingly) needs (aka is faster with) a vertex shader */
500extern Evas_GL_Program_Source shader_filter_blur_vert_src;
501extern Evas_GL_Program_Source shader_filter_blur_frag_src;
502extern Evas_GL_Program_Source shader_filter_blur_nomul_frag_src;
503extern Evas_GL_Program_Source shader_filter_blur_bgra_frag_src;
504extern Evas_GL_Program_Source shader_filter_blur_bgra_nomul_frag_src;
505#endif 486#endif
506 487
507void glerr(int err, const char *file, const char *func, int line, const char *op); 488void glerr(int err, const char *file, const char *func, int line, const char *op);
@@ -625,13 +606,6 @@ void evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_P
625 606
626void evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2); 607void evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2);
627 608
628#if 0 // filtering disabled
629void evas_gl_common_filter_draw(Evas_Engine_GL_Context *context, Evas_GL_Image *im, Evas_Filter_Info *filter);
630Filtered_Image *evas_gl_common_image_filtered_get(Evas_GL_Image *im, uint8_t *key, size_t keylen);
631Filtered_Image *evas_gl_common_image_filtered_save(Evas_GL_Image *im, Evas_GL_Image *fimage, uint8_t *key, size_t keylen);
632void evas_gl_common_image_filtered_free(Evas_GL_Image *im, Filtered_Image *);
633#endif
634
635extern void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b); 609extern void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b);
636extern void (*glsym_glBindFramebuffer) (GLenum a, GLuint b); 610extern void (*glsym_glBindFramebuffer) (GLenum a, GLuint b);
637extern void (*glsym_glFramebufferTexture2D) (GLenum a, GLenum b, GLenum c, GLuint d, GLint e); 611extern void (*glsym_glFramebufferTexture2D) (GLenum a, GLenum b, GLenum c, GLuint d, GLint e);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_filter.c b/src/modules/evas/engines/gl_common/evas_gl_filter.c
deleted file mode 100644
index a9d18d8246..0000000000
--- a/src/modules/evas/engines/gl_common/evas_gl_filter.c
+++ /dev/null
@@ -1,181 +0,0 @@
1#include "evas_gl_private.h"
2
3#if 0 // filtering disabled
4void
5evas_gl_common_filter_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, Evas_Filter_Info *filter)
6{
7 RGBA_Draw_Context *dc;
8 GLuint prog;
9 int r,g,b,a;
10 int nomul, bgra;
11
12 dc = gc->dc;
13
14 if (dc->mul.use)
15 {
16 a = (dc->mul.col >> 24) & 0xff;
17 r = (dc->mul.col >> 16) & 0xff;
18 g = (dc->mul.col >> 8 ) & 0xff;
19 b = (dc->mul.col ) & 0xff;
20 }
21 else
22 {
23 r = g = b = a = 255;
24 }
25
26 nomul = (a == 255 && r == 255 && g == 255 && b == 255) ? 1 : 0;
27 bgra = (gc->shared->info.bgra) ? 1 : 0;
28
29 /* FIXME: This should so be a table */
30#if 0
31 if (filter->filter == EVAS_FILTER_BLUR)
32 {
33 if (bgra)
34 {
35 if (nomul)
36 prog = gc->shared->shader.filter_blur_bgra_nomul.prog;
37 else
38 prog = gc->shared->shader.filter_blur_bgra.prog;
39 }
40 else
41 {
42 if (a == 255 && r == 255 && g == 255 && b == 255)
43 prog = gc->shared->shader.filter_blur_nomul.prog;
44 else
45 prog = gc->shared->shader.filter_blur.prog;
46 }
47 }
48 else
49#endif
50 if (filter->filter == EVAS_FILTER_INVERT)
51 {
52 if (bgra)
53 {
54 if (nomul)
55 prog = gc->shared->shader.filter_invert_bgra_nomul.prog;
56 else
57 prog = gc->shared->shader.filter_invert_bgra.prog;
58 }
59 else
60 {
61 if (a == 255 && r == 255 && g == 255 && b == 255)
62 prog = gc->shared->shader.filter_invert_nomul.prog;
63 else
64 prog = gc->shared->shader.filter_invert.prog;
65 }
66 }
67 else if (filter->filter == EVAS_FILTER_SEPIA)
68 {
69 if (bgra)
70 {
71 if (nomul)
72 prog = gc->shared->shader.filter_sepia_bgra_nomul.prog;
73 else
74 prog = gc->shared->shader.filter_sepia_bgra.prog;
75 }
76 else
77 {
78 if (nomul)
79 prog = gc->shared->shader.filter_sepia_nomul.prog;
80 else
81 prog = gc->shared->shader.filter_sepia.prog;
82 }
83
84 }
85 else /*if (filter->filter == EVAS_FILTER_GREYSCALE)*/
86 {
87 printf("BGRA: %s Nomul: %s\n",bgra?"true":"false",nomul?"nomul":"mul");
88 if (bgra)
89 {
90 if (nomul)
91 prog = gc->shared->shader.filter_greyscale_bgra_nomul.prog;
92 else
93 prog = gc->shared->shader.filter_greyscale_bgra.prog;
94 }
95 else
96 {
97 if (nomul)
98 prog = gc->shared->shader.filter_greyscale_nomul.prog;
99 else
100 prog = gc->shared->shader.filter_greyscale.prog;
101 }
102
103 }
104
105 printf("Prog: %d %d %d\n",prog,im->w,im->h);
106 gc->filter_prog = prog;
107 evas_gl_common_image_update(gc, im);
108 evas_gl_common_context_image_push(gc, im->tex, 0, 0, im->w, im->h,
109 0, 0, im->w, im->h,
110 r,g,b,a,
111 1, im->tex_only);
112 gc->filter_prog = 0;
113}
114
115
116Filtered_Image *
117evas_gl_common_image_filtered_get(Evas_GL_Image *im, uint8_t *key, size_t len)
118{
119 Filtered_Image *fi;
120 Eina_List *l;
121
122 for (l = im->filtered ; l ; l = l->next)
123 {
124 fi = l->data;
125 if (fi->keylen != len) continue;
126 if (memcmp(key, fi->key, len) != 0) continue;
127 fi->ref ++;
128 return fi;
129 }
130
131 return NULL;
132}
133
134Filtered_Image *
135evas_gl_common_image_filtered_save(Evas_GL_Image *im, Evas_GL_Image *fimage,
136 uint8_t *key, size_t keylen)
137{
138 Filtered_Image *fi;
139 Eina_List *l;
140
141 for (l = im->filtered ; l ; l = l->next)
142 {
143 fi = l->data;
144 if (fi->keylen != keylen) continue;
145 if (memcmp(key, fi->key, keylen) != 0) continue;
146
147 fi->image = (void *)fimage;
148 fi->ref ++;
149 return fi;
150 }
151
152 fi = calloc(1,sizeof(Filtered_Image));
153 if (!fi) return NULL;
154
155 fi->keylen = keylen;
156 fi->key = malloc(keylen);
157 memcpy(fi->key, key, keylen);
158 fi->image = (void *)fimage;
159 fi->ref = 1;
160
161 im->filtered = eina_list_prepend(im->filtered, fi);
162
163 return fi;
164}
165
166void
167evas_gl_common_image_filtered_free(Evas_GL_Image *image, Filtered_Image *fi)
168{
169 fi->ref --;
170 if (fi->ref) return;
171
172 free(fi->key);
173 evas_gl_common_image_free((void *)fi->image);
174 fi->image = NULL;
175
176 image->filtered = eina_list_remove(image->filtered, fi);
177}
178#endif
179
180
181/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
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 404cb13806..8289ed9f53 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -467,10 +467,6 @@ evas_gl_common_image_cache_flush(Evas_Engine_GL_Context *gc)
467void 467void
468evas_gl_common_image_free(Evas_GL_Image *im) 468evas_gl_common_image_free(Evas_GL_Image *im)
469{ 469{
470#if 0 // filtering disabled
471 Filtered_Image *fi;
472#endif
473
474 evas_gl_common_context_flush(im->gc); 470 evas_gl_common_context_flush(im->gc);
475 im->references--; 471 im->references--;
476 if (im->references > 0) return; 472 if (im->references > 0) return;
@@ -489,15 +485,6 @@ evas_gl_common_image_free(Evas_GL_Image *im)
489 if (im->im) evas_cache_image_drop(&im->im->cache_entry); 485 if (im->im) evas_cache_image_drop(&im->im->cache_entry);
490 if (im->tex) evas_gl_common_texture_free(im->tex); 486 if (im->tex) evas_gl_common_texture_free(im->tex);
491 487
492#if 0 // filtering disabled
493 EINA_LIST_FREE(im->filtered, fi)
494 {
495 free(fi->key);
496 evas_gl_common_image_free((Evas_GL_Image *)fi->image);
497 free(fi);
498 }
499#endif
500
501 free(im); 488 free(im);
502} 489}
503 490
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 477e47072f..fe6207c83e 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_shader.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_shader.c
@@ -286,167 +286,6 @@ Evas_GL_Program_Source shader_img_bgra_nomul_vert_src =
286 NULL, 0 286 NULL, 0
287}; 287};
288 288
289/////////////////////////////////////////////
290const char filter_invert_frag_glsl[] =
291#include "shader/filter_invert.h"
292 ;
293Evas_GL_Program_Source shader_filter_invert_frag_src =
294{
295 filter_invert_frag_glsl,
296 NULL, 0
297};
298
299const char filter_invert_nomul_frag_glsl[] =
300#include "shader/filter_invert_nomul.h"
301 ;
302Evas_GL_Program_Source shader_filter_invert_nomul_frag_src =
303{
304 filter_invert_nomul_frag_glsl,
305 NULL, 0
306};
307
308const char filter_invert_bgra_frag_glsl[] =
309#include "shader/filter_invert_bgra.h"
310 ;
311Evas_GL_Program_Source shader_filter_invert_bgra_frag_src =
312{
313 filter_invert_bgra_frag_glsl,
314 NULL, 0
315};
316
317const char filter_invert_bgra_nomul_frag_glsl[] =
318#include "shader/filter_invert_bgra_nomul.h"
319 ;
320Evas_GL_Program_Source shader_filter_invert_bgra_nomul_frag_src =
321{
322 filter_invert_bgra_nomul_frag_glsl,
323 NULL, 0
324};
325
326/////////////////////////////////////////////
327const char filter_greyscale_frag_glsl[] =
328#include "shader/filter_greyscale.h"
329 ;
330Evas_GL_Program_Source shader_filter_greyscale_frag_src =
331{
332 filter_greyscale_frag_glsl,
333 NULL, 0
334};
335
336const char filter_greyscale_nomul_frag_glsl[] =
337#include "shader/filter_greyscale_nomul.h"
338 ;
339Evas_GL_Program_Source shader_filter_greyscale_nomul_frag_src =
340{
341 filter_greyscale_nomul_frag_glsl,
342 NULL, 0
343};
344
345const char filter_greyscale_bgra_frag_glsl[] =
346#include "shader/filter_greyscale_bgra.h"
347 ;
348Evas_GL_Program_Source shader_filter_greyscale_bgra_frag_src =
349{
350 filter_greyscale_bgra_frag_glsl,
351 NULL, 0
352};
353const char filter_greyscale_bgra_nomul_frag_glsl[] =
354#include "shader/filter_greyscale_bgra_nomul.h"
355 ;
356Evas_GL_Program_Source shader_filter_greyscale_bgra_nomul_frag_src =
357{
358 filter_greyscale_bgra_nomul_frag_glsl,
359 NULL, 0
360};
361
362/////////////////////////////////////////////
363const char filter_sepia_frag_glsl[] =
364#include "shader/filter_sepia.h"
365 ;
366Evas_GL_Program_Source shader_filter_sepia_frag_src =
367{
368 filter_sepia_frag_glsl,
369 NULL, 0
370};
371
372const char filter_sepia_nomul_frag_glsl[] =
373#include "shader/filter_sepia_nomul.h"
374 ;
375Evas_GL_Program_Source shader_filter_sepia_nomul_frag_src =
376{
377 filter_sepia_nomul_frag_glsl,
378 NULL, 0
379};
380
381const char filter_sepia_bgra_frag_glsl[] =
382#include "shader/filter_sepia_bgra.h"
383 ;
384Evas_GL_Program_Source shader_filter_sepia_bgra_frag_src =
385{
386 filter_sepia_bgra_frag_glsl,
387 NULL, 0
388};
389const char filter_sepia_bgra_nomul_frag_glsl[] =
390#include "shader/filter_sepia_bgra_nomul.h"
391 ;
392Evas_GL_Program_Source shader_filter_sepia_bgra_nomul_frag_src =
393{
394 filter_sepia_bgra_nomul_frag_glsl,
395 NULL, 0
396};
397
398/////////////////////////////////////////////
399#if 0
400 Blur is a work in progress currently.
401 Mostly because GPUs are so hopeless.
402const char filter_blur_vert_glsl[] =
403#include "shader/filter_blur_vert.h"
404 ;
405
406Evas_GL_Program_Source shader_filter_blur_vert_src =
407{
408 filter_blur_vert_glsl,
409 NULL, 0
410};
411
412const char filter_blur_frag_glsl[] =
413#include "shader/filter_blur.h"
414 ;
415Evas_GL_Program_Source shader_filter_blur_frag_src =
416{
417 filter_blur_frag_glsl,
418 NULL, 0
419};
420
421const char filter_blur_nomul_frag_glsl[] =
422#include "shader/filter_blur_nomul.h"
423 ;
424Evas_GL_Program_Source shader_filter_blur_nomul_frag_src =
425{
426 filter_blur_nomul_frag_glsl,
427 NULL, 0
428};
429
430const char filter_blur_bgra_frag_glsl[] =
431#include "shader/filter_blur_bgra.h"
432 ;
433Evas_GL_Program_Source shader_filter_blur_bgra_frag_src =
434{
435 filter_blur_bgra_frag_glsl,
436 NULL, 0
437};
438const char filter_blur_bgra_nomul_frag_glsl[] =
439#include "shader/filter_blur_bgra_nomul.h"
440 ;
441Evas_GL_Program_Source shader_filter_blur_bgra_nomul_frag_src =
442{
443 filter_blur_bgra_nomul_frag_glsl,
444 NULL, 0
445};
446
447#endif
448
449
450 289
451///////////////////////////////////////////// 290/////////////////////////////////////////////
452static void 291static void
@@ -802,23 +641,6 @@ static const struct {
802 SHADER_SOURCE_LINE(NV12_NOMUL, nv12_nomul), 641 SHADER_SOURCE_LINE(NV12_NOMUL, nv12_nomul),
803 SHADER_SOURCE_LINE(TEX, tex), 642 SHADER_SOURCE_LINE(TEX, tex),
804 SHADER_SOURCE_LINE(TEX_NOMUL, tex_nomul), 643 SHADER_SOURCE_LINE(TEX_NOMUL, tex_nomul),
805 /* Most of the filters use the image fragment shader */
806 SHADER_SOURCE_FILTER_LINE(FILTER_INVERT, filter_invert),
807 SHADER_SOURCE_FILTER_LINE(FILTER_INVERT_NOMUL, filter_invert_nomul),
808 SHADER_SOURCE_FILTER_LINE(FILTER_INVERT_BGRA, filter_invert_bgra),
809 SHADER_SOURCE_FILTER_LINE(FILTER_INVERT_BGRA_NOMUL, filter_invert_bgra_nomul),
810 SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE, filter_greyscale),
811 SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE_NOMUL, filter_greyscale_nomul),
812 SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE_BGRA, filter_greyscale_bgra),
813 SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE_BGRA_NOMUL, filter_greyscale_bgra_nomul),
814 SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA, filter_sepia),
815 SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA_NOMUL, filter_sepia_nomul),
816 SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA_BGRA, filter_sepia_bgra),
817 SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA_BGRA_NOMUL, filter_sepia_bgra_nomul)/* , */
818 /* SHADER_SOURCE_LINE(FILTER_BLUR, filter_blur), */
819 /* SHADER_SOURCE_LINE(FILTER_BLUR_NOMUL, filter_blur_nomul), */
820 /* SHADER_SOURCE_LINE(FILTER_BLUR_BGRA, filter_blur_bgra), */
821 /* SHADER_SOURCE_LINE(FILTER_BLUR_BGRA_NOMUL, filter_blur_bgra_nomul) */
822}; 644};
823 645
824static int 646static int
diff --git a/src/modules/evas/engines/gl_common/shader/filter_blur.h b/src/modules/evas/engines/gl_common/shader/filter_blur.h
deleted file mode 100644
index 7c3a3697ce..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_blur.h
+++ /dev/null
@@ -1,24 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"uniform sampler1D gaussian;\n"
10"varying vec4 col;\n"
11"varying vec2 tex_c;\n"
12"varying weight;\n"
13"uniform radius;\n"
14"void main()\n"
15"{\n"
16" int i;\n"
17" vec4 fc = vec4(0,0,0,0);\n"
18" \n"
19" for (i = 0 ; i < radius ; i ++){\n"
20" fc += texture2D(tex, tex_c.xy).rgba *\n"
21" texture1D(gaussian,i/radius).aaaa;\n"
22" }\n"
23" gl_FragColor = fc / 4 * col;\n"
24"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_blur.shd b/src/modules/evas/engines/gl_common/shader/filter_blur.shd
deleted file mode 100644
index 5f13a4740a..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_blur.shd
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9uniform sampler1D gaussian;
10varying vec4 col;
11varying vec2 tex_c;
12varying weight;
13uniform radius;
14void main()
15{
16 int i;
17 vec4 fc = vec4(0,0,0,0);
18
19 for (i = 0 ; i < radius ; i ++){
20 fc += texture2D(tex, tex_c.xy).rgba *
21 texture1D(gaussian,i/radius).aaaa;
22 }
23 gl_FragColor = fc / 4 * col;
24}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_blur_bgra.h b/src/modules/evas/engines/gl_common/shader/filter_blur_bgra.h
deleted file mode 100644
index 0862e4f658..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_blur_bgra.h
+++ /dev/null
@@ -1,24 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"uniform sampler1D gaussian;\n"
10"varying vec4 col;\n"
11"varying vec2 tex_c;\n"
12"varying weight;\n"
13"uniform radius;\n"
14"void main()\n"
15"{\n"
16" int i;\n"
17" vec4 fc = vec4(0,0,0,0);\n"
18" \n"
19" for (i = 0 ; i < radius ; i ++){\n"
20" fc += texture2D(tex, tex_c.xy).rgba *\n"
21" texture1D(gaussian,i/radius).aaaa;\n"
22" }\n"
23" gl_FragColor = fc / 4;\n"
24"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_blur_bgra.shd b/src/modules/evas/engines/gl_common/shader/filter_blur_bgra.shd
deleted file mode 100644
index a9134df1d4..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_blur_bgra.shd
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9uniform sampler1D gaussian;
10varying vec4 col;
11varying vec2 tex_c;
12varying weight;
13uniform radius;
14void main()
15{
16 int i;
17 vec4 fc = vec4(0,0,0,0);
18
19 for (i = 0 ; i < radius ; i ++){
20 fc += texture2D(tex, tex_c.xy).rgba *
21 texture1D(gaussian,i/radius).aaaa;
22 }
23 gl_FragColor = fc / 4;
24}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_blur_bgra_nomul.h b/src/modules/evas/engines/gl_common/shader/filter_blur_bgra_nomul.h
deleted file mode 100644
index 0862e4f658..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_blur_bgra_nomul.h
+++ /dev/null
@@ -1,24 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"uniform sampler1D gaussian;\n"
10"varying vec4 col;\n"
11"varying vec2 tex_c;\n"
12"varying weight;\n"
13"uniform radius;\n"
14"void main()\n"
15"{\n"
16" int i;\n"
17" vec4 fc = vec4(0,0,0,0);\n"
18" \n"
19" for (i = 0 ; i < radius ; i ++){\n"
20" fc += texture2D(tex, tex_c.xy).rgba *\n"
21" texture1D(gaussian,i/radius).aaaa;\n"
22" }\n"
23" gl_FragColor = fc / 4;\n"
24"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_blur_bgra_nomul.shd b/src/modules/evas/engines/gl_common/shader/filter_blur_bgra_nomul.shd
deleted file mode 100644
index a9134df1d4..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_blur_bgra_nomul.shd
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9uniform sampler1D gaussian;
10varying vec4 col;
11varying vec2 tex_c;
12varying weight;
13uniform radius;
14void main()
15{
16 int i;
17 vec4 fc = vec4(0,0,0,0);
18
19 for (i = 0 ; i < radius ; i ++){
20 fc += texture2D(tex, tex_c.xy).rgba *
21 texture1D(gaussian,i/radius).aaaa;
22 }
23 gl_FragColor = fc / 4;
24}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_blur_nomul.h b/src/modules/evas/engines/gl_common/shader/filter_blur_nomul.h
deleted file mode 100644
index 0862e4f658..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_blur_nomul.h
+++ /dev/null
@@ -1,24 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"uniform sampler1D gaussian;\n"
10"varying vec4 col;\n"
11"varying vec2 tex_c;\n"
12"varying weight;\n"
13"uniform radius;\n"
14"void main()\n"
15"{\n"
16" int i;\n"
17" vec4 fc = vec4(0,0,0,0);\n"
18" \n"
19" for (i = 0 ; i < radius ; i ++){\n"
20" fc += texture2D(tex, tex_c.xy).rgba *\n"
21" texture1D(gaussian,i/radius).aaaa;\n"
22" }\n"
23" gl_FragColor = fc / 4;\n"
24"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_blur_nomul.shd b/src/modules/evas/engines/gl_common/shader/filter_blur_nomul.shd
deleted file mode 100644
index a9134df1d4..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_blur_nomul.shd
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9uniform sampler1D gaussian;
10varying vec4 col;
11varying vec2 tex_c;
12varying weight;
13uniform radius;
14void main()
15{
16 int i;
17 vec4 fc = vec4(0,0,0,0);
18
19 for (i = 0 ; i < radius ; i ++){
20 fc += texture2D(tex, tex_c.xy).rgba *
21 texture1D(gaussian,i/radius).aaaa;
22 }
23 gl_FragColor = fc / 4;
24}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_blur_vert.h b/src/modules/evas/engines/gl_common/shader/filter_blur_vert.h
deleted file mode 100644
index d38f4127f6..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_blur_vert.h
+++ /dev/null
@@ -1,29 +0,0 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"attribute vec2 tex_coord;\n"
7"attribute float r;\n"
8"uniform mat4 mvp;\n"
9"uniform sampler1D tex_blur;\n"
10"varying float weight;\n"
11"varying vec4 col;\n"
12"varying vec2 tex_c;\n"
13"\n"
14"void main(){\n"
15" /* FIXME: This index should be tweaked so for \n"
16" radius 1, I want 3 points at 1/4, 2/4, 3/4 */\n"
17" /*\n"
18" for (float i = 0 ; i <= radius * 2 ; i ++){\n"
19" float pos = i;\n"
20" float r = float(radius);\n"
21" weight += sampler1D(tex_blur, 1.0 / (r * 2.0 * pos));\n"
22" }*/\n"
23" for (float i = 0.0 ; i < r * 2.0 ; i += 1.0){\n"
24" weight += sampler1D(tex_blur, 1.0 / (r * 2.0 * i));\n"
25" }\n"
26" gl_Position = mvp * vertex;\n"
27" col = color;\n"
28" tex_c = tex_coord;\n"
29"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_blur_vert.shd b/src/modules/evas/engines/gl_common/shader/filter_blur_vert.shd
deleted file mode 100644
index 56ddc404fc..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_blur_vert.shd
+++ /dev/null
@@ -1,29 +0,0 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6attribute vec2 tex_coord;
7attribute float r;
8uniform mat4 mvp;
9uniform sampler1D tex_blur;
10varying float weight;
11varying vec4 col;
12varying vec2 tex_c;
13
14void main(){
15 /* FIXME: This index should be tweaked so for
16 radius 1, I want 3 points at 1/4, 2/4, 3/4 */
17 /*
18 for (float i = 0 ; i <= radius * 2 ; i ++){
19 float pos = i;
20 float r = float(radius);
21 weight += sampler1D(tex_blur, 1.0 / (r * 2.0 * pos));
22 }*/
23 for (float i = 0.0 ; i < r * 2.0 ; i += 1.0){
24 weight += sampler1D(tex_blur, 1.0 / (r * 2.0 * i));
25 }
26 gl_Position = mvp * vertex;
27 col = color;
28 tex_c = tex_coord;
29}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_greyscale.h b/src/modules/evas/engines/gl_common/shader/filter_greyscale.h
deleted file mode 100644
index 850538a52a..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_greyscale.h
+++ /dev/null
@@ -1,15 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" float inten = dot(texture2D(tex,tex_c.xy).agb,vec3(.3, .59, .11));\n"
14" gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).r) * col;\n"
15"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_greyscale.shd b/src/modules/evas/engines/gl_common/shader/filter_greyscale.shd
deleted file mode 100644
index 78ecf0883e..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_greyscale.shd
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 float inten = dot(texture2D(tex,tex_c.xy).agb,vec3(.3, .59, .11));
14 gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).r) * col;
15}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra.h b/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra.h
deleted file mode 100644
index 3caef3506b..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra.h
+++ /dev/null
@@ -1,15 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" float inten = dot(texture2D(tex,tex_c.xy).rgb,vec3(.3, .59, .11));\n"
14" gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).a) * col;\n"
15"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra.shd b/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra.shd
deleted file mode 100644
index 5dca381012..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra.shd
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 float inten = dot(texture2D(tex,tex_c.xy).rgb,vec3(.3, .59, .11));
14 gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).a) * col;
15}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra_nomul.h b/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra_nomul.h
deleted file mode 100644
index 4cb36a873b..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra_nomul.h
+++ /dev/null
@@ -1,14 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" float inten = dot(texture2D(tex,tex_c.xy).rgb,vec3(.3, .59, .11));\n"
13" gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).a);\n"
14"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra_nomul.shd b/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra_nomul.shd
deleted file mode 100644
index a077eea939..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_greyscale_bgra_nomul.shd
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec2 tex_c;
10void main()
11{
12 float inten = dot(texture2D(tex,tex_c.xy).rgb,vec3(.3, .59, .11));
13 gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).a);
14}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_greyscale_nomul.h b/src/modules/evas/engines/gl_common/shader/filter_greyscale_nomul.h
deleted file mode 100644
index f501a02bcf..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_greyscale_nomul.h
+++ /dev/null
@@ -1,14 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" float inten = dot(texture2D(tex,tex_c.xy).abg,vec3(.3, .59, .11));\n"
13" gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).r);\n"
14"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_greyscale_nomul.shd b/src/modules/evas/engines/gl_common/shader/filter_greyscale_nomul.shd
deleted file mode 100644
index b5b8ec6b93..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_greyscale_nomul.shd
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec2 tex_c;
10void main()
11{
12 float inten = dot(texture2D(tex,tex_c.xy).abg,vec3(.3, .59, .11));
13 gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).r);
14}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_invert.h b/src/modules/evas/engines/gl_common/shader/filter_invert.h
deleted file mode 100644
index 46373e0da8..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_invert.h
+++ /dev/null
@@ -1,14 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = (vec4(0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy).bgra)*col;\n"
14"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_invert.shd b/src/modules/evas/engines/gl_common/shader/filter_invert.shd
deleted file mode 100644
index a75b058022..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_invert.shd
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 gl_FragColor = (vec4(0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy).bgra)*col;
14}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_invert_bgra.h b/src/modules/evas/engines/gl_common/shader/filter_invert_bgra.h
deleted file mode 100644
index 3e3011d4ea..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_invert_bgra.h
+++ /dev/null
@@ -1,14 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = (vec4(1.0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy))*col;\n"
14"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_invert_bgra.shd b/src/modules/evas/engines/gl_common/shader/filter_invert_bgra.shd
deleted file mode 100644
index 8d7df2d3d9..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_invert_bgra.shd
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 gl_FragColor = (vec4(1.0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy))*col;
14}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_invert_bgra_nomul.h b/src/modules/evas/engines/gl_common/shader/filter_invert_bgra_nomul.h
deleted file mode 100644
index b9f1e25753..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_invert_bgra_nomul.h
+++ /dev/null
@@ -1,15 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" vec3 inv = vec3(1.0, 1.0, 1.0) - texture2D(tex,tex_c.xy).rgb;\n"
14" gl_FragColor = vec4(inv.r, inv.g, inv.b, 1.0);\n"
15"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_invert_bgra_nomul.shd b/src/modules/evas/engines/gl_common/shader/filter_invert_bgra_nomul.shd
deleted file mode 100644
index 682acb2d01..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_invert_bgra_nomul.shd
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 vec3 inv = vec3(1.0, 1.0, 1.0) - texture2D(tex,tex_c.xy).rgb;
14 gl_FragColor = vec4(inv.r, inv.g, inv.b, 1.0);
15}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_invert_nomul.h b/src/modules/evas/engines/gl_common/shader/filter_invert_nomul.h
deleted file mode 100644
index 46373e0da8..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_invert_nomul.h
+++ /dev/null
@@ -1,14 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = (vec4(0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy).bgra)*col;\n"
14"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_invert_nomul.shd b/src/modules/evas/engines/gl_common/shader/filter_invert_nomul.shd
deleted file mode 100644
index a75b058022..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_invert_nomul.shd
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 gl_FragColor = (vec4(0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy).bgra)*col;
14}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_sepia.h b/src/modules/evas/engines/gl_common/shader/filter_sepia.h
deleted file mode 100644
index 50fbf12c6d..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_sepia.h
+++ /dev/null
@@ -1,20 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" vec3 inp = texture2D(tex,tex_c.xy).abg;\n"
14" vec4 sep;\n"
15" sep.r = dot(inp, vec3(.393, .769, .189));\n"
16" sep.g = dot(inp, vec3(.349, .686, .168));\n"
17" sep.b = dot(inp, vec3(.272, .534, .131));\n"
18" sep.a = texture2D(tex,tex_c.xy).r;\n"
19" gl_FragColor = sep * col;\n"
20"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_sepia.shd b/src/modules/evas/engines/gl_common/shader/filter_sepia.shd
deleted file mode 100644
index 027ecfb393..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_sepia.shd
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 vec3 inp = texture2D(tex,tex_c.xy).abg;
14 vec4 sep;
15 sep.r = dot(inp, vec3(.393, .769, .189));
16 sep.g = dot(inp, vec3(.349, .686, .168));
17 sep.b = dot(inp, vec3(.272, .534, .131));
18 sep.a = texture2D(tex,tex_c.xy).r;
19 gl_FragColor = sep * col;
20}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra.h b/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra.h
deleted file mode 100644
index 41e4283d1b..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra.h
+++ /dev/null
@@ -1,20 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" vec3 inp = texture2D(tex,tex_c.xy).rgb;\n"
14" vec4 sep;\n"
15" sep.r = dot(inp, vec3(.393, .769, .189));\n"
16" sep.g = dot(inp, vec3(.349, .686, .168));\n"
17" sep.b = dot(inp, vec3(.272, .534, .131));\n"
18" sep.a = texture2D(tex,tex_c.xy).a;\n"
19" gl_FragColor = sep * col;\n"
20"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra.shd b/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra.shd
deleted file mode 100644
index caed3780a1..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra.shd
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 vec3 inp = texture2D(tex,tex_c.xy).rgb;
14 vec4 sep;
15 sep.r = dot(inp, vec3(.393, .769, .189));
16 sep.g = dot(inp, vec3(.349, .686, .168));
17 sep.b = dot(inp, vec3(.272, .534, .131));
18 sep.a = texture2D(tex,tex_c.xy).a;
19 gl_FragColor = sep * col;
20}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra_nomul.h b/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra_nomul.h
deleted file mode 100644
index 0c4fe1b2ef..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra_nomul.h
+++ /dev/null
@@ -1,18 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" vec3 inp = texture2D(tex,tex_c.xy).rgb;\n"
14" gl_FragColor.r = dot(inp, vec3(.393, .769, .189));\n"
15" gl_FragColor.g = dot(inp, vec3(.349, .686, .168));\n"
16" gl_FragColor.b = dot(inp, vec3(.272, .534, .131));\n"
17" gl_FragColor.a = texture2D(tex,tex_c.xy).a;\n"
18"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra_nomul.shd b/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra_nomul.shd
deleted file mode 100644
index 9c6c1d4bf8..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_sepia_bgra_nomul.shd
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 vec3 inp = texture2D(tex,tex_c.xy).rgb;
14 gl_FragColor.r = dot(inp, vec3(.393, .769, .189));
15 gl_FragColor.g = dot(inp, vec3(.349, .686, .168));
16 gl_FragColor.b = dot(inp, vec3(.272, .534, .131));
17 gl_FragColor.a = texture2D(tex,tex_c.xy).a;
18}
diff --git a/src/modules/evas/engines/gl_common/shader/filter_sepia_nomul.h b/src/modules/evas/engines/gl_common/shader/filter_sepia_nomul.h
deleted file mode 100644
index 23af9ecb9a..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_sepia_nomul.h
+++ /dev/null
@@ -1,18 +0,0 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" vec3 inp = texture2D(tex,tex_c.xy).abg;\n"
14" gl_FragColor.r = dot(inp, vec3(.393, .769, .189));\n"
15" gl_FragColor.g = dot(inp, vec3(.349, .686, .168));\n"
16" gl_FragColor.b = dot(inp, vec3(.272, .534, .131));\n"
17" gl_FragColor.a = texture2D(tex,tex_c.xy).r;\n"
18"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/filter_sepia_nomul.shd b/src/modules/evas/engines/gl_common/shader/filter_sepia_nomul.shd
deleted file mode 100644
index f9871bd8f1..0000000000
--- a/src/modules/evas/engines/gl_common/shader/filter_sepia_nomul.shd
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 vec3 inp = texture2D(tex,tex_c.xy).abg;
14 gl_FragColor.r = dot(inp, vec3(.393, .769, .189));
15 gl_FragColor.g = dot(inp, vec3(.349, .686, .168));
16 gl_FragColor.b = dot(inp, vec3(.272, .534, .131));
17 gl_FragColor.a = texture2D(tex,tex_c.xy).r;
18}
diff --git a/src/modules/evas/engines/gl_sdl/evas_engine.c b/src/modules/evas/engines/gl_sdl/evas_engine.c
index f49fcb8d8d..a2ed13fa16 100644
--- a/src/modules/evas/engines/gl_sdl/evas_engine.c
+++ b/src/modules/evas/engines/gl_sdl/evas_engine.c
@@ -1010,12 +1010,6 @@ module_open(Evas_Module *em)
1010 ORD(image_colorspace_get); 1010 ORD(image_colorspace_get);
1011 ORD(image_native_set); 1011 ORD(image_native_set);
1012 ORD(image_native_get); 1012 ORD(image_native_get);
1013#if 0 // filtering disabled
1014// ORD(image_draw_filtered);
1015// ORD(image_filtered_get);
1016// ORD(image_filtered_save);
1017// ORD(image_filtered_free);
1018#endif
1019 ORD(font_draw); 1013 ORD(font_draw);
1020 1014
1021 ORD(image_scale_hint_set); 1015 ORD(image_scale_hint_set);
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index fbf897fd25..653a750b1b 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -2097,40 +2097,6 @@ eng_image_native_get(void *data EINA_UNUSED, void *image)
2097 return &(n->ns); 2097 return &(n->ns);
2098} 2098}
2099 2099
2100#if 0 // filtering disabled
2101static void
2102eng_image_draw_filtered(void *data, void *context, void *surface,
2103 void *image, Evas_Filter_Info *filter)
2104{
2105 Render_Engine *re = data;
2106
2107 if (!image) return;
2108 eng_window_use(re->win);
2109 evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
2110 re->win->gl_context->dc = context;
2111
2112 evas_gl_common_filter_draw(re->win->gl_context, image, filter);
2113}
2114
2115static Filtered_Image *
2116eng_image_filtered_get(void *im, uint8_t *key, size_t keylen)
2117{
2118 return evas_gl_common_image_filtered_get(im, key, keylen);
2119}
2120
2121static Filtered_Image *
2122eng_image_filtered_save(void *im, void *fim, uint8_t *key, size_t keylen)
2123{
2124 return evas_gl_common_image_filtered_save(im, fim, key, keylen);
2125}
2126
2127static void
2128eng_image_filtered_free(void *im, Filtered_Image *fim)
2129{
2130 evas_gl_common_image_filtered_free(im, fim);
2131}
2132#endif
2133
2134 2100
2135// 2101//
2136// 2102//
@@ -2978,12 +2944,6 @@ module_open(Evas_Module *em)
2978 ORD(image_mask_create); 2944 ORD(image_mask_create);
2979 ORD(image_native_set); 2945 ORD(image_native_set);
2980 ORD(image_native_get); 2946 ORD(image_native_get);
2981#if 0 // filtering disabled
2982 ORD(image_draw_filtered);
2983 ORD(image_filtered_get);
2984 ORD(image_filtered_save);
2985 ORD(image_filtered_free);
2986#endif
2987 2947
2988 ORD(font_draw); 2948 ORD(font_draw);
2989 2949
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index cf213d75e3..c91f8b7a96 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -1366,88 +1366,6 @@ eng_canvas_alpha_get(void *data EINA_UNUSED, void *info EINA_UNUSED)
1366} 1366}
1367 1367
1368 1368
1369/* Filter API */
1370#if 0 // filtering disabled
1371static void
1372eng_image_draw_filtered(void *data EINA_UNUSED, void *context EINA_UNUSED,
1373 void *surface, void *image, Evas_Filter_Info *filter)
1374{
1375 Evas_Software_Filter_Fn fn;
1376 RGBA_Image *im = image;
1377
1378 fn = evas_filter_software_get(filter);
1379 if (!fn) return;
1380 if (im->cache_entry.cache) evas_cache_image_load_data(&im->cache_entry);
1381 fn(filter, image, surface);
1382 return;
1383}
1384
1385static Filtered_Image *
1386eng_image_filtered_get(void *image, uint8_t *key, size_t keylen)
1387{
1388 RGBA_Image *im = image;
1389 Filtered_Image *fi;
1390 Eina_List *l;
1391
1392 for (l = im->filtered ; l ; l = l->next)
1393 {
1394 fi = l->data;
1395 if (fi->keylen != keylen) continue;
1396 if (memcmp(key, fi->key, keylen) != 0) continue;
1397 fi->ref ++;
1398 return fi;
1399 }
1400
1401 return NULL;
1402}
1403
1404static Filtered_Image *
1405eng_image_filtered_save(void *image, void *fimage, uint8_t *key, size_t keylen)
1406{
1407 RGBA_Image *im = image;
1408 Filtered_Image *fi;
1409 Eina_List *l;
1410
1411 for (l = im->filtered ; l ; l = l->next)
1412 {
1413 fi = l->data;
1414 if (fi->keylen != keylen) continue;
1415 if (memcmp(key, fi->key, keylen) == 0) continue;
1416 evas_cache_image_drop((void *)fi->image);
1417 fi->image = fimage;
1418 return fi;
1419 }
1420
1421 fi = calloc(1,sizeof(Filtered_Image));
1422 if (!fi) return NULL;
1423
1424 fi->keylen = keylen;
1425 fi->key = malloc(keylen);
1426 memcpy(fi->key, key, keylen);
1427 fi->image = fimage;
1428 fi->ref = 1;
1429
1430 im->filtered = eina_list_prepend(im->filtered, fi);
1431
1432 return fi;
1433}
1434
1435static void
1436eng_image_filtered_free(void *image, Filtered_Image *fi)
1437{
1438 RGBA_Image *im = image;
1439
1440 fi->ref --;
1441 if (fi->ref) return;
1442
1443 free(fi->key);
1444 evas_cache_image_drop(&fi->image->cache_entry);
1445 fi->image = NULL;
1446
1447 im->filtered = eina_list_remove(im->filtered, fi);
1448}
1449#endif
1450
1451static int 1369static int
1452eng_image_load_error_get(void *data EINA_UNUSED, void *image) 1370eng_image_load_error_get(void *data EINA_UNUSED, void *image)
1453{ 1371{
@@ -1885,12 +1803,6 @@ static Evas_Func func =
1885 eng_font_pen_coords_get, 1803 eng_font_pen_coords_get,
1886 eng_font_text_props_info_create, 1804 eng_font_text_props_info_create,
1887 eng_font_right_inset_get, 1805 eng_font_right_inset_get,
1888#if 0 // filtering disabled
1889 eng_image_draw_filtered,
1890 eng_image_filtered_get,
1891 eng_image_filtered_save,
1892 eng_image_filtered_free,
1893#endif
1894 NULL, // need software mesa for gl rendering <- gl_surface_create 1806 NULL, // need software mesa for gl rendering <- gl_surface_create
1895 NULL, // need software mesa for gl rendering <- gl_surface_destroy 1807 NULL, // need software mesa for gl rendering <- gl_surface_destroy
1896 NULL, // need software mesa for gl rendering <- gl_context_create 1808 NULL, // need software mesa for gl rendering <- gl_context_create
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index c5dba720c3..a95166156d 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -1563,40 +1563,6 @@ eng_image_native_get(void *data EINA_UNUSED, void *image)
1563 return &(n->ns); 1563 return &(n->ns);
1564} 1564}
1565 1565
1566#if 0 // filtering disabled
1567static void
1568eng_image_draw_filtered(void *data, void *context, void *surface,
1569 void *image, Evas_Filter_Info *filter)
1570{
1571 Render_Engine *re = data;
1572
1573 if (!image) return;
1574 eng_window_use(re->win);
1575 evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
1576 re->win->gl_context->dc = context;
1577
1578 evas_gl_common_filter_draw(re->win->gl_context, image, filter);
1579}
1580
1581static Filtered_Image *
1582eng_image_filtered_get(void *im, uint8_t *key, size_t keylen)
1583{
1584 return evas_gl_common_image_filtered_get(im, key, keylen);
1585}
1586
1587static Filtered_Image *
1588eng_image_filtered_save(void *im, void *fim, uint8_t *key, size_t keylen)
1589{
1590 return evas_gl_common_image_filtered_save(im, fim, key, keylen);
1591}
1592
1593static void
1594eng_image_filtered_free(void *im, Filtered_Image *fim)
1595{
1596 evas_gl_common_image_filtered_free(im, fim);
1597}
1598#endif
1599
1600static void * 1566static void *
1601eng_image_load(void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo) 1567eng_image_load(void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo)
1602{ 1568{
@@ -3776,12 +3742,6 @@ module_open(Evas_Module *em)
3776 ORD(image_mask_create); 3742 ORD(image_mask_create);
3777 ORD(image_native_set); 3743 ORD(image_native_set);
3778 ORD(image_native_get); 3744 ORD(image_native_get);
3779#if 0 // filtering disabled
3780 ORD(image_draw_filtered);
3781 ORD(image_filtered_get);
3782 ORD(image_filtered_save);
3783 ORD(image_filtered_free);
3784#endif
3785 3745
3786 ORD(font_draw); 3746 ORD(font_draw);
3787 3747