Chromium Code Reviews| 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 043a3d47278a278e01d1c455157a9ae06ceec4b9..a514d057e069e21ca0bac13740d736a8ea588c61 100644 |
| --- a/ui/native_theme/native_theme_win.cc |
| +++ b/ui/native_theme/native_theme_win.cc |
| @@ -667,9 +667,14 @@ void NativeThemeWin::PaintIndirect(SkCanvas* destination_canvas, |
| // Create an offscreen canvas that is backed by an HDC. |
| base::win::ScopedCreateDC offscreen_hdc( |
| skia::CreateOffscreenSurface(rect.width(), rect.height())); |
| + if (!offscreen_hdc.IsValid()) |
| + return; |
|
Peter Kasting
2016/09/21 20:50:44
Nit: It's probably worth a comment or two on these
tomhudson
2016/09/21 21:19:20
Done, although we don't know as much as we'd like
|
| + |
| sk_sp<SkSurface> offscreen_surface = |
| skia::MapPlatformSurface(offscreen_hdc.Get()); |
| - DCHECK(offscreen_surface); |
| + if (!offscreen_surface) |
| + return; |
| + |
| SkCanvas* offscreen_canvas = offscreen_surface->getCanvas(); |
| DCHECK(offscreen_canvas); |