OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EMF_WIN_H_ | 5 #ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_ |
6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_ | 6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "skia/ext/platform_device.h" | 11 #include "skia/ext/platform_device.h" |
12 #include "third_party/skia/include/core/SkMatrix.h" | 12 #include "third_party/skia/include/core/SkMatrix.h" |
13 #include "third_party/skia/include/core/SkRegion.h" | 13 #include "third_party/skia/include/core/SkRegion.h" |
14 | 14 |
15 namespace skia { | 15 namespace skia { |
16 | 16 |
17 // A device is basically a wrapper around SkBitmap that provides a surface for | 17 // A device is basically a wrapper around SkBitmap that provides a surface for |
18 // SkCanvas to draw into. This specific device is not not backed by a surface | 18 // SkCanvas to draw into. This specific device is not not backed by a surface |
19 // and is thus unreadable. This is because the backend is completely vectorial. | 19 // and is thus unreadable. This is because the backend is completely vectorial. |
20 // This device is a simple wrapper over a Windows device context (HDC) handle. | 20 // This device is a simple wrapper over a Windows device context (HDC) handle. |
21 class VectorPlatformDeviceEmf : public PlatformDevice { | 21 class VectorPlatformDeviceEmf : public PlatformDevice, public SkDevice { |
vandebo (ex-Chrome)
2011/08/15 19:52:10
Would it make sense to rename this to EmfDevice th
Jeff Timanus
2011/08/15 20:06:25
Yes. That would make sense for all of the classes
| |
22 public: | 22 public: |
23 SK_API static PlatformDevice* CreateDevice(int width, int height, | 23 SK_API static SkDevice* CreateDevice(int width, int height, bool isOpaque, |
24 bool isOpaque, | 24 HANDLE shared_section); |
25 HANDLE shared_section); | |
26 | 25 |
27 // Factory function. The DC is kept as the output context. | 26 // Factory function. The DC is kept as the output context. |
28 static VectorPlatformDeviceEmf* create(HDC dc, int width, int height); | 27 static SkDevice* create(HDC dc, int width, int height); |
29 | 28 |
30 VectorPlatformDeviceEmf(HDC dc, const SkBitmap& bitmap); | 29 VectorPlatformDeviceEmf(HDC dc, const SkBitmap& bitmap); |
31 virtual ~VectorPlatformDeviceEmf(); | 30 virtual ~VectorPlatformDeviceEmf(); |
32 | 31 |
33 // PlatformDevice methods | 32 // PlatformDevice methods |
34 virtual PlatformSurface BeginPlatformPaint() OVERRIDE; | 33 virtual PlatformSurface BeginPlatformPaint() OVERRIDE; |
35 virtual void DrawToNativeContext(HDC dc, int x, int y, | 34 virtual void DrawToNativeContext(HDC dc, int x, int y, |
36 const RECT* src_rect) OVERRIDE; | 35 const RECT* src_rect) OVERRIDE; |
37 virtual bool AlphaBlendUsed() const OVERRIDE { return alpha_blend_used_; } | 36 virtual bool AlphaBlendUsed() const OVERRIDE { return alpha_blend_used_; } |
38 | 37 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 // True if AlphaBlend() was called during this print. | 130 // True if AlphaBlend() was called during this print. |
132 bool alpha_blend_used_; | 131 bool alpha_blend_used_; |
133 | 132 |
134 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceEmf); | 133 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceEmf); |
135 }; | 134 }; |
136 | 135 |
137 } // namespace skia | 136 } // namespace skia |
138 | 137 |
139 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_ | 138 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_ |
140 | 139 |
OLD | NEW |