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

Unified Diff: chrome/browser/profiles/profile_info_util.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename methods and vars to make image_scale more clear Created 7 years, 3 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: chrome/browser/profiles/profile_info_util.cc
diff --git a/chrome/browser/profiles/profile_info_util.cc b/chrome/browser/profiles/profile_info_util.cc
index 680334c9118fe504a238af2fc4660ef7b629b442..1157f734dbadb841ae66ad5874b2e6a7ef967183 100644
--- a/chrome/browser/profiles/profile_info_util.cc
+++ b/chrome/browser/profiles/profile_info_util.cc
@@ -23,7 +23,7 @@ gfx::Image GetSizedAvatarIconWithBorder(const gfx::Image& image,
int length = std::min(width, height) - kAvatarIconBorder;
SkBitmap bmp = skia::ImageOperations::Resize(
*image.ToSkBitmap(), skia::ImageOperations::RESIZE_BEST, length, length);
- gfx::Canvas canvas(gfx::Size(width, height), ui::SCALE_FACTOR_100P, false);
+ gfx::Canvas canvas(gfx::Size(width, height), 1.0f, false);
// Draw the icon centered on the canvas.
int x = (width - length) / 2;
@@ -52,8 +52,8 @@ gfx::Image GetAvatarIconForWebUI(const gfx::Image& image,
std::min(kAvatarIconWidth, kAvatarIconHeight) - kAvatarIconBorder;
SkBitmap bmp = skia::ImageOperations::Resize(
*image.ToSkBitmap(), skia::ImageOperations::RESIZE_BEST, length, length);
- gfx::Canvas canvas(gfx::Size(kAvatarIconWidth, kAvatarIconHeight),
- ui::SCALE_FACTOR_100P, false);
+ gfx::Canvas canvas(
+ gfx::Size(kAvatarIconWidth, kAvatarIconHeight), 1.0f, false);
// Draw the icon centered on the canvas.
int x = (kAvatarIconWidth - length) / 2;
@@ -74,8 +74,7 @@ gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image,
std::min(dst_width, dst_height)) - kAvatarIconBorder;
SkBitmap bmp = skia::ImageOperations::Resize(
*image.ToSkBitmap(), skia::ImageOperations::RESIZE_BEST, length, length);
- gfx::Canvas canvas(gfx::Size(dst_width, dst_height), ui::SCALE_FACTOR_100P,
- false);
+ gfx::Canvas canvas(gfx::Size(dst_width, dst_height), 1.0f, false);
// Draw the icon on the bottom center of the canvas.
int x1 = (dst_width - length) / 2;
@@ -102,4 +101,4 @@ gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image,
return gfx::Image(gfx::ImageSkia(canvas.ExtractImageRep()));
}
-} // namespace
+} // namespace profiles
oshima 2013/09/17 17:31:21 nit: two spaces

Powered by Google App Engine
This is Rietveld 408576698