evas_object_image.c   evas_object_image.c 
skipping to change at line 180 skipping to change at line 180
EAPI Evas_Object * EAPI Evas_Object *
evas_object_image_add(Evas *e) evas_object_image_add(Evas *e)
{ {
Evas_Object *obj; Evas_Object *obj;
Evas_Object_Image *o; Evas_Object_Image *o;
MAGIC_CHECK(e, Evas, MAGIC_EVAS); MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return NULL; return NULL;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
EINA_SAFETY_ON_NULL_RETURN_VAL(e->engine.func, NULL);
obj = evas_object_new(e); obj = evas_object_new(e);
evas_object_image_init(obj); evas_object_image_init(obj);
evas_object_inject(obj, e); evas_object_inject(obj, e);
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get(obj- >layer->evas->engine.data.output, o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get(obj- >layer->evas->engine.data.output,
o->en gine_data); o->en gine_data);
return obj; return obj;
} }
EAPI Evas_Object * EAPI Evas_Object *
skipping to change at line 449 skipping to change at line 450
Evas_Object_Image *o; Evas_Object_Image *o;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return EINA_FALSE; return EINA_FALSE;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
o = obj->object_data; o = obj->object_data;
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE); MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return EINA_FALSE; return EINA_FALSE;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
if (src == obj) return EINA_FALSE; if (obj->delete_me && src)
{
WRN("Setting deleted object %p as image source %p", src, obj);
return EINA_FALSE;
}
if (src)
{
if (src->delete_me)
{
WRN("Setting object %p to deleted image source %p", src, obj);
return EINA_FALSE;
}
if (!src->layer)
{
CRIT("No evas surface associated with source object (%p)", obj
);
return EINA_FALSE;
}
if ((obj->layer && src->layer) &&
(obj->layer->evas != src->layer->evas))
{
CRIT("Setting object %p from Evas (%p) from another Evas (%p)"
, src, src->layer->evas, obj->layer->evas);
return EINA_FALSE;
}
if (src == obj)
{
CRIT("Setting object %p as a source for itself", obj);
return EINA_FALSE;
}
}
if (o->cur.source == src) return EINA_TRUE; if (o->cur.source == src) return EINA_TRUE;
_evas_object_image_cleanup(obj, o); _evas_object_image_cleanup(obj, o);
/* Kill the image if any */ /* Kill the image if any */
if (o->cur.file || o->cur.key) if (o->cur.file || o->cur.key)
evas_object_image_file_set(obj, NULL, NULL); evas_object_image_file_set(obj, NULL, NULL);
if (src) if (src) _proxy_set(obj, src);
{ else _proxy_unset(obj);
_proxy_set(obj, src);
}
return EINA_TRUE; return EINA_TRUE;
} }
EAPI Evas_Object * EAPI Evas_Object *
evas_object_image_source_get(const Evas_Object *obj) evas_object_image_source_get(const Evas_Object *obj)
{ {
Evas_Object_Image *o; Evas_Object_Image *o;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
skipping to change at line 659 skipping to change at line 686
return 1.0; return 1.0;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
return o->cur.border.scale; return o->cur.border.scale;
} }
EAPI void EAPI void
evas_object_image_fill_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Ev as_Coord w, Evas_Coord h) evas_object_image_fill_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Ev as_Coord w, Evas_Coord h)
{ {
Evas_Object_Image *o; Evas_Object_Image *o;
if (w < 0) w = -w;
if (h < 0) h = -h;
if (w == 0) return; if (w == 0) return;
if (h == 0) return; if (h == 0) return;
if (w < 0) w = -w;
if (h < 0) h = -h;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE); MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
if ((o->cur.fill.x == x) && if ((o->cur.fill.x == x) &&
(o->cur.fill.y == y) && (o->cur.fill.y == y) &&
(o->cur.fill.w == w) && (o->cur.fill.w == w) &&
(o->cur.fill.h == h)) return; (o->cur.fill.h == h)) return;
o->cur.fill.x = x; o->cur.fill.x = x;
o->cur.fill.y = y; o->cur.fill.y = y;
o->cur.fill.w = w; o->cur.fill.w = w;
o->cur.fill.h = h; o->cur.fill.h = h;
o->cur.opaque_valid = 0; o->cur.opaque_valid = 0;
o->changed = 1; o->changed = 1;
skipping to change at line 860 skipping to change at line 889
return 0; return 0;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
return o->load_error; return o->load_error;
} }
EAPI void * EAPI void *
evas_object_image_data_convert(Evas_Object *obj, Evas_Colorspace to_cspace) evas_object_image_data_convert(Evas_Object *obj, Evas_Colorspace to_cspace)
{ {
Evas_Object_Image *o; Evas_Object_Image *o;
DATA32 *data; DATA32 *data;
void* result = NULL;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return NULL; return NULL;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE); MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return NULL; return NULL;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
if ((o->preloading) && (o->engine_data)) if ((o->preloading) && (o->engine_data))
{ {
o->preloading = 0; o->preloading = 0;
obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer ->evas->engine.data.output, obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer ->evas->engine.data.output,
o->engine_ data, o->engine_ data,
obj); obj);
} }
if (!o->engine_data) return NULL; if (!o->engine_data) return NULL;
if (o->video_surface) if (o->video_surface)
o->video.update_pixels(o->video.data, obj, &o->video); o->video.update_pixels(o->video.data, obj, &o->video);
if (o->cur.cspace == to_cspace) return NULL; if (o->cur.cspace == to_cspace) return NULL;
data = NULL; data = NULL;
o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->laye o->engine_data =
r->evas->engine.data.output, obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine
o->engine_ .data.output,
data, o->engine_data, 0, &data
0, ,
&data, &o->load_error);
&o->load_ result = evas_object_image_data_convert_internal(o, data, to_cspace);
error); if (o->engine_data)
return evas_object_image_data_convert_internal(o, data, to_cspace); {
} o->engine_data =
obj->layer->evas->engine.func->image_data_put(obj->layer->evas->e
ngine.data.output,
o->engine_data, dat
a);
}
return result;
}
EAPI void EAPI void
evas_object_image_data_set(Evas_Object *obj, void *data) evas_object_image_data_set(Evas_Object *obj, void *data)
{ {
Evas_Object_Image *o; Evas_Object_Image *o;
void *p_data; void *p_data;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE); MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
_evas_object_image_cleanup(obj, o); _evas_object_image_cleanup(obj, o);
#ifdef EVAS_FRAME_QUEUING
if (o->engine_data)
evas_common_pipe_op_image_flush(o->engine_data);
#endif
p_data = o->engine_data; p_data = o->engine_data;
if (data) if (data)
{ {
if (o->engine_data) if (o->engine_data)
o->engine_data = obj->layer->evas->engine.func->image_data_put(obj {
->layer->evas->engine.data.output, o->engine_data =
o-> obj->layer->evas->engine.func->image_data_put(obj->layer->ev
engine_data, as->engine.data.output,
dat o->engine_data
a); ,
data);
}
else else
o->engine_data = obj->layer->evas->engine.func->image_new_from_dat {
a(obj->layer->evas->engine.data.output, o->engine_data =
obj->layer->evas->engine.func->image_new_from_data(obj->laye
o->cur.image.w, r->evas->engine.data.output,
o->cur.im
o->cur.image.h, age.w,
o->cur.im
data, age.h,
data,
o->cur.has_alpha, o->cur.ha
s_alpha,
o->cur.cspace); o->cur.cs
pace);
}
if (o->engine_data) if (o->engine_data)
{ {
int stride = 0; int stride = 0;
if (obj->layer->evas->engine.func->image_scale_hint_set) if (obj->layer->evas->engine.func->image_scale_hint_set)
obj->layer->evas->engine.func->image_scale_hint_set obj->layer->evas->engine.func->image_scale_hint_set
(obj->layer->evas->engine.data.output, (obj->layer->evas->engine.data.output,
o->engine_data, o->scale_hint); o->engine_data, o->scale_hint);
if (obj->layer->evas->engine.func->image_content_hint_set) if (obj->layer->evas->engine.func->image_content_hint_set)
obj->layer->evas->engine.func->image_content_hint_set obj->layer->evas->engine.func->image_content_hint_set
skipping to change at line 982 skipping to change at line 1020
DATA32 *data; DATA32 *data;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return NULL; return NULL;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE); MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return NULL; return NULL;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
if (!o->engine_data) return NULL; if (!o->engine_data) return NULL;
#ifdef EVAS_FRAME_QUEUING
evas_common_pipe_op_image_flush(o->engine_data);
#endif
data = NULL; data = NULL;
if (obj->layer->evas->engine.func->image_scale_hint_set) if (obj->layer->evas->engine.func->image_scale_hint_set)
obj->layer->evas->engine.func->image_scale_hint_set obj->layer->evas->engine.func->image_scale_hint_set
(obj->layer->evas->engine.data.output, (obj->layer->evas->engine.data.output,
o->engine_data, o->scale_hint); o->engine_data, o->scale_hint);
if (obj->layer->evas->engine.func->image_content_hint_set) if (obj->layer->evas->engine.func->image_content_hint_set)
obj->layer->evas->engine.func->image_content_hint_set obj->layer->evas->engine.func->image_content_hint_set
(obj->layer->evas->engine.data.output, (obj->layer->evas->engine.data.output,
o->engine_data, o->content_hint); o->engine_data, o->content_hint);
o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->laye o->engine_data =
r->evas->engine.data.output, obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine
o->engine_ .data.output,
data, o->engine_data,
for_writin for_writing, &data,
g, &o->load_error);
&data,
&o->load_
error);
/* if we fail to get engine_data, we have to return NULL */ /* if we fail to get engine_data, we have to return NULL */
if (!o->engine_data) return NULL; if (!o->engine_data) return NULL;
if (o->engine_data) if (o->engine_data)
{ {
int stride = 0; int stride = 0;
if (obj->layer->evas->engine.func->image_stride_get) if (obj->layer->evas->engine.func->image_stride_get)
obj->layer->evas->engine.func->image_stride_get obj->layer->evas->engine.func->image_stride_get
skipping to change at line 1086 skipping to change at line 1121
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE); MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
_evas_object_image_cleanup(obj, o); _evas_object_image_cleanup(obj, o);
if ((o->cur.image.w <= 0) || if ((o->cur.image.w <= 0) ||
(o->cur.image.h <= 0)) return; (o->cur.image.h <= 0)) return;
if (o->engine_data) if (o->engine_data)
obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.dat a.output, obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.dat a.output,
o->engine_data); o->engine_data);
o->engine_data = obj->layer->evas->engine.func->image_new_from_copied_da o->engine_data =
ta(obj->layer->evas->engine.data.output, obj->layer->evas->engine.func->image_new_from_copied_data(obj->layer->
evas->engine.data.output,
o->cur.image.w, o->cur.image
.w,
o->cur.image.h, o->cur.image
.h,
data, data,
o->cur.has_a
o->cur.has_alpha, lpha,
o->cur.cspac
o->cur.cspace); e);
if (o->engine_data) if (o->engine_data)
{ {
int stride = 0; int stride = 0;
o->engine_data = obj->layer->evas->engine.func->image_alpha_set(obj o->engine_data =
->layer->evas->engine.data.output, obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->
o-> engine.data.output,
engine_data, o->engine_data,
o-> o->cur.has_alpha);
cur.has_alpha);
if (obj->layer->evas->engine.func->image_scale_hint_set) if (obj->layer->evas->engine.func->image_scale_hint_set)
obj->layer->evas->engine.func->image_scale_hint_set obj->layer->evas->engine.func->image_scale_hint_set
(obj->layer->evas->engine.data.output, (obj->layer->evas->engine.data.output,
o->engine_data, o->scale_hint); o->engine_data, o->scale_hint);
if (obj->layer->evas->engine.func->image_content_hint_set) if (obj->layer->evas->engine.func->image_content_hint_set)
obj->layer->evas->engine.func->image_content_hint_set obj->layer->evas->engine.func->image_content_hint_set
(obj->layer->evas->engine.data.output, (obj->layer->evas->engine.data.output,
o->engine_data, o->content_hint); o->engine_data, o->content_hint);
if (obj->layer->evas->engine.func->image_stride_get) if (obj->layer->evas->engine.func->image_stride_get)
obj->layer->evas->engine.func->image_stride_get obj->layer->evas->engine.func->image_stride_get
skipping to change at line 1167 skipping to change at line 1204
obj); obj);
} }
if (((has_alpha) && (o->cur.has_alpha)) || if (((has_alpha) && (o->cur.has_alpha)) ||
((!has_alpha) && (!o->cur.has_alpha))) ((!has_alpha) && (!o->cur.has_alpha)))
return; return;
o->cur.has_alpha = has_alpha; o->cur.has_alpha = has_alpha;
if (o->engine_data) if (o->engine_data)
{ {
int stride = 0; int stride = 0;
#ifdef EVAS_FRAME_QUEUING o->engine_data =
evas_common_pipe_op_image_flush(o->engine_data); obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->
#endif engine.data.output,
o->engine_data = obj->layer->evas->engine.func->image_alpha_set(obj o->engine_data,
->layer->evas->engine.data.output, o->cur.has_alpha);
o->engi
ne_data,
o->cur.
has_alpha);
if (obj->layer->evas->engine.func->image_scale_hint_set) if (obj->layer->evas->engine.func->image_scale_hint_set)
obj->layer->evas->engine.func->image_scale_hint_set obj->layer->evas->engine.func->image_scale_hint_set
(obj->layer->evas->engine.data.output, (obj->layer->evas->engine.data.output,
o->engine_data, o->scale_hint); o->engine_data, o->scale_hint);
if (obj->layer->evas->engine.func->image_content_hint_set) if (obj->layer->evas->engine.func->image_content_hint_set)
obj->layer->evas->engine.func->image_content_hint_set obj->layer->evas->engine.func->image_content_hint_set
(obj->layer->evas->engine.data.output, (obj->layer->evas->engine.data.output,
o->engine_data, o->content_hint); o->engine_data, o->content_hint);
if (obj->layer->evas->engine.func->image_stride_get) if (obj->layer->evas->engine.func->image_stride_get)
obj->layer->evas->engine.func->image_stride_get obj->layer->evas->engine.func->image_stride_get
skipping to change at line 1339 skipping to change at line 1374
if (im->image.data) if (im->image.data)
{ {
ok = evas_common_save_image_to_file(im, file, key, quality, com press); ok = evas_common_save_image_to_file(im, file, key, quality, com press);
if (o->cur.cspace != EVAS_COLORSPACE_ARGB8888) if (o->cur.cspace != EVAS_COLORSPACE_ARGB8888)
free(im->image.data); free(im->image.data);
} }
evas_cache_image_drop(&im->cache_entry); evas_cache_image_drop(&im->cache_entry);
} }
o->engine_data = obj->layer->evas->engine.func->image_data_put(obj->laye
r->evas->engine.data.output,
o->engine
_data,
data);
return ok; return ok;
} }
EAPI Eina_Bool EAPI Eina_Bool
evas_object_image_pixels_import(Evas_Object *obj, Evas_Pixel_Import_Source *pixels) evas_object_image_pixels_import(Evas_Object *obj, Evas_Pixel_Import_Source *pixels)
{ {
Evas_Object_Image *o; Evas_Object_Image *o;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return 0; return 0;
skipping to change at line 1689 skipping to change at line 1727
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE); MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
_evas_object_image_cleanup(obj, o); _evas_object_image_cleanup(obj, o);
#ifdef EVAS_FRAME_QUEUING
if ((Evas_Colorspace)o->cur.cspace != cspace)
{
if (o->engine_data)
evas_common_pipe_op_image_flush(o->engine_data);
}
#endif
o->cur.cspace = cspace; o->cur.cspace = cspace;
if (o->engine_data) if (o->engine_data)
obj->layer->evas->engine.func->image_colorspace_set(obj->layer->evas-> engine.data.output, obj->layer->evas->engine.func->image_colorspace_set(obj->layer->evas-> engine.data.output,
o->engine_data, o->engine_data,
cspace); cspace);
} }
EAPI Evas_Colorspace EAPI Evas_Colorspace
evas_object_image_colorspace_get(const Evas_Object *obj) evas_object_image_colorspace_get(const Evas_Object *obj)
skipping to change at line 1836 skipping to change at line 1867
Evas_Object_Image *o; Evas_Object_Image *o;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE); MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
if (o->scale_hint == hint) return; if (o->scale_hint == hint) return;
#ifdef EVAS_FRAME_QUEUING
if (o->engine_data)
evas_common_pipe_op_image_flush(o->engine_data);
#endif
o->scale_hint = hint; o->scale_hint = hint;
if (o->engine_data) if (o->engine_data)
{ {
int stride = 0; int stride = 0;
if (obj->layer->evas->engine.func->image_scale_hint_set) if (obj->layer->evas->engine.func->image_scale_hint_set)
obj->layer->evas->engine.func->image_scale_hint_set obj->layer->evas->engine.func->image_scale_hint_set
(obj->layer->evas->engine.data.output, (obj->layer->evas->engine.data.output,
o->engine_data, o->scale_hint); o->engine_data, o->scale_hint);
if (obj->layer->evas->engine.func->image_stride_get) if (obj->layer->evas->engine.func->image_stride_get)
skipping to change at line 1887 skipping to change at line 1914
Evas_Object_Image *o; Evas_Object_Image *o;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE); MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
if (o->content_hint == hint) return; if (o->content_hint == hint) return;
#ifdef EVAS_FRAME_QUEUING
if (o->engine_data)
evas_common_pipe_op_image_flush(o->engine_data);
#endif
o->content_hint = hint; o->content_hint = hint;
if (o->engine_data) if (o->engine_data)
{ {
int stride = 0; int stride = 0;
if (obj->layer->evas->engine.func->image_content_hint_set) if (obj->layer->evas->engine.func->image_content_hint_set)
obj->layer->evas->engine.func->image_content_hint_set obj->layer->evas->engine.func->image_content_hint_set
(obj->layer->evas->engine.data.output, (obj->layer->evas->engine.data.output,
o->engine_data, o->content_hint); o->engine_data, o->content_hint);
if (obj->layer->evas->engine.func->image_stride_get) if (obj->layer->evas->engine.func->image_stride_get)
skipping to change at line 2233 skipping to change at line 2256
static void static void
_proxy_set(Evas_Object *proxy, Evas_Object *src) _proxy_set(Evas_Object *proxy, Evas_Object *src)
{ {
Evas_Object_Image *o; Evas_Object_Image *o;
o = proxy->object_data; o = proxy->object_data;
evas_object_image_file_set(proxy, NULL, NULL); evas_object_image_file_set(proxy, NULL, NULL);
o->cur.source = src; o->cur.source = src;
o->load_error = EVAS_LOAD_ERROR_NONE;
src->proxy.proxies = eina_list_append(src->proxy.proxies, proxy); src->proxy.proxies = eina_list_append(src->proxy.proxies, proxy);
src->proxy.redraw = EINA_TRUE; src->proxy.redraw = EINA_TRUE;
} }
/* Some moron just set a proxy on a proxy. /* Some moron just set a proxy on a proxy.
* Give them some pixels. A random color * Give them some pixels. A random color
*/ */
static void static void
_proxy_error(Evas_Object *proxy, void *context, void *output, void *surface , _proxy_error(Evas_Object *proxy, void *context, void *output, void *surface ,
skipping to change at line 2338 skipping to change at line 2362
/* FIXME: Hardcoded alpha 'on' */ /* FIXME: Hardcoded alpha 'on' */
/* FIXME (cont): Should see if the object has alpha */ /* FIXME (cont): Should see if the object has alpha */
if (!source->proxy.surface) if (!source->proxy.surface)
{ {
source->proxy.surface = e->engine.func->image_map_surface_new source->proxy.surface = e->engine.func->image_map_surface_new
(e->engine.data.output, w, h, 1); (e->engine.data.output, w, h, 1);
source->proxy.w = w; source->proxy.w = w;
source->proxy.h = h; source->proxy.h = h;
} }
if (!source->proxy.surface) return;
ctx = e->engine.func->context_new(e->engine.data.output); ctx = e->engine.func->context_new(e->engine.data.output);
e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, 0, 0 ); e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, 0, 0 );
e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_R ENDER_COPY); e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_R ENDER_COPY);
e->engine.func->rectangle_draw(e->engine.data.output, ctx, e->engine.func->rectangle_draw(e->engine.data.output, ctx,
source->proxy.surface, 0, 0, w, h); source->proxy.surface, 0, 0, w, h);
e->engine.func->context_free(e->engine.data.output, ctx); e->engine.func->context_free(e->engine.data.output, ctx);
ctx = e->engine.func->context_new(e->engine.data.output); ctx = e->engine.func->context_new(e->engine.data.output);
evas_render_mapped(e, source, ctx, source->proxy.surface, evas_render_mapped(e, source, ctx, source->proxy.surface,
-source->cur.geometry.x, -source->cur.geometry.x,
skipping to change at line 2702 skipping to change at line 2728
obj->func = &object_func; obj->func = &object_func;
obj->type = o_type; obj->type = o_type;
} }
static void * static void *
evas_object_image_new(void) evas_object_image_new(void)
{ {
Evas_Object_Image *o; Evas_Object_Image *o;
/* alloc obj private data */ /* alloc obj private data */
EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_image", Evas_Object_Image, 256, NULL); EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_image", Evas_Object_Image, 16, N ULL);
o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Image); o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Image);
if (!o) return NULL; if (!o) return NULL;
EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Image); EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Image);
o->magic = MAGIC_OBJ_IMAGE; o->magic = MAGIC_OBJ_IMAGE;
o->cur.fill.w = 0; o->cur.fill.w = 0;
o->cur.fill.h = 0; o->cur.fill.h = 0;
o->cur.smooth_scale = 1; o->cur.smooth_scale = 1;
o->cur.border.fill = 1; o->cur.border.fill = 1;
o->cur.border.scale = 1.0; o->cur.border.scale = 1.0;
o->cur.cspace = EVAS_COLORSPACE_ARGB8888; o->cur.cspace = EVAS_COLORSPACE_ARGB8888;
skipping to change at line 2956 skipping to change at line 2982
if (o->engine_data != pixels) if (o->engine_data != pixels)
pixels = o->engine_data; pixels = o->engine_data;
o->engine_data = obj->layer->evas->engine.func->image_dirt y_region o->engine_data = obj->layer->evas->engine.func->image_dirt y_region
(obj->layer->evas->engine.data.output, o->engine_data, (obj->layer->evas->engine.data.output, o->engine_data,
0, 0, o->cur.image.w, o->cur.image.h); 0, 0, o->cur.image.w, o->cur.image.h);
} }
o->dirty_pixels = 0; o->dirty_pixels = 0;
} }
if ((obj->cur.map) && (obj->cur.map->count > 3) && (obj->cur.usemap )) if ((obj->cur.map) && (obj->cur.map->count > 3) && (obj->cur.usemap ))
{ {
const Evas_Map_Point *p, *p_end; evas_object_map_update(obj, x, y, imagew, imageh, uvw, uvh);
RGBA_Map_Point pts[obj->cur.map->count], *pt;
p = obj->cur.map->points;
p_end = p + obj->cur.map->count;
pt = pts;
pts[0].px = obj->cur.map->persp.px << FP;
pts[0].py = obj->cur.map->persp.py << FP;
pts[0].foc = obj->cur.map->persp.foc << FP;
pts[0].z0 = obj->cur.map->persp.z0 << FP;
// draw geom +x +y
for (; p < p_end; p++, pt++)
{
pt->x = (lround(p->x) + x) * FP1;
pt->y = (lround(p->y) + y) * FP1;
pt->z = (lround(p->z) ) * FP1;
pt->fx = p->px;
pt->fy = p->py;
pt->fz = p->z;
pt->u = ((lround(p->u) * imagew) / uvw) * FP1;
pt->v = ((lround(p->v) * imageh) / uvh) * FP1;
if (pt->u < 0) pt->u = 0;
else if (pt->u > (imagew * FP1)) pt->u = (imagew * FP1);
if (pt->v < 0) pt->v = 0;
else if (pt->v > (imageh * FP1)) pt->v = (imageh * FP1);
pt->col = ARGB_JOIN(p->a, p->r, p->g, p->b);
}
if (obj->cur.map->count & 0x1)
{
pts[obj->cur.map->count] = pts[obj->cur.map->count -1];
}
obj->layer->evas->engine.func->image_map_draw obj->layer->evas->engine.func->image_map_draw
(output, context, surface, pixels, obj->cur.map->count, (output, context, surface, pixels, obj->spans,
pts, o->cur.smooth_scale | obj->cur.map->smooth, 0); o->cur.smooth_scale | obj->cur.map->smooth, 0);
} }
else else
{ {
obj->layer->evas->engine.func->image_scale_hint_set(output, obj->layer->evas->engine.func->image_scale_hint_set(output,
pixels, pixels,
o->scale_h int); o->scale_h int);
/* This is technically a bug here: If the value is recreated /* This is technically a bug here: If the value is recreated
* (which is returned)it may be a new object, however exactly 0 * (which is returned)it may be a new object, however exactly 0
* of all the evas engines do this. */ * of all the evas engines do this. */
obj->layer->evas->engine.func->image_border_set(output, pixels , obj->layer->evas->engine.func->image_border_set(output, pixels ,
skipping to change at line 3248 skipping to change at line 3243
/* now figure what changed and add draw rects */ /* now figure what changed and add draw rects */
/* if it just became visible or invisible */ /* if it just became visible or invisible */
is_v = evas_object_is_visible(obj); is_v = evas_object_is_visible(obj);
was_v = evas_object_was_visible(obj); was_v = evas_object_was_visible(obj);
if (is_v != was_v) if (is_v != was_v)
{ {
evas_object_render_pre_visible_change(&e->clip_changes, obj, is_v, w as_v); evas_object_render_pre_visible_change(&e->clip_changes, obj, is_v, w as_v);
if (!o->pixel_updates) goto done; if (!o->pixel_updates) goto done;
} }
if ((obj->cur.map != obj->prev.map) || if (obj->changed_map)
(obj->cur.usemap != obj->prev.usemap))
{ {
evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); evas_object_render_pre_prev_cur_add(&e->clip_changes, obj);
goto done; goto done;
} }
/* it's not visible - we accounted for it appearing or not so just abort */ /* it's not visible - we accounted for it appearing or not so just abort */
if (!is_v) goto done; if (!is_v) goto done;
/* clipper changed this is in addition to anything else for obj */ /* clipper changed this is in addition to anything else for obj */
evas_object_render_pre_clipper_change(&e->clip_changes, obj); evas_object_render_pre_clipper_change(&e->clip_changes, obj);
/* if we restacked (layer or just within a layer) and don't clip anyone */ /* if we restacked (layer or just within a layer) and don't clip anyone */
if (obj->restack) if (obj->restack)
skipping to change at line 3492 skipping to change at line 3486
/* this moves the current data to the previous state parts of the object */ /* this moves the current data to the previous state parts of the object */
/* in whatever way is safest for the object. also if we don't need objec t */ /* in whatever way is safest for the object. also if we don't need objec t */
/* data anymore we can free it if the object deems this is a good idea * / /* data anymore we can free it if the object deems this is a good idea * /
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
/* remove those pesky changes */ /* remove those pesky changes */
evas_object_clip_changes_clean(obj); evas_object_clip_changes_clean(obj);
EINA_LIST_FREE(o->pixel_updates, r) EINA_LIST_FREE(o->pixel_updates, r)
eina_rectangle_free(r); eina_rectangle_free(r);
/* move cur to prev safely for object data */ /* move cur to prev safely for object data */
obj->prev = obj->cur; evas_object_cur_prev(obj);
o->prev = o->cur; o->prev = o->cur;
o->changed = 0; o->changed = 0;
/* FIXME: copy strings across */ /* FIXME: copy strings across */
} }
static unsigned int evas_object_image_id_get(Evas_Object *obj) static unsigned int evas_object_image_id_get(Evas_Object *obj)
{ {
Evas_Object_Image *o; Evas_Object_Image *o;
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
skipping to change at line 3643 skipping to change at line 3637
return 1; return 1;
} }
static int static int
evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y) evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
{ {
Evas_Object_Image *o; Evas_Object_Image *o;
DATA32 *data; DATA32 *data;
int w, h, stride, iw, ih; int w, h, stride, iw, ih;
int a; int a;
int return_value;
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
x -= obj->cur.cache.clip.x; x -= obj->cur.cache.clip.x;
y -= obj->cur.cache.clip.y; y -= obj->cur.cache.clip.y;
w = obj->cur.cache.clip.w; w = obj->cur.cache.clip.w;
h = obj->cur.cache.clip.h; h = obj->cur.cache.clip.h;
iw = o->cur.image.w; iw = o->cur.image.w;
ih = o->cur.image.h; ih = o->cur.image.h;
skipping to change at line 3746 skipping to change at line 3741
if (y >= ih) y = ih - 1; if (y >= ih) y = ih - 1;
stride = o->cur.image.stride; stride = o->cur.image.stride;
o->engine_data = obj->layer->evas->engine.func->image_data_get o->engine_data = obj->layer->evas->engine.func->image_data_get
(obj->layer->evas->engine.data.output, (obj->layer->evas->engine.data.output,
o->engine_data, o->engine_data,
0, 0,
&data, &data,
&o->load_error); &o->load_error);
if (!data) if (!data)
return 0; {
return_value = 0;
goto finish;
}
switch (o->cur.cspace) switch (o->cur.cspace)
{ {
case EVAS_COLORSPACE_ARGB8888: case EVAS_COLORSPACE_ARGB8888:
data = ((DATA32*)(data) + ((y * (stride >> 2)) + x)); data = ((DATA32*)(data) + ((y * (stride >> 2)) + x));
a = (*((DATA32*)(data)) >> 24) & 0xff; a = (*((DATA32*)(data)) >> 24) & 0xff;
break; break;
case EVAS_COLORSPACE_RGB565_A5P: case EVAS_COLORSPACE_RGB565_A5P:
data = (void*) ((DATA16*)(data) + (h * (stride >> 1))); data = (void*) ((DATA16*)(data) + (h * (stride >> 1)));
data = (void*) ((DATA8*)(data) + ((y * (stride >> 1)) + x)); data = (void*) ((DATA8*)(data) + ((y * (stride >> 1)) + x));
a = (*((DATA8*)(data))) & 0x1f; a = (*((DATA8*)(data))) & 0x1f;
break; break;
default: default:
return 1; return_value = 1;
goto finish;
break; break;
} }
return (a != 0); return_value = (a != 0);
goto finish;
finish:
obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.d
ata.output,
o->engine_data,
data);
return return_value;
} }
static int static int
evas_object_image_has_opaque_rect(Evas_Object *obj) evas_object_image_has_opaque_rect(Evas_Object *obj)
{ {
Evas_Object_Image *o; Evas_Object_Image *o;
o = (Evas_Object_Image *)(obj->object_data); o = (Evas_Object_Image *)(obj->object_data);
if ((obj->cur.map) && (obj->cur.usemap)) return 0; if ((obj->cur.map) && (obj->cur.usemap)) return 0;
if (((o->cur.border.l | o->cur.border.r | o->cur.border.t | o->cur.borde r.b) != 0) && if (((o->cur.border.l | o->cur.border.r | o->cur.border.t | o->cur.borde r.b) != 0) &&
 End of changes. 33 change blocks. 
134 lines changed or deleted 138 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/