} func;
Evas_Video_Surface video;
+
+ const char *tmpf;
+ int tmpf_fd;
};
struct _Evas_Object_Image_State
const Evas_Object_Image_State *cur;
const Evas_Object_Image_State *prev;
- int pixels_checked_out;
- int load_error;
-
// This pointer is an Eina_Cow pointer
const Evas_Object_Image_Load_Opts *load_opts;
const Evas_Object_Image_Pixels *pixels;
- const char *tmpf;
- int tmpf_fd;
+ void *engine_data;
+
+ int pixels_checked_out;
+ int load_error;
Evas_Image_Scale_Hint scale_hint;
Evas_Image_Content_Hint content_hint;
- void *engine_data;
-
Eina_Bool changed : 1;
Eina_Bool dirty_pixels : 1;
Eina_Bool filled : 1;
static Evas_Coord evas_object_image_figure_y_fill(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret);
static void evas_object_image_init(Evas_Object *eo_obj);
-static void evas_object_image_new(Evas_Object *eo_obj);
static void evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
static void evas_object_image_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
static void evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
};
static const Evas_Object_Image_Pixels default_pixels = {
- NULL, { NULL, NULL }, { 0, NULL, NULL, NULL, NULL, NULL, NULL }
+ NULL, { NULL, NULL }, { 0, NULL, NULL, NULL, NULL, NULL, NULL }, NULL, -1
};
static const Evas_Object_Image_State default_state = {
o->engine_data,
eo_obj);
}
- if (o->tmpf) _cleanup_tmpf(eo_obj);
+ if (o->pixels->tmpf) _cleanup_tmpf(eo_obj);
if (o->cur->source) _proxy_unset(eo_obj);
}
Evas_Object_Image *o;
o = eo_data_get(eo_obj, MY_CLASS);
- if (!o->tmpf) return;
+ if (!o->pixels->tmpf) return;
#ifdef __linux__
#else
- unlink(o->tmpf);
+ unlink(o->pixels->tmpf);
#endif
- if (o->tmpf_fd >= 0) close(o->tmpf_fd);
- eina_stringshare_del(o->tmpf);
- o->tmpf_fd = -1;
- o->tmpf = NULL;
+ EINA_COW_PIXEL_WRITE_BEGIN(o, pixels)
+ {
+ if (pixels->tmpf_fd >= 0) close(pixels->tmpf_fd);
+ eina_stringshare_del(pixels->tmpf);
+ pixels->tmpf_fd = -1;
+ pixels->tmpf = NULL;
+ }
+ EINA_COW_PIXEL_WRITE_END(o, pixels);
#else
(void) eo_obj;
#endif
close(fd);
return;
}
- o->tmpf_fd = fd;
+ EINA_COW_PIXEL_WRITE_BEGIN(o, pixels)
+ pixels->tmpf_fd = fd;
+ EINA_COW_PIXEL_WRITE_END(o, pixels);
#ifdef __linux__
snprintf(buf, sizeof(buf), "/proc/%li/fd/%i", (long)getpid(), fd);
#endif
- o->tmpf = eina_stringshare_add(buf);
+ EINA_COW_PIXEL_WRITE_BEGIN(o, pixels)
+ pixels->tmpf = eina_stringshare_add(buf);
+ EINA_COW_PIXEL_WRITE_END(o, pixels);
memcpy(dst, data, size);
munmap(dst, size);
#else
if ((size < 1) || (!data)) return;
_create_tmpf(eo_obj, data, size, format);
- evas_object_image_file_set(eo_obj, o->tmpf, key);
+ evas_object_image_file_set(eo_obj, o->pixels->tmpf, key);
if (!o->engine_data)
{
- ERR("unable to load '%s' from memory", o->tmpf);
+ ERR("unable to load '%s' from memory", o->pixels->tmpf);
_cleanup_tmpf(eo_obj);
return;
}
const char *file = va_arg(*list, const char*);
const char *key = va_arg(*list, const char*);
- if ((o->tmpf) && (file != o->tmpf)) _cleanup_tmpf(eo_obj);
+ if ((o->pixels->tmpf) && (file != o->pixels->tmpf)) _cleanup_tmpf(eo_obj);
if ((o->cur->file) && (file) && (!strcmp(o->cur->file, file)))
{
if ((!o->cur->key) && (!key))
evas_object_image_init(Evas_Object *eo_obj)
{
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
- evas_object_image_new(eo_obj);
/* set up default settings for this kind of object */
obj->cur.color.r = 255;
obj->cur.color.g = 255;
}
static void
-evas_object_image_new(Evas_Object *eo_obj)
-{
- Evas_Object_Image *o = eo_data_get(eo_obj, EVAS_OBJ_IMAGE_CLASS);
- o->tmpf_fd = -1;
-}
-
-static void
_destructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);