EAPI Image_Entry* evas_cache_image_alone(Image_Entry *im);
EAPI Image_Entry* evas_cache_image_dirty(Image_Entry *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
-EAPI void evas_cache_image_load_data(Image_Entry *im);
+EAPI int evas_cache_image_load_data(Image_Entry *im);
EAPI void evas_cache_image_unload_data(Image_Entry *im);
EAPI Eina_Bool evas_cache_image_is_loaded(Image_Entry *im);
EAPI void evas_cache_image_unload_all(Evas_Cache_Image *cache);
{
error = cache->func.load(current);
if (cache->func.debug) cache->func.debug("load", current);
+ current->load_error = error;
if (error != EVAS_LOAD_ERROR_NONE)
{
current->flags.loaded = 0;
_evas_cache_image_entry_surface_alloc(cache, current,
current->w, current->h);
}
- else current->flags.loaded = 1;
+ else
+ {
+ current->flags.loaded = 1;
+ }
}
current->channel = pchannel;
// check the unload cancel flag
return NULL;
}
-EAPI void
+EAPI int
evas_cache_image_load_data(Image_Entry *im)
{
#ifdef BUILD_ASYNC_PRELOAD
Eina_Bool preload = EINA_FALSE;
#endif
- int error;
+ int error = EVAS_LOAD_ERROR_NONE;
- if (im->flags.loaded) return;
+ if (im->flags.loaded) return error;
#ifdef BUILD_ASYNC_PRELOAD
if (im->preload)
{
LKU(wakeup);
}
- if (im->flags.loaded) return;
+ if (im->flags.loaded) return error;
LKL(im->lock);
#endif
im->flags.in_progress = EINA_TRUE;
#ifdef BUILD_ASYNC_PRELOAD
if (preload) _evas_cache_image_async_end(im);
#endif
+ return error;
}
EAPI void
o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
o->engine_data,
0,
- &data);
+ &data,
+ &o->load_error);
return evas_object_image_data_convert_internal(o, data, to_cspace);
}
o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
o->engine_data,
for_writing,
- &data);
+ &data,
+ &o->load_error);
if (o->engine_data)
{
int stride = 0;
o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
o->engine_data,
0,
- &data);
+ &data,
+ &o->load_error);
if (flags)
{
char *p, *pp;
obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
o->engine_data,
1,
- &image_pixels);
+ &image_pixels,
+ &o->load_error);
/* FIXME: need to actualyl support this */
/* memcpy(image_pixels, pixels->rows, o->cur.image.w * o->cur.image.h * 4);*/
if (o->engine_data)
obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
o->engine_data,
1,
- &image_pixels);
+ &image_pixels,
+ &o->load_error);
if (image_pixels)
evas_common_convert_yuv_420p_601_rgba((DATA8 **) pixels->rows,
(DATA8 *) image_pixels,
(obj->layer->evas->engine.data.output,
o->engine_data,
0,
- &data);
+ &data,
+ &o->load_error);
if (!data)
return 0;
o->preloading = preloading;
}
+void
+_evas_object_image_preloading_check(Evas_Object *obj)
+{
+ Evas_Object_Image *o = (Evas_Object_Image *)(obj->object_data);
+ if (obj->layer->evas->engine.func->image_load_error_get)
+ o->load_error = obj->layer->evas->engine.func->image_load_error_get
+ (obj->layer->evas->engine.data.output, o->engine_data);
+}
+
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
evas_object_inform_call_image_preloaded(Evas_Object *obj)
{
if (!_evas_object_image_preloading_get(obj)) return;
+ _evas_object_image_preloading_check(obj);
_evas_object_image_preloading_set(obj, 0);
_evas_object_event_new();
int server_id;
int connect_num;
int channel;
+ int load_error;
};
struct _Engine_Image_Entry
void *(*image_size_set) (void *data, void *image, int w, int h);
void (*image_stride_get) (void *data, void *image, int *stride);
void *(*image_dirty_region) (void *data, void *image, int x, int y, int w, int h);
- void *(*image_data_get) (void *data, void *image, int to_write, DATA32 **image_data);
+ void *(*image_data_get) (void *data, void *image, int to_write, DATA32 **image_data, int *err);
void *(*image_data_put) (void *data, void *image, DATA32 *image_data);
void (*image_data_preload_request) (void *data, void *image, const void *target);
void (*image_data_preload_cancel) (void *data, void *image, const void *target);
void *(*gl_proc_address_get) (void *data, const char *name);
int (*gl_native_surface_get) (void *data, void *surface, void *native_surface);
void *(*gl_api_get) (void *data);
+ int (*image_load_error_get) (void *data, void *image);
};
struct _Evas_Image_Load_Func
Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj);
void _evas_object_image_preloading_set(Evas_Object *obj, Eina_Bool preloading);
+void _evas_object_image_preloading_check(Evas_Object *obj);
void evas_object_smart_del(Evas_Object *obj);
void evas_object_smart_cleanup(Evas_Object *obj);
void evas_object_smart_member_raise(Evas_Object *member);
}
static void *
-eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
+eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, int *err)
{
Render_Engine *re = (Render_Engine *)data;
evas_direct3d_image_data_get(re->d3d, image, to_write, image_data);
+ if (err) *err = EVAS_LOAD_ERROR_NONE;
return image;
}
}
static void *
-eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
+eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, int *err)
{
Render_Engine *re;
Evas_GL_Image *im;
-
+ int error;
+
re = (Render_Engine *)data;
if (!image)
{
*image_data = NULL;
+ if (err) *err = EVAS_LOAD_ERROR_GENERIC;
return NULL;
}
im = image;
if (im->native.data)
{
*image_data = NULL;
+ if (err) *err = EVAS_LOAD_ERROR_NONE;
return im;
}
- evas_cache_image_load_data(&im->im->cache_entry);
+ error = evas_cache_image_load_data(&im->im->cache_entry);
switch (im->cs.space)
{
case EVAS_COLORSPACE_ARGB8888:
if (!im_new)
{
*image_data = NULL;
- return im;
+ if (err) *err = error;
+ return im;
}
evas_gl_common_image_free(im);
im = im_new;
abort();
break;
}
+ if (err) *err = error;
return im;
}
}
static int
+eng_image_load_error_get(void *data __UNUSED__, void *image)
+{
+ Evas_GL_Image *im;
+
+ if (!image) return EVAS_LOAD_ERROR_NONE;
+ im = image;
+ return im->im->cache_entry.load_error;
+}
+
+
+static int
module_open(Evas_Module *em)
{
if (!em) return 0;
ORD(image_colorspace_get);
ORD(image_native_set);
ORD(image_native_get);
+// ORD(image_draw_filtered);
+// ORD(image_filtered_get);
+// ORD(image_filtered_save);
+// ORD(image_filtered_free);
ORD(font_draw);
ORD(image_scale_hint_set);
ORD(image_map_draw);
ORD(image_map_surface_new);
ORD(image_map_surface_free);
+
+// ORD(image_content_hint_set);
+// ORD(image_content_hint_get);
+
+// ORD(image_cache_flush);
+// ORD(image_cache_set);
+// ORD(image_cache_get);
+
+// ORD(gl_surface_create);
+// ORD(gl_surface_destroy);
+// ORD(gl_context_create);
+// ORD(gl_context_destroy);
+// ORD(gl_make_current);
+// ORD(gl_proc_address_get);
+// ORD(gl_native_surface_get);
+
+// ORD(gl_api_get);
+
+ ORD(image_load_error_get);
/* now advertise out own api */
em->functions = (void *)(&func);
}
static void *
-eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
+eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, int *err)
{
Render_Engine *re;
Evas_GL_Image *im;
+ int error;
re = (Render_Engine *)data;
if (!image)
{
*image_data = NULL;
+ if (err) *err = EVAS_LOAD_ERROR_GENERIC;
return NULL;
}
im = image;
if (im->native.data)
{
*image_data = NULL;
+ if (err) *err = EVAS_LOAD_ERROR_NONE;
return im;
}
if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.data))
{
*image_data = im->tex->pt->dyn.data;
+ if (err) *err = EVAS_LOAD_ERROR_NONE;
return im;
}
eng_window_use(re->win);
- evas_cache_image_load_data(&im->im->cache_entry);
+ error = evas_cache_image_load_data(&im->im->cache_entry);
switch (im->cs.space)
{
case EVAS_COLORSPACE_ARGB8888:
if (!im_new)
{
*image_data = NULL;
+ if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
return im;
}
evas_gl_common_image_free(im);
abort();
break;
}
+ if (err) *err = error;
return im;
}
Render_Engine *re;
Render_Engine_GL_Surface *sfc;
Render_Engine_GL_Context *ctx;
- int ret;
+ int ret = 0;
re = (Render_Engine *)data;
sfc = (Render_Engine_GL_Surface*)surface;
return &gl_funcs;
}
+static int
+eng_image_load_error_get(void *data __UNUSED__, void *image)
+{
+ Evas_GL_Image *im;
+
+ if (!image) return EVAS_LOAD_ERROR_NONE;
+ im = image;
+ return im->im->cache_entry.load_error;
+}
static int
module_open(Evas_Module *em)
ORD(gl_api_get);
+ ORD(image_load_error_get);
+
/* now advertise out own api */
em->functions = (void *)(&func);
return 1;
}
static void *
-eng_image_data_get(void *data __UNUSED__, void *image, int to_write, DATA32 **image_data)
+eng_image_data_get(void *data __UNUSED__, void *image, int to_write, DATA32 **image_data, int *err)
{
Soft16_Image *im;
+ int error;
if (!image)
{
}
im = image;
- evas_cache_image_load_data(&im->cache_entry);
+ error = evas_cache_image_load_data(&im->cache_entry);
if (to_write)
im = (Soft16_Image *) evas_cache_image_alone(&im->cache_entry);
if (image_data) *image_data = (DATA32 *) im->pixels;
+ if (err) *err = error;
return im;
}
static void*
evas_engine_sdl16_image_data_get(void *data __UNUSED__, void *image,
- int to_write, DATA32** image_data)
+ int to_write, DATA32** image_data, int *err)
{
SDL_Engine_Image_Entry *eim = image;
Soft16_Image *im;
-
+ int error;
+
if (!eim)
{
*image_data = NULL;
return NULL;
}
im = (Soft16_Image *) eim->cache_entry.src;
- evas_cache_image_load_data(&im->cache_entry);
+ error = evas_cache_image_load_data(&im->cache_entry);
if (to_write)
eim = (SDL_Engine_Image_Entry *) evas_cache_engine_image_alone(&eim->cache_entry,
/* FIXME: Handle colorspace conversion correctly. */
if (image_data) *image_data = (DATA32 *) im->pixels;
+ if (err) *err = error;
return eim;
}
static void *
eng_image_data_get(void *data __UNUSED__, void *image, int to_write,
- DATA32 ** image_data)
+ DATA32 ** image_data, int *err)
{
Soft8_Image *im;
+ int error;
if (!image)
{
}
im = image;
- evas_cache_image_load_data(&im->cache_entry);
+ error = evas_cache_image_load_data(&im->cache_entry);
if (to_write)
im = (Soft8_Image *) evas_cache_image_alone(&im->cache_entry);
if (image_data)
*image_data = (DATA32 *) im->pixels;
+ if (err) *err = error;
return im;
}
if (!im->image.data)
evas_cache_image_load_data(&im->cache_entry);
src = im->image.data;
+ if (!src) return;
for (end = dst + sz ; dst < end ; dst ++, src ++)
*dst = *src >> 24;
im->mask.dirty = 0;
}
static void *
-eng_image_data_get(void *data __UNUSED__, void *image, int to_write, DATA32 **image_data)
+eng_image_data_get(void *data __UNUSED__, void *image, int to_write, DATA32 **image_data, int *err)
{
RGBA_Image *im;
+ int error;
if (!image)
{
return NULL;
}
im = image;
- evas_cache_image_load_data(&im->cache_entry);
+ error = evas_cache_image_load_data(&im->cache_entry);
switch (im->cache_entry.space)
{
case EVAS_COLORSPACE_ARGB8888:
if (to_write)
- im = (RGBA_Image *) evas_cache_image_alone(&im->cache_entry);
+ im = (RGBA_Image *)evas_cache_image_alone(&im->cache_entry);
*image_data = im->image.data;
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
abort();
break;
}
+ if (err) *err = error;
return im;
}
if (!fn) return;
if (im->cache_entry.cache) evas_cache_image_load_data(&im->cache_entry);
fn(filter, image, surface);
-
return;
}
im->filtered = eina_list_remove(im->filtered, fi);
}
+static int
+eng_image_load_error_get(void *data, void *image)
+{
+ RGBA_Image *im;
+
+ if (!image) return EVAS_LOAD_ERROR_NONE;
+ im = image;
+ return im->cache_entry.load_error;
+}
+
/*
*****
**
NULL, // FIXME: need software mesa for gl rendering <- gl_context_destroy
NULL, // FIXME: need software mesa for gl rendering <- gl_make_current
NULL, // FIXME: need software mesa for gl rendering <- gl_proc_address_get
- NULL, // FIXME: need software mesa for gl rendering <- gl_native_surface_get
- NULL // FIXME: need software mesa for gl rendering <- gl_api_get
+ NULL, // FIXME: need software mesa for gl rendering <- gl_native_surface_get
+ NULL, // FIXME: need software mesa for gl rendering <- gl_api_get
+ eng_image_load_error_get
/* FUTURE software generic calls go here */
};
static void*
evas_engine_sdl_image_data_get(void *data, void *image,
- int to_write, DATA32** image_data)
+ int to_write, DATA32** image_data, int *err)
{
SDL_Engine_Image_Entry *eim = image;
RGBA_Image *im;
if (!eim)
{
*image_data = NULL;
+ if (err) *err = EVAS_LOAD_ERROR_GENERIC;
return NULL;
}
im = (RGBA_Image *) eim->cache_entry.src;
abort();
break;
}
+ if (err) *err = EVAS_LOAD_ERROR_NONE;
return eim;
}