static const Evas_Object_Filter_Data default_filter = {
NULL, NULL, NULL, NULL, EINA_FALSE, EINA_FALSE
};
+const void * const evas_object_filter_cow_default = &default_filter;
Eina_Cow *evas_object_proxy_cow = NULL;
Eina_Cow *evas_object_map_cow = NULL;
static inline void
_evas_text_filter_changed_set(Evas_Text_Data *o, Eina_Bool val)
{
- if (o->cur.filter && (o->cur.filter->changed != val))
+ if ((evas_object_filter_cow_default != o->cur.filter)
+ && (o->cur.filter->changed != val))
{
EINA_COW_WRITE_BEGIN(evas_object_filter_cow, o->cur.filter, Evas_Object_Filter_Data, fcow)
fcow->changed = val;
Evas_Text_Data *o = eo_data_scope_get(eo_obj, MY_CLASS);
/* free filter output */
- EINA_COW_WRITE_BEGIN(evas_object_filter_cow, o->cur.filter, Evas_Object_Filter_Data, fcow)
- if (fcow->output)
- ENFN->image_free(ENDT, fcow->output);
- eina_hash_free(fcow->sources);
- evas_filter_program_del(fcow->chain);
- eina_stringshare_del(fcow->code);
- fcow->output = NULL;
- fcow->chain = NULL;
- fcow->sources = NULL;
- fcow->code = NULL;
- EINA_COW_WRITE_END(evas_object_filter_cow, o->cur.filter, fcow);
+ if (evas_object_filter_cow_default != o->cur.filter)
+ {
+ EINA_COW_WRITE_BEGIN(evas_object_filter_cow, o->cur.filter, Evas_Object_Filter_Data, fcow)
+ if (fcow->output)
+ ENFN->image_free(ENDT, fcow->output);
+ eina_hash_free(fcow->sources);
+ evas_filter_program_del(fcow->chain);
+ eina_stringshare_del(fcow->code);
+ fcow->output = NULL;
+ fcow->chain = NULL;
+ fcow->sources = NULL;
+ fcow->code = NULL;
+ EINA_COW_WRITE_END(evas_object_filter_cow, o->cur.filter, fcow);
+ eina_cow_free(evas_object_filter_cow, (const Eina_Cow_Data **) &o->cur.filter);
+ }
/* free obj */
_evas_object_text_items_clear(o);
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;
# define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State) \
EINA_COW_WRITE_BEGIN(evas_object_state_cow, Obj->State, \