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

Unified Diff: ui/native_theme/native_theme_win.cc

Issue 2855503003: Replace uses of legacy SkBitmap::copyTo() API (Closed)
Patch Set: image_info Created 3 years, 8 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 | « ui/base/test/test_clipboard.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_win.cc
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index adc73210bbb471d61e78038d6a6080cabe440473..69658a01218e3e2c3dab89408ecf30eb99a4fc85 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -75,7 +75,9 @@ void SetCheckerboardShader(SkPaint* paint, const RECT& align_rect) {
SkBitmap temp_bitmap;
temp_bitmap.installPixels(info, buffer, info.minRowBytes());
SkBitmap bitmap;
- temp_bitmap.copyTo(&bitmap);
+ if (bitmap.tryAllocPixels(info)) {
+ temp_bitmap.readPixels(info, bitmap.getPixels(), bitmap.rowBytes(), 0, 0);
+ }
Evan Stade 2017/05/02 23:25:42 nit: no curlies
msarett1 2017/05/03 02:40:18 Done.
// Align the pattern with the upper corner of |align_rect|.
SkMatrix local_matrix;
« no previous file with comments | « ui/base/test/test_clipboard.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698