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

Unified Diff: chrome/browser/themes/browser_theme_pack.cc

Issue 10820049: Load 2x resources on demand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup 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 | « no previous file | ui/app_list/app_list_item_view.cc » ('j') | ui/gfx/image/image_skia.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/browser_theme_pack.cc
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index a2672f77520aea90eed1443e661b2c4e71f8448e..d9ea23171a6418fa7e56d0881331c0dbdc1c60ab 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -436,6 +436,16 @@ scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromExtension(
pack->CreateImages(&pack->images_on_ui_thread_);
pack->CreateImages(&pack->images_on_file_thread_);
+ // Make sure the images_on_file_thread_ has bitmaps for supported
+ // scale factors before passing to FILE thread.
+ for (ImageCache::iterator it = pack->images_on_file_thread_.begin();
+ it != pack->images_on_file_thread_.end(); ++it) {
+ gfx::ImageSkia* image_skia =
+ const_cast<gfx::ImageSkia*>(it->second->ToImageSkia());
+ image_skia->EnsureRepsForSupportedScaleFactors();
+ image_skia->DeleteSource();
+ }
+
// For M22, as it is not possible to easily determine which scale factors are
// in use, assume that the 1x scale factor is in use.
std::vector<ui::ScaleFactor> scale_factors_in_use;
« no previous file with comments | « no previous file | ui/app_list/app_list_item_view.cc » ('j') | ui/gfx/image/image_skia.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698