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

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

Issue 10790128: Revert 147915 - Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
===================================================================
--- chrome/browser/profiles/profile_info_util.cc (revision 147935)
+++ chrome/browser/profiles/profile_info_util.cc (working copy)
@@ -21,8 +21,7 @@
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),
- ui::SCALE_FACTOR_100P, false);
+ gfx::Canvas canvas(gfx::Size(kAvatarIconWidth, kAvatarIconHeight), false);
// Draw the icon centered on the canvas.
int x = (kAvatarIconWidth - length) / 2;
@@ -33,7 +32,7 @@
SkColor color = SkColorSetARGB(83, 0, 0, 0);
canvas.DrawRect(gfx::Rect(x, y, length - 1, length - 1), color);
- return gfx::Image(canvas.ExtractImageRep());
+ return gfx::Image(canvas.ExtractBitmap());
}
gfx::Image GetAvatarIconForWebUI(const gfx::Image& image,
@@ -44,15 +43,14 @@
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),
- ui::SCALE_FACTOR_100P, false);
+ gfx::Canvas canvas(gfx::Size(kAvatarIconWidth, kAvatarIconHeight), 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.ExtractImageRep());
+ return gfx::Image(canvas.ExtractBitmap());
}
gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image,
@@ -66,8 +64,7 @@
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), ui::SCALE_FACTOR_100P,
- false);
+ gfx::Canvas canvas(gfx::Size(dst_width, dst_height), false);
// Draw the icon on the bottom center of the canvas.
int x1 = (dst_width - length) / 2;
@@ -91,7 +88,7 @@
canvas.DrawLine(gfx::Point(x2 - 1, y1 + 1), gfx::Point(x2 - 1, y2 - 1),
shadow_color);
- return gfx::Image(canvas.ExtractImageRep());
+ return gfx::Image(canvas.ExtractBitmap());
}
} // namespace
« no previous file with comments | « chrome/browser/extensions/extension_icon_manager.cc ('k') | chrome/browser/tab_contents/thumbnail_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698