| 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 | 7 |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "skia/ext/bitmap_platform_device_win.h" | 9 #include "skia/ext/bitmap_platform_device_win.h" |
| 10 #include "skia/ext/platform_canvas.h" | 10 #include "skia/ext/platform_canvas.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 initialize(width, height, is_opaque, shared_section); | 88 initialize(width, height, is_opaque, shared_section); |
| 89 } | 89 } |
| 90 | 90 |
| 91 PlatformCanvas::~PlatformCanvas() { | 91 PlatformCanvas::~PlatformCanvas() { |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool PlatformCanvas::initialize(int width, | 94 bool PlatformCanvas::initialize(int width, |
| 95 int height, | 95 int height, |
| 96 bool is_opaque, | 96 bool is_opaque, |
| 97 HANDLE shared_section) { | 97 HANDLE shared_section) { |
| 98 if (initializeWithDevice(BitmapPlatformDevice::create(width, | 98 if (initializeWithDevice(BitmapPlatformDevice::Create(width, |
| 99 height, | 99 height, |
| 100 is_opaque, | 100 is_opaque, |
| 101 shared_section))) | 101 shared_section))) |
| 102 return true; | 102 return true; |
| 103 // Investigate we failed. If we know the reason, crash in a specific place. | 103 // Investigate we failed. If we know the reason, crash in a specific place. |
| 104 unsigned int error = GetLastError(); | 104 unsigned int error = GetLastError(); |
| 105 if (shared_section) | 105 if (shared_section) |
| 106 CrashIfInvalidSection(shared_section); | 106 CrashIfInvalidSection(shared_section); |
| 107 CrashForBitmapAllocationFailure(width, height, error); | 107 CrashForBitmapAllocationFailure(width, height, error); |
| 108 return false; | 108 return false; |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace skia | 111 } // namespace skia |
| OLD | NEW |