From 3ea137b977fef06ab96683fd5fbeb41d422d315e Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Thu, 22 May 2014 09:27:35 +0000 Subject: [PATCH] More extension icon fixes with Windows HiDPI. With automatic scaling happening in ImageSkia, the extensions code should not be using the GetImageScale function to get the scale for the scale factor. It should be using the GetScaleForScaleFactor function instead. Hopefully the last of extension icon fixes for Windows HiDPI. BUG=375461 R=sky Review URL: https://codereview.chromium.org/299683005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272150 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/extension_web_ui.cc | 2 +- chrome/browser/extensions/image_loader.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc index 8e8419ef04f6..f2793433f2e4 100644 --- a/chrome/browser/extensions/extension_web_ui.cc +++ b/chrome/browser/extensions/extension_web_ui.cc @@ -428,7 +428,7 @@ void ExtensionWebUI::GetFaviconForURL( FaviconUtil::GetFaviconScaleFactors(); std::vector info_list; for (size_t i = 0; i < scale_factors.size(); ++i) { - float scale = ui::GetImageScale(scale_factors[i]); + float scale = ui::GetScaleForScaleFactor(scale_factors[i]); int pixel_size = static_cast(gfx::kFaviconSize * scale); extensions::ExtensionResource icon_resource = extensions::IconsInfo::GetIconResource(extension, diff --git a/chrome/browser/extensions/image_loader.cc b/chrome/browser/extensions/image_loader.cc index 055775b8a6b1..7c76c4dcded0 100644 --- a/chrome/browser/extensions/image_loader.cc +++ b/chrome/browser/extensions/image_loader.cc @@ -376,7 +376,7 @@ void ImageLoader::ReplyBack(const ImageLoaderImageCallback& callback, image_skia.AddRepresentation(gfx::ImageSkiaRep( bitmap, - ui::GetImageScale(image_rep.scale_factor))); + ui::GetScaleForScaleFactor(image_rep.scale_factor))); } gfx::Image image; @@ -406,7 +406,8 @@ void ImageLoader::ReplyBackWithImageFamily( // Create a new ImageSkia for this width/height, or add a representation to // an existing ImageSkia with the same width/height. image_skia_map[key].AddRepresentation( - gfx::ImageSkiaRep(bitmap, ui::GetImageScale(image_rep.scale_factor))); + gfx::ImageSkiaRep(bitmap, + ui::GetScaleForScaleFactor(image_rep.scale_factor))); } for (std::map, gfx::ImageSkia>::iterator it = -- 2.11.4.GIT