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

Unified Diff: ui/native_theme/native_theme_win.cc

Issue 1827813002: Use skia::ReadPixels() in ui::NativeThemeWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | 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 8544127572261b50c5d3c05d700d1c03d2c5c13a..8539fe663c5596101958d19bfaa0a28bd1c075ad 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -720,12 +720,7 @@ void NativeThemeWin::PaintIndirect(SkCanvas* canvas,
// Draw the theme controls using existing HDC-drawing code.
PaintDirect(&offscreen_canvas, part, state, adjusted_rect, adjusted_extra);
- // Copy the pixels to a bitmap that has ref-counted pixel storage, which is
- // necessary to have when drawing to a SkPicture.
- const SkBitmap& hdc_bitmap =
- offscreen_canvas.getDevice()->accessBitmap(false);
- SkBitmap bitmap;
- hdc_bitmap.copyTo(&bitmap, kN32_SkColorType);
+ SkBitmap bitmap = skia::ReadPixels(&offscreen_canvas);
// Post-process the pixels to fix up the alpha values (see big comment above).
const SkPMColor placeholder_value = SkPreMultiplyColor(placeholder);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698