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

Unified Diff: ui/app_list/app_list_item_view.cc

Issue 10868003: chromeos: Fix pixelated icons in app list and launcher (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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..246d3ad6c574f953b48cd46c59ea93fbf8b6f756 100644
--- a/ui/app_list/app_list_item_view.cc
+++ b/ui/app_list/app_list_item_view.cc
@@ -184,10 +184,12 @@ void AppListItemView::UpdateIcon() {
if (icon_size_.IsEmpty())
return;
- gfx::ImageSkia icon = model_->icon();
- // Clear icon and bail out if model icon is empty.
- if (icon.isNull()) {
- icon_->SetImage(NULL);
+ const gfx::ImageSkia& icon = model_->icon();
+ // Use empty model icon and bail out. OnPaint should trigger image
+ // representation fetching and if there is an icon, UpdateIcon should be
+ // called again with the updated image.
+ if (icon.isNull() || icon.image_reps().size() == 0) {
+ icon_->SetImage(icon);
return;
}

Powered by Google App Engine
This is Rietveld 408576698