| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <psapi.h> | 6 #include <psapi.h> |
| 7 | 7 |
| 8 #include "skia/ext/platform_canvas_win.h" | 8 #include "skia/ext/platform_canvas_win.h" |
| 9 | 9 |
| 10 #include "skia/ext/bitmap_platform_device_win.h" | 10 #include "skia/ext/bitmap_platform_device_win.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 bool PlatformCanvasWin::initialize(int width, | 68 bool PlatformCanvasWin::initialize(int width, |
| 69 int height, | 69 int height, |
| 70 bool is_opaque, | 70 bool is_opaque, |
| 71 HANDLE shared_section) { | 71 HANDLE shared_section) { |
| 72 SkDevice* device = | 72 SkDevice* device = |
| 73 createPlatformDevice(width, height, is_opaque, shared_section); | 73 createPlatformDevice(width, height, is_opaque, shared_section); |
| 74 if (!device) | 74 if (!device) |
| 75 return false; | 75 return false; |
| 76 | 76 |
| 77 setDevice(device); | 77 setDevice(device); |
| 78 device->unref(); // was created with refcount 1, and setDevice also refs | 78 device->unref(); // was created with refcount 1, and setDevice also refs |
| 79 return true; | 79 return true; |
| 80 } | 80 } |
| 81 | 81 |
| 82 HDC PlatformCanvasWin::beginPlatformPaint() { | 82 HDC PlatformCanvasWin::beginPlatformPaint() { |
| 83 return getTopPlatformDevice().getBitmapDC(); | 83 return getTopPlatformDevice().getBitmapDC(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void PlatformCanvasWin::endPlatformPaint() { | 86 void PlatformCanvasWin::endPlatformPaint() { |
| 87 // we don't clear the DC here since it will be likely to be used again | 87 // we don't clear the DC here since it will be likely to be used again |
| 88 // flushing will be done in onAccessBitmap | 88 // flushing will be done in onAccessBitmap |
| (...skipping 23 matching lines...) Expand all Loading... |
| 112 ReleaseDC(NULL, screen_dc); | 112 ReleaseDC(NULL, screen_dc); |
| 113 return device; | 113 return device; |
| 114 } | 114 } |
| 115 | 115 |
| 116 SkDevice* PlatformCanvasWin::setBitmapDevice(const SkBitmap&) { | 116 SkDevice* PlatformCanvasWin::setBitmapDevice(const SkBitmap&) { |
| 117 SkASSERT(false); // Should not be called. | 117 SkASSERT(false); // Should not be called. |
| 118 return NULL; | 118 return NULL; |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace skia | 121 } // namespace skia |
| OLD | NEW |