disable evas filter code. buggy. doesn't work right.

SVN revision: 59898
This commit is contained in:
Carsten Haitzler 2011-06-02 10:40:43 +00:00
parent 2ffa0f4075
commit 5d2bd283c3
12 changed files with 225 additions and 188 deletions

View File

@ -8093,179 +8093,6 @@ EAPI Eina_Accessor *evas_object_grid_accessor_new (const
* @since 1.1.0
*/
EAPI Eina_List *evas_object_grid_children_get (const Evas_Object *o) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
typedef enum
{
/** Apply any filter effects to this object (Default) */
EVAS_FILTER_MODE_OBJECT,
/** Filter all objects beneath this object on the canvas */
EVAS_FILTER_MODE_BELOW,
} Evas_Filter_Mode;
typedef enum
{
/** No filter: Default */
EVAS_FILTER_NONE,
/** A blur filter. Params are quality (float), and radius (int). */
EVAS_FILTER_BLUR,
/** Negates the colors of an image. Also called solarize */
EVAS_FILTER_INVERT,
EVAS_FILTER_SOLARIZE = EVAS_FILTER_INVERT,
/** Makes a sepia version of the image. */
EVAS_FILTER_SEPIA,
/** Makes a greyscale version of the image. Params are 'red',
* 'green', 'blue' (all floats) which must add to 1. The defaults are
* 0.3, 0.59 and 0.11 which approximates human vision. Setting 'all'
* sets rgb to the same value. */
EVAS_FILTER_GREYSCALE,
EVAS_FILTER_GRAYSCALE = EVAS_FILTER_GREYSCALE,
/** Brighten (or darken) image. Param 'adjust' float (-1.0 to 1.0)
* amount to adjust. */
EVAS_FILTER_BRIGHTNESS,
/** Enhance contrast on image. Param 'adjust' float (-1.0 to 1.0)
* amount to adjust. */
EVAS_FILTER_CONTRAST,
EVAS_FILTER_LAST = EVAS_FILTER_CONTRAST
} Evas_Filter;
/**
* Set the filter mode for an object.
*
* There are two valid filtering modes currently:
* - EVAS_FILTER_MODE_OBJECT: which applies the filter to the object itself
* - EVAS_FILTER_MODE_BELOW: which makes the object invisible and filters
* what is below the object.
*
* The default filter mode is EVAS_FILTER_MODE_OBJECT.
*
* @param o Object to set filter mode on.
* @param mode Mode to set.
* @return EINA_TRUE on success, EINA_FALSE otherwise.
*/
EAPI Eina_Bool evas_object_filter_mode_set (Evas_Object *o, Evas_Filter_Mode mode);
/**
* Get the current filtering mode for an object.
*
* By default all objects are in object filtering mode, even if no filter is
* set.
*
* @param o Object to get filter mode of.
* @return Filter mode (default EVAS_FILTER_MODE_OBJECT)
*/
EAPI Evas_Filter_Mode evas_object_filter_mode_get (Evas_Object *o);
/**
* Set the current filter type.
*
* This sets the filter type, whether a blur, color filter or some other type
* of filter. This is normally the only filter call necessary, although some
* filters require additional parameters.
*
* If the object has a filter already, and existing parameters will be
* cleared.
*
* Setting the blur to EVAS_FILTER_NONE removes any filter.
*
* @param o Object to set the filter on.
* @param filter Filter to set.
* @return EINA_TRUE On success
*/
EAPI Eina_Bool evas_object_filter_set (Evas_Object *o, Evas_Filter filter);
/**
* Get the current filter.
*
* @param o Object to get filter of.
* @return The filter if set, or EVAS_FILTER_NONE.
*/
EAPI Evas_Filter evas_object_filter_get (Evas_Object *o);
/**
* Set an integer parameter of a filter.
*
* This sets an integer parameter of a filter, if such parameter is known to
* the filter. Note that some parameters may actually set multiple fields.
* The individual filters define the specific parameters available.
*
* It should be noted that filter parameters are lost after the filter type
* changes, so set the filter type, then the parameters.
*
* @param o Object to set parameter on.
* @param param Name of parameter to set.
* @param val Value to set.
* @return EINA_TRUE if at least one parameter was set, EINA_FALSE
* otherwise.
*/
EAPI Eina_Bool evas_object_filter_param_int_set (Evas_Object *o, const char *param, int val);
/**
* Get an integer value parameter from a filter.
*
* Gets the first matching parameter for a filter. Note there is no way to
* later fields if they do not have their own accessor name.
*
* Also note that there is no way to tell the difference between a -1 as a
* value, and the error code. Ask your filter writer to use a different
* range.
*
* @param o The object.
* @Param param Name of the parameter to get.
* @return The value, or -1 on error.
*/
EAPI int evas_object_filter_param_int_get (Evas_Object *o, const char *param);
/**
* Set a string parameter on a filter
*
* Currently unimplemented as no filters use this yet
*/
EAPI Eina_Bool evas_object_filter_param_str_set (Evas_Object *o, const char *param, const char *val);
/**
* Get a string parameter from a filter
*
* Currently unimplemented as no filters use this yet
*/
EAPI const char *evas_object_filter_param_str_get (Evas_Object *o, const char *param);
/**
* Set an object parameter on a filter
*
* Currently unimplemented as no filters use this yet
*/
EAPI Eina_Bool evas_object_filter_param_obj_set (Evas_Object *o, const char *param, Evas_Object *val);
/**
* get an object parameter from a filter
*
* Currently unimplemented as no filters use this yet
*/
EAPI Evas_Object *evas_object_filter_param_obj_get (Evas_Object *o, const char *param);
/**
* Set a float parameter of a filter.
*
* This is the same as evas_object_filter_param_int_set(), but for floating
* point values.
*
* @param o Object to set value on.
* @param param Name of the parameter to set.
* @param EINA_TRUE if at least one parameter was set, EINA_FALSE otherwise.
*/
EAPI Eina_Bool evas_object_filter_param_float_set(Evas_Object *o, const char *param, double val);
/**
* Get a float parameter of a filter.
*
* This is the same as evas_object_filter_param_int_get(), but for floating
* point values.
*
* @param o Object to set value on.
* @param param Name of the parameter to set.
* @return The value, or -1 on error.
*/
EAPI double evas_object_filter_param_float_get(Evas_Object *o, const char *param);
/**
* @defgroup Evas_Cserve Shared Image Cache Server

View File

@ -1,6 +1,181 @@
/*
* Filter implementation for evas
*/
#if 0 // filtering disabled
typedef enum
{
/** Apply any filter effects to this object (Default) */
EVAS_FILTER_MODE_OBJECT,
/** Filter all objects beneath this object on the canvas */
EVAS_FILTER_MODE_BELOW,
} Evas_Filter_Mode;
typedef enum
{
/** No filter: Default */
EVAS_FILTER_NONE,
/** A blur filter. Params are quality (float), and radius (int). */
EVAS_FILTER_BLUR,
/** Negates the colors of an image. Also called solarize */
EVAS_FILTER_INVERT,
EVAS_FILTER_SOLARIZE = EVAS_FILTER_INVERT,
/** Makes a sepia version of the image. */
EVAS_FILTER_SEPIA,
/** Makes a greyscale version of the image. Params are 'red',
* 'green', 'blue' (all floats) which must add to 1. The defaults are
* 0.3, 0.59 and 0.11 which approximates human vision. Setting 'all'
* sets rgb to the same value. */
EVAS_FILTER_GREYSCALE,
EVAS_FILTER_GRAYSCALE = EVAS_FILTER_GREYSCALE,
/** Brighten (or darken) image. Param 'adjust' float (-1.0 to 1.0)
* amount to adjust. */
EVAS_FILTER_BRIGHTNESS,
/** Enhance contrast on image. Param 'adjust' float (-1.0 to 1.0)
* amount to adjust. */
EVAS_FILTER_CONTRAST,
EVAS_FILTER_LAST = EVAS_FILTER_CONTRAST
} Evas_Filter;
/**
* Set the filter mode for an object.
*
* There are two valid filtering modes currently:
* - EVAS_FILTER_MODE_OBJECT: which applies the filter to the object itself
* - EVAS_FILTER_MODE_BELOW: which makes the object invisible and filters
* what is below the object.
*
* The default filter mode is EVAS_FILTER_MODE_OBJECT.
*
* @param o Object to set filter mode on.
* @param mode Mode to set.
* @return EINA_TRUE on success, EINA_FALSE otherwise.
*/
EAPI Eina_Bool evas_object_filter_mode_set (Evas_Object *o, Evas_Filter_Mode mode);
/**
* Get the current filtering mode for an object.
*
* By default all objects are in object filtering mode, even if no filter is
* set.
*
* @param o Object to get filter mode of.
* @return Filter mode (default EVAS_FILTER_MODE_OBJECT)
*/
EAPI Evas_Filter_Mode evas_object_filter_mode_get (Evas_Object *o);
/**
* Set the current filter type.
*
* This sets the filter type, whether a blur, color filter or some other type
* of filter. This is normally the only filter call necessary, although some
* filters require additional parameters.
*
* If the object has a filter already, and existing parameters will be
* cleared.
*
* Setting the blur to EVAS_FILTER_NONE removes any filter.
*
* @param o Object to set the filter on.
* @param filter Filter to set.
* @return EINA_TRUE On success
*/
EAPI Eina_Bool evas_object_filter_set (Evas_Object *o, Evas_Filter filter);
/**
* Get the current filter.
*
* @param o Object to get filter of.
* @return The filter if set, or EVAS_FILTER_NONE.
*/
EAPI Evas_Filter evas_object_filter_get (Evas_Object *o);
/**
* Set an integer parameter of a filter.
*
* This sets an integer parameter of a filter, if such parameter is known to
* the filter. Note that some parameters may actually set multiple fields.
* The individual filters define the specific parameters available.
*
* It should be noted that filter parameters are lost after the filter type
* changes, so set the filter type, then the parameters.
*
* @param o Object to set parameter on.
* @param param Name of parameter to set.
* @param val Value to set.
* @return EINA_TRUE if at least one parameter was set, EINA_FALSE
* otherwise.
*/
EAPI Eina_Bool evas_object_filter_param_int_set (Evas_Object *o, const char *param, int val);
/**
* Get an integer value parameter from a filter.
*
* Gets the first matching parameter for a filter. Note there is no way to
* later fields if they do not have their own accessor name.
*
* Also note that there is no way to tell the difference between a -1 as a
* value, and the error code. Ask your filter writer to use a different
* range.
*
* @param o The object.
* @Param param Name of the parameter to get.
* @return The value, or -1 on error.
*/
EAPI int evas_object_filter_param_int_get (Evas_Object *o, const char *param);
/**
* Set a string parameter on a filter
*
* Currently unimplemented as no filters use this yet
*/
EAPI Eina_Bool evas_object_filter_param_str_set (Evas_Object *o, const char *param, const char *val);
/**
* Get a string parameter from a filter
*
* Currently unimplemented as no filters use this yet
*/
EAPI const char *evas_object_filter_param_str_get (Evas_Object *o, const char *param);
/**
* Set an object parameter on a filter
*
* Currently unimplemented as no filters use this yet
*/
EAPI Eina_Bool evas_object_filter_param_obj_set (Evas_Object *o, const char *param, Evas_Object *val);
/**
* get an object parameter from a filter
*
* Currently unimplemented as no filters use this yet
*/
EAPI Evas_Object *evas_object_filter_param_obj_get (Evas_Object *o, const char *param);
/**
* Set a float parameter of a filter.
*
* This is the same as evas_object_filter_param_int_set(), but for floating
* point values.
*
* @param o Object to set value on.
* @param param Name of the parameter to set.
* @param EINA_TRUE if at least one parameter was set, EINA_FALSE otherwise.
*/
EAPI Eina_Bool evas_object_filter_param_float_set(Evas_Object *o, const char *param, double val);
/**
* Get a float parameter of a filter.
*
* This is the same as evas_object_filter_param_int_get(), but for floating
* point values.
*
* @param o Object to set value on.
* @param param Name of the parameter to set.
* @return The value, or -1 on error.
*/
EAPI double evas_object_filter_param_float_get(Evas_Object *o, const char *param);
#include <stddef.h> // offsetof
#include "evas_common.h"
@ -1247,5 +1422,6 @@ contrast_filter(Evas_Filter_Info *info __UNUSED__, RGBA_Image *src, RGBA_Image *
return EINA_TRUE;
}
#endif
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/

View File

@ -2077,6 +2077,7 @@ _proxy_subrender(Evas *e, Evas_Object *source)
(e->engine.data.output, source->proxy.surface, 0, 0, w, h);
}
#if 0 // filtering disabled
/*
*
* Note that this is similar to proxy_subrender_recurse. It should be
@ -2226,6 +2227,7 @@ image_filter_update(Evas *e, Evas_Object *obj, void *src, int imagew, int imageh
obj->filter->key,
obj->filter->len);
}
#endif
static void
evas_object_image_unload(Evas_Object *obj, Eina_Bool dirty)
@ -2530,6 +2532,7 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su
o->proxyrendering = 0;
}
#if 0 // filtering disabled
/* Now check/update filter */
if (obj->filter && obj->filter->filter)
{
@ -2578,7 +2581,8 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su
pixels = fi->image;
}
}
#endif
if (pixels)
{
Evas_Coord idw, idh, idx, idy;
@ -3066,10 +3070,12 @@ evas_object_image_render_pre(Evas_Object *obj)
}
}
}
#if 0 // filtering disabled
if (obj->filter && obj->filter->dirty)
{
evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
}
#endif
/* it obviously didn't change - add a NO obscure - this "unupdates" this */
/* area so if there were updates for it they get wiped. don't do it if we */
/* aren't fully opaque and we are visible */

