OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_VECTOR_PLATFORM_DEVICE_WIN_H_ | 5 #ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_WIN_H_ |
6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_WIN_H_ | 6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "skia/ext/platform_device.h" | 10 #include "skia/ext/platform_device.h" |
11 #include "third_party/skia/include/core/SkMatrix.h" | 11 #include "third_party/skia/include/core/SkMatrix.h" |
12 #include "third_party/skia/include/core/SkRegion.h" | 12 #include "third_party/skia/include/core/SkRegion.h" |
13 | 13 |
14 namespace skia { | 14 namespace skia { |
15 | 15 |
16 class VectorPlatformDeviceFactory : public SkDeviceFactory { | 16 class VectorPlatformDeviceFactory : public SkDeviceFactory { |
17 public: | 17 public: |
18 virtual SkDevice* newDevice(SkCanvas* ignored, SkBitmap::Config config, | 18 virtual SkDevice* newDevice(SkCanvas* ignored, SkBitmap::Config config, |
19 int width, int height, | 19 int width, int height, |
20 bool isOpaque, bool isForLayer) OVERRIDE; | 20 bool isOpaque, bool isForLayer) OVERRIDE; |
21 static SkDevice* CreateDevice(int width, int height, bool isOpaque, | 21 static skia::PlatformDevice* CreateDevice(int width, int height, |
22 HANDLE shared_section); | 22 bool isOpaque, |
| 23 HANDLE shared_section); |
23 }; | 24 }; |
24 | 25 |
25 // A device is basically a wrapper around SkBitmap that provides a surface for | 26 // A device is basically a wrapper around SkBitmap that provides a surface for |
26 // SkCanvas to draw into. This specific device is not not backed by a surface | 27 // SkCanvas to draw into. This specific device is not not backed by a surface |
27 // and is thus unreadable. This is because the backend is completely vectorial. | 28 // and is thus unreadable. This is because the backend is completely vectorial. |
28 // This device is a simple wrapper over a Windows device context (HDC) handle. | 29 // This device is a simple wrapper over a Windows device context (HDC) handle. |
29 class VectorPlatformDevice : public PlatformDevice { | 30 class VectorPlatformDevice : public PlatformDevice { |
30 public: | 31 public: |
31 // Factory function. The DC is kept as the output context. | 32 // Factory function. The DC is kept as the output context. |
32 static VectorPlatformDevice* create(HDC dc, int width, int height); | 33 static VectorPlatformDevice* create(HDC dc, int width, int height); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 137 |
137 // Copy & assign are not supported. | 138 // Copy & assign are not supported. |
138 VectorPlatformDevice(const VectorPlatformDevice&); | 139 VectorPlatformDevice(const VectorPlatformDevice&); |
139 const VectorPlatformDevice& operator=(const VectorPlatformDevice&); | 140 const VectorPlatformDevice& operator=(const VectorPlatformDevice&); |
140 }; | 141 }; |
141 | 142 |
142 } // namespace skia | 143 } // namespace skia |
143 | 144 |
144 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_WIN_H_ | 145 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_WIN_H_ |
145 | 146 |
OLD | NEW |