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_SKIA_H_ | 5 #ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ |
6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ | 6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 class VectorPlatformDeviceSkiaFactory : public SkDeviceFactory { | 25 class VectorPlatformDeviceSkiaFactory : public SkDeviceFactory { |
26 public: | 26 public: |
27 virtual SkDevice* newDevice(SkCanvas* notUsed, SkBitmap::Config config, | 27 virtual SkDevice* newDevice(SkCanvas* notUsed, SkBitmap::Config config, |
28 int width, int height, bool isOpaque, | 28 int width, int height, bool isOpaque, |
29 bool isForLayer); | 29 bool isForLayer); |
30 }; | 30 }; |
31 | 31 |
32 class VectorPlatformDeviceSkia : public PlatformDevice { | 32 class VectorPlatformDeviceSkia : public PlatformDevice { |
33 public: | 33 public: |
34 VectorPlatformDeviceSkia(int width, int height, | 34 SK_API VectorPlatformDeviceSkia(int width, int height, |
35 SkPDFDevice::OriginTransform flip); | 35 SkPDFDevice::OriginTransform flip); |
36 | 36 |
37 ~VectorPlatformDeviceSkia(); | 37 ~VectorPlatformDeviceSkia(); |
38 | 38 |
39 SkPDFDevice* PdfDevice() { return pdf_device_.get(); } | 39 SkPDFDevice* PdfDevice() { return pdf_device_.get(); } |
40 | 40 |
41 // PlatformDevice methods. | 41 // PlatformDevice methods. |
42 virtual bool IsVectorial(); | 42 virtual bool IsVectorial(); |
43 virtual bool IsNativeFontRenderingAllowed(); | 43 virtual bool IsNativeFontRenderingAllowed(); |
44 | 44 |
45 virtual PlatformSurface BeginPlatformPaint(); | 45 virtual PlatformSurface BeginPlatformPaint(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 virtual void drawDevice(const SkDraw& draw, SkDevice*, int x, int y, | 84 virtual void drawDevice(const SkDraw& draw, SkDevice*, int x, int y, |
85 const SkPaint&); | 85 const SkPaint&); |
86 | 86 |
87 #if defined(OS_WIN) | 87 #if defined(OS_WIN) |
88 virtual void drawToHDC(HDC dc, int x, int y, const RECT* src_rect); | 88 virtual void drawToHDC(HDC dc, int x, int y, const RECT* src_rect); |
89 #endif | 89 #endif |
90 | 90 |
91 // Our own methods. | 91 // Our own methods. |
92 | 92 |
93 // This needs to be called before anything is drawn. | 93 // This needs to be called before anything is drawn. |
94 void setInitialTransform(int xOffset, int yOffset, float scale_factor); | 94 SK_API void setInitialTransform(int xOffset, int yOffset, float scale_factor); |
95 | 95 |
96 private: | 96 private: |
97 SkRefPtr<SkPDFDevice> pdf_device_; | 97 SkRefPtr<SkPDFDevice> pdf_device_; |
98 SkMatrix base_transform_; | 98 SkMatrix base_transform_; |
99 SkRefPtr<BitmapPlatformDevice> raster_surface_; | 99 SkRefPtr<BitmapPlatformDevice> raster_surface_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceSkia); | 101 DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceSkia); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace skia | 104 } // namespace skia |
105 | 105 |
106 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ | 106 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_SKIA_H_ |
OLD | NEW |