View File

@ -34,7 +34,9 @@ evas_object_free(Evas_Object *obj, int clean_layer)
{
int was_smart_child = 0;
#if 0 // filtering disabled
evas_filter_free(obj);
#endif
evas_object_map_set(obj, NULL);
evas_object_grabs_cleanup(obj);
evas_object_intercept_cleanup(obj);

View File

@ -476,7 +476,9 @@ typedef enum _Font_Rend_Flags
/*****************************************************************************/
#if 0 // filtering disabled
typedef struct _Filtered_Image Filtered_Image;
#endif
struct _RGBA_Image_Loadopts
{
@ -765,8 +767,10 @@ struct _RGBA_Image
Eina_Bool dirty: 1;
} mask;
#if 0 // filtering disabled
Eina_List *filtered;
#endif
struct {
LK(lock);
Eina_List *list;
@ -802,6 +806,7 @@ struct _RGBA_Map_Point
FPc px, py, z0, foc;
};
#if 0 // filtering disabled
struct _Filtered_Image
{
void *key;
@ -809,6 +814,7 @@ struct _Filtered_Image
RGBA_Image *image;
int ref;
};
#endif
// for fonts...
/////

View File

@ -389,6 +389,7 @@ struct _Evas_Map
Evas_Map_Point points[]; // actual points
};
#if 0 // filtering disabled
/* nash: Split into two bits */
typedef struct Evas_Filter_Info
{
@ -415,6 +416,7 @@ uint8_t *evas_filter_key_get(const Evas_Filter_Info *info, uint32_t *lenp);
// expose for use in engines
EAPI Evas_Software_Filter_Fn evas_filter_software_get(Evas_Filter_Info *info);
void evas_filter_free(Evas_Object *o);
#endif
struct _Evas_Object
{
@ -484,8 +486,10 @@ struct _Evas_Object
Eina_Bool redraw;
} proxy;
#if 0 // filtering disabled
Evas_Filter_Info *filter;
#endif
Evas_Size_Hints *size_hints;
int last_mouse_down_counter;
@ -726,11 +730,13 @@ struct _Evas_Func
Eina_Bool (*font_text_props_info_create) (void *data __UNUSED__, 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);
int (*font_right_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
#if 0 // filtering disabled
void (*image_draw_filtered) (void *data, void *context, void *surface, void *image, Evas_Filter_Info *filter);
Filtered_Image *(*image_filtered_get) (void *image, uint8_t *key, size_t len);
Filtered_Image *(*image_filtered_save) (void *image, void *filtered, uint8_t *key, size_t len);
void (*image_filtered_free) (void *image, Filtered_Image *);
#endif
/* EFL-GL Glue Layer */
void *(*gl_surface_create) (void *data, void *config, int w, int h);
int (*gl_surface_destroy) (void *data, void *surface);

View File

@ -211,16 +211,16 @@ struct _Evas_GL_Shared
Evas_GL_Program yuv, yuv_nomul;
Evas_GL_Program tex, tex_nomul;
Evas_GL_Program filter_invert, filter_invert_nomul;
Evas_GL_Program filter_invert_bgra, filter_invert_bgra_nomul;
Evas_GL_Program filter_invert, filter_invert_nomul;
Evas_GL_Program filter_invert_bgra, filter_invert_bgra_nomul;
Evas_GL_Program filter_greyscale, filter_greyscale_nomul;
Evas_GL_Program filter_greyscale_bgra, filter_greyscale_bgra_nomul;
Evas_GL_Program filter_sepia, filter_sepia_nomul;
Evas_GL_Program filter_sepia_bgra, filter_sepia_bgra_nomul;
Evas_GL_Program filter_sepia, filter_sepia_nomul;
Evas_GL_Program filter_sepia_bgra, filter_sepia_bgra_nomul;
#if 0
Evas_GL_Program filter_blur_vert;
Evas_GL_Program filter_blur, filter_blur_nomul;
Evas_GL_Program filter_blur_bgra, filter_blur_bgra_nomul;
Evas_GL_Program filter_blur, filter_blur_nomul;
Evas_GL_Program filter_blur_bgra, filter_blur_bgra_nomul;
#endif
} shader;
int references;
@ -560,11 +560,12 @@ void evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_P
void evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2);
#if 0 // filtering disabled
void evas_gl_common_filter_draw(Evas_Engine_GL_Context *context, Evas_GL_Image *im, Evas_Filter_Info *filter);
Filtered_Image *evas_gl_common_image_filtered_get(Evas_GL_Image *im, uint8_t *key, size_t keylen);
Filtered_Image *evas_gl_common_image_filtered_save(Evas_GL_Image *im, Evas_GL_Image *fimage, uint8_t *key, size_t keylen);
void evas_gl_common_image_filtered_free(Evas_GL_Image *im, Filtered_Image *);
#endif
extern void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b);
extern void (*glsym_glBindFramebuffer) (GLenum a, GLuint b);

