| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <windows.h> | 5 #include <windows.h> |
| 6 #include <psapi.h> | 6 #include <psapi.h> |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/debug/gdi_debug_util_win.h" | 9 #include "base/debug/gdi_debug_util_win.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/ptr_util.h" |
| 11 #include "base/win/win_util.h" | 12 #include "base/win/win_util.h" |
| 12 #include "skia/ext/bitmap_platform_device_win.h" | 13 #include "skia/ext/bitmap_platform_device_win.h" |
| 13 #include "skia/ext/platform_canvas.h" | 14 #include "skia/ext/platform_canvas.h" |
| 14 #include "skia/ext/skia_utils_win.h" | 15 #include "skia/ext/skia_utils_win.h" |
| 15 #include "third_party/skia/include/core/SkMatrix.h" | 16 #include "third_party/skia/include/core/SkMatrix.h" |
| 16 #include "third_party/skia/include/core/SkPath.h" | 17 #include "third_party/skia/include/core/SkPath.h" |
| 17 #include "third_party/skia/include/core/SkRefCnt.h" | 18 #include "third_party/skia/include/core/SkRefCnt.h" |
| 18 #include "third_party/skia/include/core/SkRect.h" | 19 #include "third_party/skia/include/core/SkRect.h" |
| 19 | 20 |
| 20 namespace { | 21 namespace { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 204 } |
| 204 | 205 |
| 205 // PlatformCanvas impl | 206 // PlatformCanvas impl |
| 206 | 207 |
| 207 std::unique_ptr<SkCanvas> CreatePlatformCanvasWithSharedSection( | 208 std::unique_ptr<SkCanvas> CreatePlatformCanvasWithSharedSection( |
| 208 int width, | 209 int width, |
| 209 int height, | 210 int height, |
| 210 bool is_opaque, | 211 bool is_opaque, |
| 211 HANDLE shared_section, | 212 HANDLE shared_section, |
| 212 OnFailureType failureType) { | 213 OnFailureType failureType) { |
| 213 sk_sp<SkBaseDevice> dev( | 214 sk_sp<SkBaseDevice> device( |
| 214 BitmapPlatformDevice::Create(width, height, is_opaque, shared_section)); | 215 BitmapPlatformDevice::Create(width, height, is_opaque, shared_section)); |
| 215 return CreateCanvas(dev, failureType); | 216 if (!device) { |
| 217 if (CRASH_ON_FAILURE == failureType) |
| 218 SK_CRASH(); |
| 219 return nullptr; |
| 220 } |
| 221 |
| 222 return base::MakeUnique<SkCanvas>(device.get()); |
| 216 } | 223 } |
| 217 | 224 |
| 218 } // namespace skia | 225 } // namespace skia |
| OLD | NEW |