OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "skia/ext/platform_canvas_win.h" | 5 #include "skia/ext/platform_canvas_win.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
9 #include "skia/ext/bitmap_platform_device_win.h" | 9 #include "skia/ext/bitmap_platform_device_win.h" |
10 | 10 |
11 namespace gfx { | 11 namespace skia { |
12 | 12 |
13 // Crashes the process. This is called when a bitmap allocation fails, and this | 13 // Crashes the process. This is called when a bitmap allocation fails, and this |
14 // function tries to determine why it might have failed, and crash on different | 14 // function tries to determine why it might have failed, and crash on different |
15 // lines. This allows us to see in crash dumps the most likely reason for the | 15 // lines. This allows us to see in crash dumps the most likely reason for the |
16 // failure. It takes the size of the bitmap we were trying to allocate as its | 16 // failure. It takes the size of the bitmap we were trying to allocate as its |
17 // arguments so we can check that as well. | 17 // arguments so we can check that as well. |
18 void CrashForBitmapAllocationFailure(int w, int h) { | 18 void CrashForBitmapAllocationFailure(int w, int h) { |
19 // The maximum number of GDI objects per process is 10K. If we're very close | 19 // The maximum number of GDI objects per process is 10K. If we're very close |
20 // to that, it's probably the problem. | 20 // to that, it's probably the problem. |
21 const int kLotsOfGDIObjs = 9990; | 21 const int kLotsOfGDIObjs = 9990; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 is_opaque, shared_section); | 107 is_opaque, shared_section); |
108 ReleaseDC(NULL, screen_dc); | 108 ReleaseDC(NULL, screen_dc); |
109 return device; | 109 return device; |
110 } | 110 } |
111 | 111 |
112 SkDevice* PlatformCanvasWin::setBitmapDevice(const SkBitmap&) { | 112 SkDevice* PlatformCanvasWin::setBitmapDevice(const SkBitmap&) { |
113 NOTREACHED(); | 113 NOTREACHED(); |
114 return NULL; | 114 return NULL; |
115 } | 115 } |
116 | 116 |
117 } // namespace gfx | 117 } // namespace skia |
OLD | NEW |