equal
deleted
inserted
replaced
167 if (regBmp->DataSize() <= iCacheLimit) |
167 if (regBmp->DataSize() <= iCacheLimit) |
168 { |
168 { |
169 iRecentBmps.AddFirst(*regBmp); |
169 iRecentBmps.AddFirst(*regBmp); |
170 iTotalRecentBmpSize += regBmp->DataSize(); |
170 iTotalRecentBmpSize += regBmp->DataSize(); |
171 } |
171 } |
|
172 else |
|
173 { |
|
174 delete regBmp; // deleting the registered bitmap in a case when raster bitmap size is bigger than cache |
|
175 } |
|
176 |
172 // Delete the least recently used bitmaps if the maximum size of the cache is exceeded |
177 // Delete the least recently used bitmaps if the maximum size of the cache is exceeded |
173 while (iTotalRecentBmpSize > iCacheLimit) |
178 while (iTotalRecentBmpSize > iCacheLimit) |
174 { |
179 { |
175 regBmp = iRecentBmps.Last(); |
180 regBmp = iRecentBmps.Last(); |
176 iTotalRecentBmpSize -= regBmp->DataSize(); |
181 iTotalRecentBmpSize -= regBmp->DataSize(); |