View File

@ -1,5 +1,6 @@
#include "evas_gl_private.h"
#if 0 // filtering disabled
void
evas_gl_common_filter_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, Evas_Filter_Info *filter)
{
@ -174,7 +175,7 @@ evas_gl_common_image_filtered_free(Evas_GL_Image *image, Filtered_Image *fi)
image->filtered = eina_list_remove(image->filtered, fi);
}
#endif
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/

View File

@ -433,8 +433,10 @@ evas_gl_common_image_cache_flush(Evas_Engine_GL_Context *gc)
void
evas_gl_common_image_free(Evas_GL_Image *im)
{
#if 0 // filtering disabled
Filtered_Image *fi;
#endif
evas_gl_common_context_flush(im->gc);
im->references--;
if (im->references > 0) return;
@ -453,13 +455,14 @@ evas_gl_common_image_free(Evas_GL_Image *im)
if (im->im) evas_cache_image_drop(&im->im->cache_entry);
if (im->tex) evas_gl_common_texture_free(im->tex);
#if 0 // filtering disabled
EINA_LIST_FREE(im->filtered, fi)
{
free(fi->key);
evas_gl_common_image_free((Evas_GL_Image *)fi->image);
free(fi);
}
#endif
free(im);
}

View File

@ -934,10 +934,12 @@ module_open(Evas_Module *em)
ORD(image_colorspace_get);
ORD(image_native_set);
ORD(image_native_get);
#if 0 // filtering disabled
// ORD(image_draw_filtered);
// ORD(image_filtered_get);
// ORD(image_filtered_save);
// ORD(image_filtered_free);
#endif
ORD(font_draw);
ORD(image_scale_hint_set);

