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

Unified Diff: chrome/browser/ui/app_list/extension_app_item.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 | « ash/common/accelerators/debug_commands.cc ('k') | chrome/browser/ui/webui/app_launcher_login_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/extension_app_item.cc
diff --git a/chrome/browser/ui/app_list/extension_app_item.cc b/chrome/browser/ui/app_list/extension_app_item.cc
index 3d9bdef3c3c1e3e87924e98080273142e588cff4..93e2bd530558b92bc1040aa0a357b3d67a35b903 100644
--- a/chrome/browser/ui/app_list/extension_app_item.cc
+++ b/chrome/browser/ui/app_list/extension_app_item.cc
@@ -86,13 +86,12 @@ class RoundedCornersImageSource : public gfx::CanvasImageSource {
SkBitmap mask_bitmap;
mask_bitmap.allocN32Pixels(icon_.width(), icon_.height(), false);
- sk_sp<SkSurface> mask_surface = SkSurface::MakeRasterDirect(
- mask_bitmap.info(), mask_bitmap.getPixels(), mask_bitmap.rowBytes());
- mask_surface->getCanvas()->clear(SK_ColorTRANSPARENT);
+ SkCanvas mask_canvas(mask_bitmap);
+ mask_canvas.clear(SK_ColorTRANSPARENT);
SkPaint mask_paint;
mask_paint.setAntiAlias(true);
mask_paint.setColor(SK_ColorWHITE);
- mask_surface->getCanvas()->drawRoundRect(
+ mask_canvas.drawRoundRect(
gfx::RectToSkRect(gfx::Rect(icon_.width(), icon_.height())),
kRoundingRadius, kRoundingRadius, mask_paint);
« no previous file with comments | « ash/common/accelerators/debug_commands.cc ('k') | chrome/browser/ui/webui/app_launcher_login_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698