Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Unified Diff: ui/app_list/app_list_item_view.cc

Issue 10820049: Load 2x resources on demand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..a68dff0d6b9f182c8871a5c463cbf90bf6b6d17d 100644
--- a/ui/app_list/app_list_item_view.cc
+++ b/ui/app_list/app_list_item_view.cc
@@ -104,16 +104,12 @@ 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. We no longer need source.
+ image_.DeleteSource();
}
void Cancel() {

Powered by Google App Engine
This is Rietveld 408576698