summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profiles/profile_info_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/profiles/profile_info_util.cc')
-rw-r--r--chrome/browser/profiles/profile_info_util.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/profiles/profile_info_util.cc b/chrome/browser/profiles/profile_info_util.cc
index 83d38f5..27e3130 100644
--- a/chrome/browser/profiles/profile_info_util.cc
+++ b/chrome/browser/profiles/profile_info_util.cc
@@ -21,7 +21,8 @@ gfx::Image GetAvatarIconForMenu(const gfx::Image& image,
int length = std::min(kAvatarIconWidth, kAvatarIconHeight) - 2;
SkBitmap bmp = skia::ImageOperations::Resize(
*image.ToSkBitmap(), skia::ImageOperations::RESIZE_BEST, length, length);
- gfx::Canvas canvas(gfx::Size(kAvatarIconWidth, kAvatarIconHeight), false);
+ gfx::Canvas canvas(gfx::Size(kAvatarIconWidth, kAvatarIconHeight),
+ ui::SCALE_FACTOR_100P, false);
// Draw the icon centered on the canvas.
int x = (kAvatarIconWidth - length) / 2;
@@ -32,7 +33,7 @@ gfx::Image GetAvatarIconForMenu(const gfx::Image& image,
SkColor color = SkColorSetARGB(83, 0, 0, 0);
canvas.DrawRect(gfx::Rect(x, y, length - 1, length - 1), color);
- return gfx::Image(canvas.ExtractBitmap());
+ return gfx::Image(canvas.ExtractImageRep());
}
gfx::Image GetAvatarIconForWebUI(const gfx::Image& image,
@@ -43,14 +44,15 @@ gfx::Image GetAvatarIconForWebUI(const gfx::Image& image,
int length = std::min(kAvatarIconWidth, kAvatarIconHeight) - 2;
SkBitmap bmp = skia::ImageOperations::Resize(
*image.ToSkBitmap(), skia::ImageOperations::RESIZE_BEST, length, length);
- gfx::Canvas canvas(gfx::Size(kAvatarIconWidth, kAvatarIconHeight), false);
+ gfx::Canvas canvas(gfx::Size(kAvatarIconWidth, kAvatarIconHeight),
+ ui::SCALE_FACTOR_100P, false);
// Draw the icon centered on the canvas.
int x = (kAvatarIconWidth - length) / 2;
int y = (kAvatarIconHeight - length) / 2;
canvas.DrawImageInt(bmp, x, y);
- return gfx::Image(canvas.ExtractBitmap());
+ return gfx::Image(canvas.ExtractImageRep());
}
gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image,
@@ -64,7 +66,8 @@ gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image,
std::min(dst_width, dst_height)) - 2;
SkBitmap bmp = skia::ImageOperations::Resize(
*image.ToSkBitmap(), skia::ImageOperations::RESIZE_BEST, length, length);
- gfx::Canvas canvas(gfx::Size(dst_width, dst_height), false);
+ gfx::Canvas canvas(gfx::Size(dst_width, dst_height), ui::SCALE_FACTOR_100P,
+ false);
// Draw the icon on the bottom center of the canvas.
int x1 = (dst_width - length) / 2;
@@ -88,7 +91,7 @@ gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image,
canvas.DrawLine(gfx::Point(x2 - 1, y1 + 1), gfx::Point(x2 - 1, y2 - 1),
shadow_color);
- return gfx::Image(canvas.ExtractBitmap());
+ return gfx::Image(canvas.ExtractImageRep());
}
} // namespace