remove excess tex update on dirty. some formattign and naming too.

SVN revision: 44592
This commit is contained in:
Carsten Haitzler 2009-12-20 06:23:13 +00:00
parent 5cffd43943
commit bfd91eb67f
5 changed files with 41 additions and 37 deletions

View File

@ -419,15 +419,16 @@ _evas_cache_image_entry_preload_add(Image_Entry *ie,
ie->targets = (Evas_Cache_Target*) eina_inlist_append(EINA_INLIST_GET(ie->targets), EINA_INLIST_GET(tg)); ie->targets = (Evas_Cache_Target*) eina_inlist_append(EINA_INLIST_GET(ie->targets), EINA_INLIST_GET(tg));
if (!ie->preload) { if (!ie->preload)
ie->cache->preload = eina_list_append(ie->cache->preload, ie); {
ie->flags.pending = 0; 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, ie->preload = evas_preload_thread_run(_evas_cache_image_async_heavy,
_evas_cache_image_async_cancel, _evas_cache_image_async_end,
ie); _evas_cache_image_async_cancel,
} ie);
}
return 1; return 1;
} }
@ -1164,18 +1165,17 @@ evas_cache_image_preload_data(Image_Entry *im, const void *target)
if (im->flags.loaded) if (im->flags.loaded)
{ {
evas_object_inform_call_image_preloaded((Evas_Object*) target); evas_object_inform_call_image_preloaded((Evas_Object *)target);
return ; return;
} }
cache = im->cache; cache = im->cache;
if (!_evas_cache_image_entry_preload_add(im, target)) 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 #else
evas_cache_image_load_data(im); 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 #endif
} }
@ -1183,7 +1183,7 @@ EAPI void
evas_cache_image_preload_cancel(Image_Entry *im, const void *target) evas_cache_image_preload_cancel(Image_Entry *im, const void *target)
{ {
#ifdef BUILD_ASYNC_PRELOAD #ifdef BUILD_ASYNC_PRELOAD
Evas_Cache_Image *cache; Evas_Cache_Image *cache;
assert(im); assert(im);
assert(im->cache); assert(im->cache);
@ -1193,7 +1193,7 @@ evas_cache_image_preload_cancel(Image_Entry *im, const void *target)
_evas_cache_image_entry_preload_remove(im, target); _evas_cache_image_entry_preload_remove(im, target);
#else #else
(void) im; (void)im;
#endif #endif
} }
@ -1202,20 +1202,19 @@ evas_cache_image_flush(Evas_Cache_Image *cache)
{ {
assert(cache); assert(cache);
if (cache->limit == -1) if (cache->limit == -1) return -1;
return -1;
while ((cache->lru) && (cache->limit < cache->usage)) 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); _evas_cache_image_entry_delete(cache, im);
} }
while ((cache->lru_nodata) && (cache->limit < cache->usage)) while ((cache->lru_nodata) && (cache->limit < cache->usage))
{ {
Image_Entry *im; Image_Entry *im;
im = (Image_Entry *) cache->lru_nodata->last; im = (Image_Entry *) cache->lru_nodata->last;
_evas_cache_image_remove_lru_nodata(cache, im); _evas_cache_image_remove_lru_nodata(cache, im);
@ -1231,14 +1230,13 @@ evas_cache_image_flush(Evas_Cache_Image *cache)
EAPI Image_Entry * EAPI Image_Entry *
evas_cache_image_empty(Evas_Cache_Image *cache) evas_cache_image_empty(Evas_Cache_Image *cache)
{ {
Image_Entry *new; Image_Entry *im;
new = _evas_cache_image_entry_new(cache, NULL, 0, NULL, NULL, NULL, NULL); im = _evas_cache_image_entry_new(cache, NULL, 0, NULL, NULL, NULL, NULL);
if (!new) return NULL; if (!im) return NULL;
new->references = 1; im->references = 1;
return im;
return new;
} }
EAPI void EAPI void
@ -1251,7 +1249,7 @@ evas_cache_image_colorspace(Image_Entry *im, int cspace)
cache = im->cache; cache = im->cache;
if (im->space == cspace) return ; if (im->space == cspace) return;
im->space = cspace; im->space = cspace;
cache->func.color_space(im, cspace); cache->func.color_space(im, cspace);

View File

@ -289,7 +289,7 @@ Evas_GL_Image *evas_gl_common_image_new_from_copied_data(Evas_GL_Context *gc,
Evas_GL_Image *evas_gl_common_image_new(Evas_GL_Context *gc, int w, int h, int alpha, int 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); 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); 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_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_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);

View File

@ -208,11 +208,16 @@ evas_gl_common_image_surface_new(Evas_GL_Context *gc, int w, int h, int alpha)
} }
void 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) 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; im->dirty = 1;
} }
@ -249,10 +254,10 @@ _evas_gl_common_image_update(Evas_GL_Context *gc, Evas_GL_Image *im)
if ((im->tex) && (im->dirty)) if ((im->tex) && (im->dirty))
{ {
evas_gl_common_texture_update(im->tex, im->im); evas_gl_common_texture_update(im->tex, im->im);
im->dirty = 0;
} }
if (!im->tex) if (!im->tex)
im->tex = evas_gl_common_texture_new(gc, im->im); im->tex = evas_gl_common_texture_new(gc, im->im);
im->dirty = 0;
if (!im->tex) return; if (!im->tex) return;
break; break;
case EVAS_COLORSPACE_YCBCR422P601_PL: case EVAS_COLORSPACE_YCBCR422P601_PL:

View File

@ -334,6 +334,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
#endif #endif
glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
// +-+ // +-+
// +-+ // +-+
// //

View File

@ -685,7 +685,7 @@ eng_image_alpha_set(void *data, void *image, int has_alpha)
im = im_new; im = im_new;
} }
else 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; im->im->cache_entry.flags.alpha = has_alpha ? 1 : 0;
return image; return image;
} }
@ -876,14 +876,14 @@ eng_image_size_set(void *data, void *image, int w, int h)
} }
static void * 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; Render_Engine *re;
re = (Render_Engine *)data; re = (Render_Engine *)data;
if (!image) return NULL; if (!image) return NULL;
eng_window_use(re->win); eng_window_use(re->win);
evas_gl_common_image_dirty(image); evas_gl_common_image_dirty(image, x, y, w, h);
return image; return image;
} }
@ -923,7 +923,7 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
im = im_new; im = im_new;
} }
else else
evas_gl_common_image_dirty(im); evas_gl_common_image_dirty(im, 0, 0, 0, 0);
} }
*image_data = im->im->image.data; *image_data = im->im->image.data;
break; break;
@ -981,7 +981,7 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data)
break; break;
} }
/* hmmm - but if we wrote... why bother? */ /* 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; return im;
} }