| 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 "base/gfx/platform_canvas_win.h" | 5 #include "base/gfx/platform_canvas_win.h" |
| 6 | 6 |
| 7 #include "base/gfx/bitmap_platform_device_win.h" | 7 #include "base/gfx/bitmap_platform_device_win.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 CHECK(GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS) < kLotsOfGDIObjs); | 27 CHECK(GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS) < kLotsOfGDIObjs); |
| 28 | 28 |
| 29 // If the bitmap is ginormous, then we probably can't allocate it. | 29 // If the bitmap is ginormous, then we probably can't allocate it. |
| 30 // We use 64M pixels = 256MB @ 4 bytes per pixel. | 30 // We use 64M pixels = 256MB @ 4 bytes per pixel. |
| 31 const int64 kGinormousBitmapPxl = 64000000; | 31 const int64 kGinormousBitmapPxl = 64000000; |
| 32 CHECK(static_cast<int64>(w) * static_cast<int64>(h) < kGinormousBitmapPxl); | 32 CHECK(static_cast<int64>(w) * static_cast<int64>(h) < kGinormousBitmapPxl); |
| 33 | 33 |
| 34 // If we're using a crazy amount of virtual address space, then maybe there | 34 // If we're using a crazy amount of virtual address space, then maybe there |
| 35 // isn't enough for our bitmap. | 35 // isn't enough for our bitmap. |
| 36 const int64 kLotsOfMem = 1500000000; // 1.5GB. | 36 const int64 kLotsOfMem = 1500000000; // 1.5GB. |
| 37 scoped_ptr<process_util::ProcessMetrics> process_metrics( | 37 scoped_ptr<base::ProcessMetrics> process_metrics( |
| 38 process_util::ProcessMetrics::CreateProcessMetrics(GetCurrentProcess())); | 38 base::ProcessMetrics::CreateProcessMetrics(GetCurrentProcess())); |
| 39 CHECK(process_metrics->GetPagefileUsage() < kLotsOfMem); | 39 CHECK(process_metrics->GetPagefileUsage() < kLotsOfMem); |
| 40 | 40 |
| 41 // Everything else. | 41 // Everything else. |
| 42 CHECK(0); | 42 CHECK(0); |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 PlatformCanvasWin::PlatformCanvasWin() : SkCanvas() { | 46 PlatformCanvasWin::PlatformCanvasWin() : SkCanvas() { |
| 47 } | 47 } |
| 48 | 48 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 ReleaseDC(NULL, screen_dc); | 113 ReleaseDC(NULL, screen_dc); |
| 114 return device; | 114 return device; |
| 115 } | 115 } |
| 116 | 116 |
| 117 SkDevice* PlatformCanvasWin::setBitmapDevice(const SkBitmap&) { | 117 SkDevice* PlatformCanvasWin::setBitmapDevice(const SkBitmap&) { |
| 118 NOTREACHED(); | 118 NOTREACHED(); |
| 119 return NULL; | 119 return NULL; |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace gfx | 122 } // namespace gfx |
| OLD | NEW |