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

Unified Diff: chrome/browser/icon_loader_chromeos.cc

Issue 10820049: Load 2x resources on demand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated comment 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
« no previous file with comments | « chrome/browser/extensions/image_loading_tracker.cc ('k') | chrome/browser/icon_loader_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/icon_loader_chromeos.cc
diff --git a/chrome/browser/icon_loader_chromeos.cc b/chrome/browser/icon_loader_chromeos.cc
index e967e4e5bd82d9d2b87fb5ed8eee482b13705d0a..b8680bea8059d61d08f529c68567dcc219936bfa 100644
--- a/chrome/browser/icon_loader_chromeos.cc
+++ b/chrome/browser/icon_loader_chromeos.cc
@@ -20,6 +20,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "webkit/glue/image_decoder.h"
@@ -181,9 +182,10 @@ void IconLoader::ReadIcon() {
LAZY_INSTANCE_INITIALIZER;
int idr = icon_mapper.Get().Lookup(group_, icon_size_);
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- const gfx::ImageSkia* image_skia = rb.GetImageNamed(idr).ToImageSkia();
- image_.reset(new gfx::Image(
- ResizeImage(*image_skia, IconSizeToDIPSize(icon_size_))));
+ gfx::ImageSkia image_skia(ResizeImage(*(rb.GetImageNamed(idr)).ToImageSkia(),
+ IconSizeToDIPSize(icon_size_)));
+ image_skia.MakeThreadSafe();
+ image_.reset(new gfx::Image(image_skia));
target_message_loop_->PostTask(
FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this));
}
« no previous file with comments | « chrome/browser/extensions/image_loading_tracker.cc ('k') | chrome/browser/icon_loader_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698