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

Unified Diff: ash/common/accelerators/debug_commands.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 | « no previous file | chrome/browser/ui/app_list/extension_app_item.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/accelerators/debug_commands.cc
diff --git a/ash/common/accelerators/debug_commands.cc b/ash/common/accelerators/debug_commands.cc
index 5ba37e9c70a8e10b97d196a73a840e2ec343e93c..fda6a1ed45b78675fc1555bbd6cd4bf6095141ca 100644
--- a/ash/common/accelerators/debug_commands.cc
+++ b/ash/common/accelerators/debug_commands.cc
@@ -93,16 +93,15 @@ gfx::ImageSkia CreateWallpaperImage(SkColor fill, SkColor rect) {
gfx::Size image_size(1366, 768);
SkBitmap bitmap;
bitmap.allocN32Pixels(image_size.width(), image_size.height(), true);
- sk_sp<SkSurface> surface = SkSurface::MakeRasterDirect(
- bitmap.info(), bitmap.getPixels(), bitmap.rowBytes());
- surface->getCanvas()->drawColor(fill);
+ SkCanvas canvas(bitmap);
+ canvas.drawColor(fill);
SkPaint paint;
paint.setColor(rect);
paint.setStrokeWidth(10);
paint.setStyle(SkPaint::kStroke_Style);
paint.setBlendMode(SkBlendMode::kSrcOver);
- surface->getCanvas()->drawRoundRect(gfx::RectToSkRect(gfx::Rect(image_size)),
- 100.f, 100.f, paint);
+ canvas.drawRoundRect(gfx::RectToSkRect(gfx::Rect(image_size)), 100.f, 100.f,
+ paint);
return gfx::ImageSkia(gfx::ImageSkiaRep(std::move(bitmap), 1.f));
}
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/extension_app_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698