ie->targets = (Evas_Cache_Target*) eina_inlist_append(EINA_INLIST_GET(ie->targets), EINA_INLIST_GET(tg));
- if (!ie->preload) {
- ie->cache->preload = eina_list_append(ie->cache->preload, ie);
- ie->flags.pending = 0;
-
- ie->preload = evas_preload_thread_run(_evas_cache_image_async_heavy,
- _evas_cache_image_async_end,
- _evas_cache_image_async_cancel,
- ie);
- }
+ if (!ie->preload)
+ {
+ ie->cache->preload = eina_list_append(ie->cache->preload, ie);
+ ie->flags.pending = 0;
+
+ ie->preload = evas_preload_thread_run(_evas_cache_image_async_heavy,
+ _evas_cache_image_async_end,
+ _evas_cache_image_async_cancel,
+ ie);
+ }
return 1;
}
if (im->flags.loaded)
{
- evas_object_inform_call_image_preloaded((Evas_Object*) target);
- return ;
+ evas_object_inform_call_image_preloaded((Evas_Object *)target);
+ return;
}
cache = im->cache;
if (!_evas_cache_image_entry_preload_add(im, target))
- evas_object_inform_call_image_preloaded((Evas_Object*) target);
+ evas_object_inform_call_image_preloaded((Evas_Object *)target);
#else
evas_cache_image_load_data(im);
-
- evas_object_inform_call_image_preloaded((Evas_Object*) target);
+ evas_object_inform_call_image_preloaded((Evas_Object *)target);
#endif
}
evas_cache_image_preload_cancel(Image_Entry *im, const void *target)
{
#ifdef BUILD_ASYNC_PRELOAD
- Evas_Cache_Image *cache;
+ Evas_Cache_Image *cache;
assert(im);
assert(im->cache);
_evas_cache_image_entry_preload_remove(im, target);
#else
- (void) im;
+ (void)im;
#endif
}
{
assert(cache);
- if (cache->limit == -1)
- return -1;
+ if (cache->limit == -1) return -1;
while ((cache->lru) && (cache->limit < cache->usage))
{
- Image_Entry *im;
+ Image_Entry *im;
- im = (Image_Entry *) cache->lru->last;
+ im = (Image_Entry *)cache->lru->last;
_evas_cache_image_entry_delete(cache, im);
}
while ((cache->lru_nodata) && (cache->limit < cache->usage))
{
- Image_Entry *im;
+ Image_Entry *im;
im = (Image_Entry *) cache->lru_nodata->last;
_evas_cache_image_remove_lru_nodata(cache, im);
EAPI Image_Entry *
evas_cache_image_empty(Evas_Cache_Image *cache)
{
- Image_Entry *new;
-
- new = _evas_cache_image_entry_new(cache, NULL, 0, NULL, NULL, NULL, NULL);
- if (!new) return NULL;
+ Image_Entry *im;
- new->references = 1;
+ im = _evas_cache_image_entry_new(cache, NULL, 0, NULL, NULL, NULL, NULL);
+ if (!im) return NULL;
- return new;
+ im->references = 1;
+ return im;
}
EAPI void
cache = im->cache;
- if (im->space == cspace) return ;
+ if (im->space == cspace) return;
im->space = cspace;
cache->func.color_space(im, cspace);
Evas_GL_Image *evas_gl_common_image_new(Evas_GL_Context *gc, int w, int h, int alpha, int cspace);
void evas_gl_common_image_free(Evas_GL_Image *im);
Evas_GL_Image *evas_gl_common_image_surface_new(Evas_GL_Context *gc, int w, int h, int alpha);
-void evas_gl_common_image_dirty(Evas_GL_Image *im);
+void evas_gl_common_image_dirty(Evas_GL_Image *im, int x, int y, int w, int h);
void evas_gl_common_image_map4_draw(Evas_GL_Context *gc, Evas_GL_Image *im, RGBA_Map_Point *p, int smooth, int level);
void evas_gl_common_image_draw(Evas_GL_Context *gc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
}
void
-evas_gl_common_image_dirty(Evas_GL_Image *im)
+evas_gl_common_image_dirty(Evas_GL_Image *im, int x, int y, int w, int h)
{
+ if ((w == 0) && (h == 0) && (x == 0) && (y == 0))
+ {
+ w = im->w;
+ h = im->h;
+ }
if (im->im)
{
- im->im = (RGBA_Image *) evas_cache_image_dirty(&im->im->cache_entry, 0, 0, im->im->cache_entry.w, im->im->cache_entry.h);
+ im->im = (RGBA_Image *)evas_cache_image_dirty(&im->im->cache_entry, x, y, w, h);
}
im->dirty = 1;
}
if ((im->tex) && (im->dirty))
{
evas_gl_common_texture_update(im->tex, im->im);
- im->dirty = 0;
}
if (!im->tex)
im->tex = evas_gl_common_texture_new(gc, im->im);
+ im->dirty = 0;
if (!im->tex) return;
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
#endif
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+
// +-+
// +-+
//
im = im_new;
}
else
- evas_gl_common_image_dirty(im);
+ evas_gl_common_image_dirty(im, 0, 0, 0, 0);
im->im->cache_entry.flags.alpha = has_alpha ? 1 : 0;
return image;
}
}
static void *
-eng_image_dirty_region(void *data, void *image, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
+eng_image_dirty_region(void *data, void *image, int x, int y, int w, int h)
{
Render_Engine *re;
re = (Render_Engine *)data;
if (!image) return NULL;
eng_window_use(re->win);
- evas_gl_common_image_dirty(image);
+ evas_gl_common_image_dirty(image, x, y, w, h);
return image;
}
im = im_new;
}
else
- evas_gl_common_image_dirty(im);
+ evas_gl_common_image_dirty(im, 0, 0, 0, 0);
}
*image_data = im->im->image.data;
break;
break;
}
/* hmmm - but if we wrote... why bother? */
- evas_gl_common_image_dirty(im);
+ evas_gl_common_image_dirty(im, 0, 0, 0, 0);
return im;
}