From bfd91eb67f254c684cad337b50c4cb316c695cc1 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sun, 20 Dec 2009 06:23:13 +0000 Subject: [PATCH] remove excess tex update on dirty. some formattign and naming too. SVN revision: 44592 --- legacy/evas/src/lib/cache/evas_cache_image.c | 54 +++++++++---------- .../engines/gl_common/evas_gl_common.h | 2 +- .../modules/engines/gl_common/evas_gl_image.c | 11 ++-- .../engines/gl_common/evas_gl_texture.c | 1 + .../src/modules/engines/gl_x11/evas_engine.c | 10 ++-- 5 files changed, 41 insertions(+), 37 deletions(-) diff --git a/legacy/evas/src/lib/cache/evas_cache_image.c b/legacy/evas/src/lib/cache/evas_cache_image.c index 5afe0d74db..883c7e01de 100644 --- a/legacy/evas/src/lib/cache/evas_cache_image.c +++ b/legacy/evas/src/lib/cache/evas_cache_image.c @@ -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)); - 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; } @@ -1164,18 +1165,17 @@ evas_cache_image_preload_data(Image_Entry *im, const void *target) 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 } @@ -1183,7 +1183,7 @@ EAPI void 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); @@ -1193,7 +1193,7 @@ evas_cache_image_preload_cancel(Image_Entry *im, const void *target) _evas_cache_image_entry_preload_remove(im, target); #else - (void) im; + (void)im; #endif } @@ -1202,20 +1202,19 @@ evas_cache_image_flush(Evas_Cache_Image *cache) { 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); @@ -1231,14 +1230,13 @@ evas_cache_image_flush(Evas_Cache_Image *cache) EAPI Image_Entry * 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); - if (!new) return NULL; + im = _evas_cache_image_entry_new(cache, NULL, 0, NULL, NULL, NULL, NULL); + if (!im) return NULL; - new->references = 1; - - return new; + im->references = 1; + return im; } EAPI void @@ -1251,7 +1249,7 @@ evas_cache_image_colorspace(Image_Entry *im, int cspace) cache = im->cache; - if (im->space == cspace) return ; + if (im->space == cspace) return; im->space = cspace; cache->func.color_space(im, cspace); diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h b/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h index f8f777752f..b497fa99cd 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h @@ -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); 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); diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c index 13c23417e2..05d9ffbbb4 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c @@ -208,11 +208,16 @@ 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) +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; } @@ -249,10 +254,10 @@ _evas_gl_common_image_update(Evas_GL_Context *gc, Evas_GL_Image *im) 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: diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c index 61a9dbfab7..65225365da 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c @@ -334,6 +334,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im) glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); #endif glPixelStorei(GL_UNPACK_ALIGNMENT, 4); + // +-+ // +-+ // diff --git a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c index b4d4b0142c..0bda2a1afb 100644 --- a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c +++ b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c @@ -685,7 +685,7 @@ eng_image_alpha_set(void *data, void *image, int has_alpha) 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; } @@ -876,14 +876,14 @@ eng_image_size_set(void *data, void *image, int w, int h) } 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; } @@ -923,7 +923,7 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data) 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; @@ -981,7 +981,7 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data) 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; }