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_LINUX_H_ | 5 #ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_LINUX_H_ |
6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_LINUX_H_ | 6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_LINUX_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "skia/ext/platform_device.h" | 9 #include "skia/ext/platform_device.h" |
10 #include "third_party/skia/include/core/SkMatrix.h" | 10 #include "third_party/skia/include/core/SkMatrix.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // cooresponding Cairo APIs and outputs to a Cairo surface. Please NOTE that | 26 // cooresponding Cairo APIs and outputs to a Cairo surface. Please NOTE that |
27 // since it is completely vectorial, the bitmap content in it is thus | 27 // since it is completely vectorial, the bitmap content in it is thus |
28 // meaningless. | 28 // meaningless. |
29 class VectorPlatformDevice : public PlatformDevice { | 29 class VectorPlatformDevice : public PlatformDevice { |
30 public: | 30 public: |
31 // Factory function. Ownership of |context| is not transferred. | 31 // Factory function. Ownership of |context| is not transferred. |
32 static VectorPlatformDevice* create(PlatformSurface context, | 32 static VectorPlatformDevice* create(PlatformSurface context, |
33 int width, int height); | 33 int width, int height); |
34 virtual ~VectorPlatformDevice(); | 34 virtual ~VectorPlatformDevice(); |
35 | 35 |
36 virtual SkDeviceFactory* getDeviceFactory() { | 36 virtual SkDeviceFactory* getDeviceFactory(); |
37 return SkNEW(VectorPlatformDeviceFactory); | |
38 } | |
39 | 37 |
40 virtual bool IsVectorial() { return true; } | 38 virtual bool IsVectorial(); |
41 virtual PlatformSurface beginPlatformPaint() { return context_; } | 39 virtual PlatformSurface beginPlatformPaint(); |
42 | 40 |
43 // We translate following skia APIs into corresponding Cairo APIs. | 41 // We translate following skia APIs into corresponding Cairo APIs. |
44 virtual void drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, | 42 virtual void drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, |
45 const SkMatrix& matrix, const SkPaint& paint); | 43 const SkMatrix& matrix, const SkPaint& paint); |
46 virtual void drawDevice(const SkDraw& draw, SkDevice*, int x, int y, | 44 virtual void drawDevice(const SkDraw& draw, SkDevice*, int x, int y, |
47 const SkPaint&); | 45 const SkPaint&); |
48 virtual void drawPaint(const SkDraw& draw, const SkPaint& paint); | 46 virtual void drawPaint(const SkDraw& draw, const SkPaint& paint); |
49 virtual void drawPath(const SkDraw& draw, const SkPath& path, | 47 virtual void drawPath(const SkDraw& draw, const SkPath& path, |
50 const SkPaint& paint); | 48 const SkPaint& paint); |
51 virtual void drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, | 49 virtual void drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 PlatformSurface context_; | 120 PlatformSurface context_; |
123 | 121 |
124 // Copy & assign are not supported. | 122 // Copy & assign are not supported. |
125 VectorPlatformDevice(const VectorPlatformDevice&); | 123 VectorPlatformDevice(const VectorPlatformDevice&); |
126 const VectorPlatformDevice& operator=(const VectorPlatformDevice&); | 124 const VectorPlatformDevice& operator=(const VectorPlatformDevice&); |
127 }; | 125 }; |
128 | 126 |
129 } // namespace skia | 127 } // namespace skia |
130 | 128 |
131 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_LINUX_H_ | 129 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_LINUX_H_ |
OLD | NEW |