actually use cache in 32bpp/24bpp

SVN revision: 9671
This commit is contained in:
Carsten Haitzler 2004-04-10 02:26:37 +00:00
parent 7404d31433
commit 47df5c8909
1 changed files with 10 additions and 4 deletions

View File

@ -174,12 +174,18 @@ __imlib_ProduceXImage(Display * d, Visual * v, int depth, int w, int h,
/* go thru the current image list */ /* go thru the current image list */
for (i = 0; i < list_num; i++) for (i = 0; i < list_num; i++)
{ {
int depth_ok = 0;
/* if the image has the same depth, width and height - recycle it */ /* if the image has the same depth, width and height - recycle it */
/* as long as its not used */ /* as long as its not used */
if ((list_xim[i]->bits_per_pixel == depth) && if ( (list_xim[i]->bits_per_pixel == depth) ||
(list_xim[i]->width >= w) && (list_xim[i]->height >= h) && ((list_xim[i]->bits_per_pixel == 32) && (depth == 24)) )
/* (list_d[i] == d) && */ depth_ok = 1;
(!list_used[i])) if ( depth_ok &&
(list_xim[i]->width >= w) &&
(list_xim[i]->height >= h) &&
/* (list_d[i] == d) && */
(!list_used[i]))
{ {
/* mark it as used */ /* mark it as used */
list_used[i] = 1; list_used[i] = 1;