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 #ifndef SKIA_EXT_PLATFORM_CANVAS_WIN_H_ | 5 #ifndef SKIA_EXT_PLATFORM_CANVAS_WIN_H_ |
6 #define SKIA_EXT_PLATFORM_CANVAS_WIN_H_ | 6 #define SKIA_EXT_PLATFORM_CANVAS_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "skia/ext/platform_device_win.h" | 10 #include "skia/ext/platform_device_win.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // dummy device so callers do not have to check. If you are concerned about | 50 // dummy device so callers do not have to check. If you are concerned about |
51 // performance, check the clip before doing any painting. | 51 // performance, check the clip before doing any painting. |
52 // | 52 // |
53 // This is different than SkCanvas' getDevice, because that returns the | 53 // This is different than SkCanvas' getDevice, because that returns the |
54 // bottommost device. | 54 // bottommost device. |
55 // | 55 // |
56 // Danger: the resulting device should not be saved. It will be invalidated | 56 // Danger: the resulting device should not be saved. It will be invalidated |
57 // by the next call to save() or restore(). | 57 // by the next call to save() or restore(). |
58 PlatformDeviceWin& getTopPlatformDevice() const; | 58 PlatformDeviceWin& getTopPlatformDevice() const; |
59 | 59 |
| 60 static size_t StrideForWidth(unsigned width); |
| 61 |
60 protected: | 62 protected: |
61 // Creates a device store for use by the canvas. We override this so that | 63 // Creates a device store for use by the canvas. We override this so that |
62 // the device is always our own so we know that we can use GDI operations | 64 // the device is always our own so we know that we can use GDI operations |
63 // on it. Simply calls into createPlatformDevice(). | 65 // on it. Simply calls into createPlatformDevice(). |
64 virtual SkDevice* createDevice(SkBitmap::Config, int width, int height, | 66 virtual SkDevice* createDevice(SkBitmap::Config, int width, int height, |
65 bool is_opaque, bool isForLayer); | 67 bool is_opaque, bool isForLayer); |
66 | 68 |
67 // Creates a device store for use by the canvas. By default, it creates a | 69 // Creates a device store for use by the canvas. By default, it creates a |
68 // BitmapPlatformDeviceWin. Can be overridden to change the object type. | 70 // BitmapPlatformDeviceWin. Can be overridden to change the object type. |
69 virtual SkDevice* createPlatformDevice(int width, int height, bool is_opaque, | 71 virtual SkDevice* createPlatformDevice(int width, int height, bool is_opaque, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // Disallow copy and assign. | 194 // Disallow copy and assign. |
193 CanvasPaintT(const CanvasPaintT&); | 195 CanvasPaintT(const CanvasPaintT&); |
194 CanvasPaintT& operator=(const CanvasPaintT&); | 196 CanvasPaintT& operator=(const CanvasPaintT&); |
195 }; | 197 }; |
196 | 198 |
197 typedef CanvasPaintT<PlatformCanvasWin> PlatformCanvasWinPaint; | 199 typedef CanvasPaintT<PlatformCanvasWin> PlatformCanvasWinPaint; |
198 | 200 |
199 } // namespace skia | 201 } // namespace skia |
200 | 202 |
201 #endif // SKIA_EXT_PLATFORM_CANVAS_WIN_H_ | 203 #endif // SKIA_EXT_PLATFORM_CANVAS_WIN_H_ |
OLD | NEW |