View File

@ -1574,6 +1574,7 @@ eng_image_native_get(void *data __UNUSED__, void *image)
return &(n->ns);
}
#if 0 // filtering disabled
static void
eng_image_draw_filtered(void *data, void *context, void *surface,
void *image, Evas_Filter_Info *filter)
@ -1605,7 +1606,7 @@ eng_image_filtered_free(void *im, Filtered_Image *fim)
{
evas_gl_common_image_filtered_free(im, fim);
}
#endif
//
@ -2978,10 +2979,12 @@ module_open(Evas_Module *em)
ORD(image_mask_create);
ORD(image_native_set);
ORD(image_native_get);
#if 0 // filtering disabled
ORD(image_draw_filtered);
ORD(image_filtered_get);
ORD(image_filtered_save);
ORD(image_filtered_free);
#endif
ORD(font_draw);

View File

@ -871,6 +871,7 @@ eng_canvas_alpha_get(void *data __UNUSED__, void *info __UNUSED__)
/* Filter API */
#if 0 // filtering disabled
static void
eng_image_draw_filtered(void *data __UNUSED__, void *context __UNUSED__,
void *surface, void *image, Evas_Filter_Info *filter)
@ -949,6 +950,7 @@ eng_image_filtered_free(void *image, Filtered_Image *fi)
im->filtered = eina_list_remove(im->filtered, fi);
}
#endif
static int
eng_image_load_error_get(void *data __UNUSED__, void *image)
@ -1080,10 +1082,12 @@ static Evas_Func func =
eng_font_pen_coords_get,
eng_font_text_props_info_create,
eng_font_right_inset_get,
#if 0 // filtering disabled
eng_image_draw_filtered,
eng_image_filtered_get,
eng_image_filtered_save,
eng_image_filtered_free,
#endif
NULL, // FIXME: need software mesa for gl rendering <- gl_surface_create
NULL, // FIXME: need software mesa for gl rendering <- gl_surface_destroy
NULL, // FIXME: need software mesa for gl rendering <- gl_context_create