Chromium Code Reviews| Index: ui/app_list/icon_cache.cc |
| diff --git a/ui/app_list/icon_cache.cc b/ui/app_list/icon_cache.cc |
| index b0b9997e6aebc9113232521827a3a0c956fc6e43..b684b88aad5f25e7b89fd3161f18d64374e65f90 100644 |
| --- a/ui/app_list/icon_cache.cc |
| +++ b/ui/app_list/icon_cache.cc |
| @@ -11,10 +11,11 @@ |
| namespace { |
| // Gets cache key based on |image| contents and desired |size|. |
| -std::string GetKey(const SkBitmap& image, const gfx::Size& size) { |
| - SkAutoLockPixels image_lock(image); |
| +std::string GetKey(const gfx::ImageSkia& image, const gfx::Size& size) { |
| + const SkBitmap* bitmap = image.bitmap(); |
|
oshima
2012/07/10 23:51:06
ImageSkia::bitmap is obsolete. You probably should
pkotwicz
2012/07/11 00:12:44
image_reps()[0] does the same thing as bitmap()
xiyuan
2012/07/11 17:39:13
The bitmap here is used to generate a MD5 hash so
oshima
2012/07/11 18:08:41
My point was that in current implementation, there
xiyuan
2012/07/11 21:40:40
Done. Changed to use scale factor to find bitmap t
|
| + SkAutoLockPixels image_lock(*bitmap); |
| base::MD5Digest digest; |
| - MD5Sum(image.getPixels(), image.getSize(), &digest); |
| + MD5Sum(bitmap->getPixels(), bitmap->getSize(), &digest); |
| return MD5DigestToBase16(digest) + "." + size.ToString(); |
| } |
| @@ -59,9 +60,9 @@ void IconCache::PurgeAllUnused() { |
| } |
| } |
| -bool IconCache::Get(const SkBitmap& src, |
| +bool IconCache::Get(const gfx::ImageSkia& src, |
| const gfx::Size& size, |
| - SkBitmap* processed) { |
| + gfx::ImageSkia* processed) { |
| Cache::iterator it = cache_.find(GetKey(src, size)); |
| if (it == cache_.end()) |
| return false; |
| @@ -73,9 +74,9 @@ bool IconCache::Get(const SkBitmap& src, |
| return true; |
| } |
| -void IconCache::Put(const SkBitmap& src, |
| +void IconCache::Put(const gfx::ImageSkia& src, |
| const gfx::Size& size, |
| - const SkBitmap& processed) { |
| + const gfx::ImageSkia& processed) { |
| const std::string key = GetKey(src, size); |
| cache_[key].image = processed; |
| cache_[key].used = true; |