Index: ui/app_list/app_list_item_view.cc |
diff --git a/ui/app_list/app_list_item_view.cc b/ui/app_list/app_list_item_view.cc |
index 8c405fbe26fcb1f3a55ea54bc63ef1e22c5260bb..47132b951f9c421891352b344f8675289b4c46ee 100644 |
--- a/ui/app_list/app_list_item_view.cc |
+++ b/ui/app_list/app_list_item_view.cc |
@@ -104,16 +104,13 @@ class AppListItemView::IconOperation |
skia::ImageOperations::RESIZE_BEST, size_)); |
gfx::ImageSkia shadow( |
gfx::ImageSkiaOperations::CreateImageWithDropShadow(resized, shadows_)); |
- |
- // The following statement causes shadowed image being generated for all |
- // existing image reps in |image_|. This is needed so that expensive shadow |
- // generation does not run on UI thread. |
- gfx::ImageSkia::ImageSkiaReps image_reps = image_.image_reps(); |
- for (gfx::ImageSkia::ImageSkiaReps::const_iterator it = image_reps.begin(); |
- it != image_reps.end(); ++it) { |
- shadow.GetRepresentation(it->scale_factor()); |
- } |
image_ = shadow; |
+ // Make sure that the image contains ImageSkiaReps for supported |
+ // scale factors. |
+ image_.EnsureRepsForSupportedScaleFactors(); |
+ // All images are generated. Remove source and mark it as read only. |
+ image_.DeleteSource(); |
+ image_.SetReadOnly(); |
} |
void Cancel() { |