oh dear - when i added load opts - i broke speculative caching. fixed!

SVN revision: 28531
This commit is contained in:
Carsten Haitzler 2007-03-02 22:09:18 +00:00
parent 8420b86942
commit 635e741438
1 changed files with 25 additions and 0 deletions

View File

@ -472,8 +472,10 @@ evas_common_image_unstore(RGBA_Image *im)
EAPI RGBA_Image *
evas_common_image_find(const char *file, const char *key, DATA64 timestamp, RGBA_Image_Loadopts *lo)
{
RGBA_Image_Loadopts *lo2;
RGBA_Image *im;
char buf[4096 + 1024];
Evas_Object_List *l;
if ((!file) && (!key)) return NULL;
if (!file) return NULL;
@ -497,6 +499,29 @@ evas_common_image_find(const char *file, const char *key, DATA64 timestamp, RGBA
}
im = evas_hash_find(images, buf);
if (im) return im;
for (l = cache; l; l = l->next)
{
int ok;
im = (RGBA_Image *)l;
ok = 0;
lo2 = &(im->load_opts);
if ((file) && (im->info.file) &&
(!strcmp(file, im->info.file)))
ok++;
else if ((!file) && (!im->info.file))
ok++;
if ((key) && (im->info.key) &&
(!strcmp(key, im->info.key)))
ok++;
else if ((!key) && (!im->info.key))
ok++;
if ((lo->scale_down_by == lo2->scale_down_by) &&
(lo->dpi == lo2->dpi) && (lo->w == lo2->w) &&
(lo->h == lo2->h))
ok++;
if (ok >= 3) return im;
}
/*
for (l = cache; l; l = l->next)
{