summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/evas_gl_image.c
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2018-08-30 13:26:06 +0900
committerHermet Park <hermetpark@gmail.com>2018-08-30 13:26:06 +0900
commit54f2a554dab13890ee9daf7b332442c79f58c6a0 (patch)
tree2d0ac2c917affcc07e969595cdca8251a8eef0cb /src/modules/evas/engines/gl_common/evas_gl_image.c
parentad9e13ea5657c845491cad7ba627dd93717c7d1b (diff)
evas cache: refactor internal logic.
Summary: Adding cache targets in other modules are inproper. This can't be managed by cache module inside. One representive scenario is, when preload cancel is triggered, preload canceling sequence can't be performed properly because cache targets implicitly were increased by backend modules. And then, Cache itself couldn't get notified it. see this condition. if ((!ie->targets) && (ie->preload) && (!ie->flags.pending)) in _evas_cache_image_entry_preload_remove() Consequently, I move preloaded callbacks to sync with adding cache targets, not to add by backed engines themselves. This will bring Cache to manage cache targets properly. Reviewers: #committers, raster Subscribers: cedric, #reviewers, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6912
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 2716f58387..22cce55ab8 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -150,8 +150,8 @@ _evas_gl_cspace_list_fill(Evas_Engine_GL_Context *gc)
150 CS_APPEND(EVAS_COLORSPACE_ARGB8888); 150 CS_APPEND(EVAS_COLORSPACE_ARGB8888);
151} 151}
152 152
153static void 153void
154preload_done(void *data) 154evas_gl_common_image_preload_done(void *data)
155{ 155{
156 Evas_GL_Image *im = data; 156 Evas_GL_Image *im = data;
157 157
@@ -192,26 +192,9 @@ found_cspace:
192 im->w = im->im->cache_entry.w; 192 im->w = im->im->cache_entry.w;
193 im->h = im->im->cache_entry.h; 193 im->h = im->im->cache_entry.h;
194 } 194 }
195 evas_gl_common_image_preload_unwatch(im);
196}
197
198void
199evas_gl_common_image_preload_watch(Evas_GL_Image *im)
200{
201 Evas_Cache_Target *tg;
202
203 if (!im->im) return;
204 tg = calloc(1, sizeof(Evas_Cache_Target));
205 if (tg)
206 {
207 tg->preloaded_cb = preload_done;
208 tg->preloaded_data = im;
209 im->im->cache_entry.targets = (Evas_Cache_Target *)
210 eina_inlist_append(EINA_INLIST_GET(im->im->cache_entry.targets),
211 EINA_INLIST_GET(tg));
212 }
213} 195}
214 196
197//FIXME: This is a hacky way. Need an proper interface...
215void 198void
216evas_gl_common_image_preload_unwatch(Evas_GL_Image *im) 199evas_gl_common_image_preload_unwatch(Evas_GL_Image *im)
217{ 200{
@@ -221,7 +204,7 @@ evas_gl_common_image_preload_unwatch(Evas_GL_Image *im)
221 if (!im->im) return; 204 if (!im->im) return;
222 EINA_INLIST_FOREACH_SAFE(im->im->cache_entry.targets, l2, tg) 205 EINA_INLIST_FOREACH_SAFE(im->im->cache_entry.targets, l2, tg)
223 { 206 {
224 if ((tg->preloaded_cb != preload_done) || (tg->preloaded_data != im)) 207 if ((tg->preloaded_cb != evas_gl_common_image_preload_done) || (tg->preloaded_data != im))
225 continue; 208 continue;
226 tg->delete_me = EINA_TRUE; 209 tg->delete_me = EINA_TRUE;
227 break; 210 break;