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

Unified Diff: chrome/browser/ui/webui/app_launcher_login_handler.cc

Issue 2764163002: Use SkCanvas::SkCanvas(SkBitmap) instead of going thru SkSurface (Closed)
Patch Set: Created 3 years, 9 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 | « chrome/browser/ui/app_list/extension_app_item.cc ('k') | ui/message_center/message_center_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/app_launcher_login_handler.cc
diff --git a/chrome/browser/ui/webui/app_launcher_login_handler.cc b/chrome/browser/ui/webui/app_launcher_login_handler.cc
index 290b6c3d3d6a798f1441bc4001b81fb327281ae9..04984c6063a57a07e71dd5ccaaf61aeca62ad9cb 100644
--- a/chrome/browser/ui/webui/app_launcher_login_handler.cc
+++ b/chrome/browser/ui/webui/app_launcher_login_handler.cc
@@ -59,15 +59,14 @@ SkBitmap GetGAIAPictureForNTP(const gfx::Image& image) {
const int kLength = 27;
SkBitmap bmp = skia::ImageOperations::Resize(*image.ToSkBitmap(),
skia::ImageOperations::RESIZE_BEST, kLength, kLength);
+ SkCanvas canvas(bmp);
// Draw a gray border on the inside of the icon.
- sk_sp<SkSurface> surface =
- SkSurface::MakeRasterDirect(bmp.info(), bmp.getPixels(), bmp.rowBytes());
SkPaint paint;
paint.setColor(SkColorSetARGB(83, 0, 0, 0));
paint.setStyle(SkPaint::kStroke_Style);
- surface->getCanvas()->drawRect(
- gfx::RectToSkRect(gfx::Rect(kLength - 1, kLength - 1)), paint);
+ canvas.drawRect(gfx::RectToSkRect(gfx::Rect(kLength - 1, kLength - 1)),
+ paint);
return bmp;
}
« no previous file with comments | « chrome/browser/ui/app_list/extension_app_item.cc ('k') | ui/message_center/message_center_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698