forked from enlightenment/efl
evas filters: Move private data out of evas headers
This moves the filter internal data back to the filters implementation, rather than inside evas common headers.
This commit is contained in:
parent
b6c5af5edc
commit
a8b6c1cd7f
|
@ -17,6 +17,34 @@
|
|||
typedef struct _Evas_Filter_Data Evas_Filter_Data;
|
||||
typedef struct _Evas_Filter_Post_Render_Data Evas_Filter_Post_Render_Data;
|
||||
|
||||
struct _Evas_Object_Filter_Data
|
||||
{
|
||||
Evas_Object_Protected_Data *obj;
|
||||
Eina_Stringshare *name;
|
||||
Eina_Stringshare *code;
|
||||
Evas_Filter_Program *chain;
|
||||
Evas_Filter_Context *context;
|
||||
Eina_Hash *sources; // Evas_Filter_Proxy_Binding
|
||||
Eina_Inlist *data; // Evas_Filter_Data_Binding
|
||||
Eina_Rectangle prev_obscured, obscured;
|
||||
void *output;
|
||||
struct {
|
||||
struct {
|
||||
Eina_Stringshare *name;
|
||||
double value;
|
||||
} cur;
|
||||
struct {
|
||||
Eina_Stringshare *name;
|
||||
double value;
|
||||
} next;
|
||||
double pos;
|
||||
} state;
|
||||
Eina_Bool changed : 1;
|
||||
Eina_Bool invalid : 1; // Code parse failed
|
||||
Eina_Bool async : 1;
|
||||
Eina_Bool reuse : 1;
|
||||
};
|
||||
|
||||
struct _Evas_Filter_Data
|
||||
{
|
||||
const Evas_Object_Filter_Data *data;
|
||||
|
@ -29,6 +57,24 @@ struct _Evas_Filter_Post_Render_Data
|
|||
Eina_Bool success;
|
||||
};
|
||||
|
||||
static const Evas_Object_Filter_Data evas_filter_data_cow_default = {};
|
||||
Eina_Cow *evas_object_filter_cow = NULL;
|
||||
|
||||
void
|
||||
evas_filter_mixin_init(void)
|
||||
{
|
||||
evas_object_filter_cow = eina_cow_add
|
||||
("Evas Filter Data", sizeof(Evas_Object_Filter_Data), 8,
|
||||
&evas_filter_data_cow_default, EINA_TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
evas_filter_mixin_shutdown(void)
|
||||
{
|
||||
eina_cow_del(evas_object_filter_cow);
|
||||
evas_object_filter_cow = NULL;
|
||||
}
|
||||
|
||||
static inline void
|
||||
_state_check(Evas_Object_Filter_Data *fcow)
|
||||
{
|
||||
|
@ -630,7 +676,7 @@ _efl_canvas_filter_internal_efl_gfx_filter_filter_padding_get(Eo *eo_obj EINA_UN
|
|||
EOLIAN static void
|
||||
_efl_canvas_filter_internal_filter_changed_set(Eo *eo_obj EINA_UNUSED, Evas_Filter_Data *pd, Eina_Bool val)
|
||||
{
|
||||
if ((evas_object_filter_cow_default != pd->data) && (pd->data->changed != val))
|
||||
if ((&evas_filter_data_cow_default != pd->data) && (pd->data->changed != val))
|
||||
{
|
||||
Evas_Object_Filter_Data *fcow = FCOW_BEGIN(pd);
|
||||
fcow->changed = val;
|
||||
|
@ -668,7 +714,7 @@ _efl_canvas_filter_internal_efl_object_destructor(Eo *eo_obj, Evas_Filter_Data *
|
|||
Evas_Public_Data *e;
|
||||
Eina_Inlist *il;
|
||||
|
||||
if (!pd->data || (evas_object_filter_cow_default == pd->data))
|
||||
if (!pd->data || (&evas_filter_data_cow_default == pd->data))
|
||||
goto finish;
|
||||
|
||||
obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
|
|
|
@ -157,9 +157,7 @@ evas_shutdown(void)
|
|||
evas_object_image_state_cow = NULL;
|
||||
|
||||
evas_filter_shutdown();
|
||||
eina_cow_del(evas_object_filter_cow);
|
||||
eina_cow_del(evas_object_mask_cow);
|
||||
evas_object_filter_cow = NULL;
|
||||
evas_object_mask_cow = NULL;
|
||||
|
||||
evas_thread_shutdown();
|
||||
|
|
|
@ -32,10 +32,6 @@ static const Evas_Object_Protected_State default_state = {
|
|||
{ 255, 255, 255, 255 },
|
||||
1.0, 0, EVAS_RENDER_BLEND, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE
|
||||
};
|
||||
static const Evas_Object_Filter_Data default_filter = {
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, {}, {}, NULL, {}, EINA_FALSE, EINA_FALSE, EINA_TRUE, EINA_TRUE
|
||||
};
|
||||
const void * const evas_object_filter_cow_default = &default_filter;
|
||||
static const Evas_Object_Mask_Data default_mask = {
|
||||
NULL, 0, 0, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE
|
||||
};
|
||||
|
@ -44,36 +40,32 @@ Eina_Cow *evas_object_proxy_cow = NULL;
|
|||
Eina_Cow *evas_object_map_cow = NULL;
|
||||
Eina_Cow *evas_object_state_cow = NULL;
|
||||
Eina_Cow *evas_object_3d_cow = NULL;
|
||||
Eina_Cow *evas_object_filter_cow = NULL;
|
||||
Eina_Cow *evas_object_mask_cow = NULL;
|
||||
|
||||
static Eina_Bool
|
||||
_init_cow(void)
|
||||
{
|
||||
if (evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow && evas_object_3d_cow && evas_object_filter_cow) return EINA_TRUE;
|
||||
if (evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow && evas_object_3d_cow) return EINA_TRUE;
|
||||
|
||||
evas_object_proxy_cow = eina_cow_add("Evas Object Proxy", sizeof (Evas_Object_Proxy_Data), 8, &default_proxy, EINA_TRUE);
|
||||
evas_object_map_cow = eina_cow_add("Evas Object Map", sizeof (Evas_Object_Map_Data), 8, &default_map, EINA_TRUE);
|
||||
evas_object_state_cow = eina_cow_add("Evas Object State", sizeof (Evas_Object_Protected_State), 64, &default_state, EINA_FALSE);
|
||||
evas_object_3d_cow = eina_cow_add("Evas Object 3D", sizeof (Evas_Object_3D_Data), 8, &default_proxy, EINA_TRUE);
|
||||
evas_object_filter_cow = eina_cow_add("Evas Filter Data", sizeof (Evas_Object_Filter_Data), 8, &default_filter, EINA_TRUE);
|
||||
evas_object_mask_cow = eina_cow_add("Evas Mask Data", sizeof (Evas_Object_Mask_Data), 8, &default_mask, EINA_TRUE);
|
||||
|
||||
if (!(evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow &&
|
||||
evas_object_3d_cow && evas_object_filter_cow && evas_object_mask_cow))
|
||||
evas_object_3d_cow && evas_object_mask_cow))
|
||||
{
|
||||
eina_cow_del(evas_object_proxy_cow);
|
||||
eina_cow_del(evas_object_map_cow);
|
||||
eina_cow_del(evas_object_state_cow);
|
||||
eina_cow_del(evas_object_3d_cow);
|
||||
eina_cow_del(evas_object_filter_cow);
|
||||
eina_cow_del(evas_object_mask_cow);
|
||||
|
||||
evas_object_proxy_cow = NULL;
|
||||
evas_object_map_cow = NULL;
|
||||
evas_object_state_cow = NULL;
|
||||
evas_object_3d_cow = NULL;
|
||||
evas_object_filter_cow = NULL;
|
||||
evas_object_mask_cow = NULL;
|
||||
|
||||
return EINA_FALSE;
|
||||
|
|
|
@ -1802,6 +1802,7 @@ evas_filter_init(void)
|
|||
{
|
||||
if ((init_cnt++) > 0) return;
|
||||
_evas_filter_log_dom = eina_log_domain_register("evas_filter", EVAS_FILTER_LOG_COLOR);
|
||||
evas_filter_mixin_init();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1809,6 +1810,7 @@ evas_filter_shutdown(void)
|
|||
{
|
||||
if ((--init_cnt) > 0) return;
|
||||
evas_filter_parser_shutdown();
|
||||
evas_filter_mixin_shutdown();
|
||||
eina_log_domain_unregister(_evas_filter_log_dom);
|
||||
_evas_filter_log_dom = 0;
|
||||
}
|
||||
|
|
|
@ -273,6 +273,9 @@ enum _Evas_Filter_Support
|
|||
EVAS_FILTER_SUPPORT_GL
|
||||
};
|
||||
|
||||
void evas_filter_mixin_init(void);
|
||||
void evas_filter_mixin_shutdown(void);
|
||||
|
||||
void evas_filter_context_clear(Evas_Filter_Context *ctx, Eina_Bool keep_buffers);
|
||||
void evas_filter_context_source_set(Evas_Filter_Context *ctx, Evas_Object *eo_proxy, Evas_Object *eo_source, int bufid, Eina_Stringshare *name);
|
||||
|
||||
|
|
|
@ -1284,34 +1284,6 @@ struct _Evas_Font_Description
|
|||
Eina_Bool is_new : 1;
|
||||
};
|
||||
|
||||
struct _Evas_Object_Filter_Data
|
||||
{
|
||||
Evas_Object_Protected_Data *obj;
|
||||
Eina_Stringshare *name;
|
||||
Eina_Stringshare *code;
|
||||
Evas_Filter_Program *chain;
|
||||
Evas_Filter_Context *context;
|
||||
Eina_Hash *sources; // Evas_Filter_Proxy_Binding
|
||||
Eina_Inlist *data; // Evas_Filter_Data_Binding
|
||||
Eina_Rectangle prev_obscured, obscured;
|
||||
void *output;
|
||||
struct {
|
||||
struct {
|
||||
Eina_Stringshare *name;
|
||||
double value;
|
||||
} cur;
|
||||
struct {
|
||||
Eina_Stringshare *name;
|
||||
double value;
|
||||
} next;
|
||||
double pos;
|
||||
} state;
|
||||
Eina_Bool changed : 1;
|
||||
Eina_Bool invalid : 1; // Code parse failed
|
||||
Eina_Bool async : 1;
|
||||
Eina_Bool reuse : 1;
|
||||
};
|
||||
|
||||
struct _Evas_Object_Func
|
||||
{
|
||||
void (*free) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
|
||||
|
@ -2062,10 +2034,6 @@ extern Eina_Cow *evas_object_3d_cow;
|
|||
extern Eina_Cow *evas_object_image_pixels_cow;
|
||||
extern Eina_Cow *evas_object_image_load_opts_cow;
|
||||
extern Eina_Cow *evas_object_image_state_cow;
|
||||
|
||||
extern Eina_Cow *evas_object_filter_cow;
|
||||
// This should be replaced by something like "eina_cow_default_get()" maybe
|
||||
extern const void * const evas_object_filter_cow_default;
|
||||
extern Eina_Cow *evas_object_mask_cow;
|
||||
|
||||
# define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State) \
|
||||
|
|
Loading…
Reference in New Issue