OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkSVGDevice_DEFINED | 8 #ifndef SkSVGDevice_DEFINED |
9 #define SkSVGDevice_DEFINED | 9 #define SkSVGDevice_DEFINED |
10 | 10 |
11 #include "SkDevice.h" | 11 #include "SkDevice.h" |
12 | 12 |
13 class SkWStream; | |
14 class SkXMLWriter; | 13 class SkXMLWriter; |
15 | 14 |
16 class SkSVGDevice : public SkBaseDevice { | 15 class SkSVGDevice : public SkBaseDevice { |
17 public: | 16 public: |
18 static SkBaseDevice* Create(const SkISize& size, SkWStream* wstream); | 17 static SkBaseDevice* Create(const SkISize& size, SkXMLWriter* writer); |
19 | 18 |
20 virtual SkImageInfo imageInfo() const SK_OVERRIDE; | 19 virtual SkImageInfo imageInfo() const SK_OVERRIDE; |
21 | 20 |
22 protected: | 21 protected: |
23 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; | 22 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; |
24 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t coun
t, | 23 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t coun
t, |
25 const SkPoint[], const SkPaint& paint) SK_OVERRIDE; | 24 const SkPoint[], const SkPaint& paint) SK_OVERRIDE; |
26 virtual void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint)
SK_OVERRIDE; | 25 virtual void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint)
SK_OVERRIDE; |
27 virtual void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& pain
t) SK_OVERRIDE; | 26 virtual void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& pain
t) SK_OVERRIDE; |
28 virtual void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& pain
t) SK_OVERRIDE; | 27 virtual void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& pain
t) SK_OVERRIDE; |
(...skipping 23 matching lines...) Expand all Loading... |
52 const SkPoint verts[], const SkPoint texs[], | 51 const SkPoint verts[], const SkPoint texs[], |
53 const SkColor colors[], SkXfermode* xmode, | 52 const SkColor colors[], SkXfermode* xmode, |
54 const uint16_t indices[], int indexCount, | 53 const uint16_t indices[], int indexCount, |
55 const SkPaint& paint) SK_OVERRIDE; | 54 const SkPaint& paint) SK_OVERRIDE; |
56 | 55 |
57 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 56 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
58 const SkPaint&) SK_OVERRIDE; | 57 const SkPaint&) SK_OVERRIDE; |
59 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; | 58 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; |
60 | 59 |
61 private: | 60 private: |
62 SkSVGDevice(const SkISize& size, SkWStream* wstream); | 61 SkSVGDevice(const SkISize& size, SkXMLWriter* writer); |
63 virtual ~SkSVGDevice(); | 62 virtual ~SkSVGDevice(); |
64 | 63 |
65 class AutoElement; | 64 class AutoElement; |
66 class ResourceBucket; | 65 class ResourceBucket; |
67 | 66 |
68 SkAutoTDelete<SkXMLWriter> fWriter; | 67 SkXMLWriter* fWriter; |
69 SkAutoTDelete<AutoElement> fRootElement; | 68 SkAutoTDelete<AutoElement> fRootElement; |
70 SkAutoTDelete<ResourceBucket> fResourceBucket; | 69 SkAutoTDelete<ResourceBucket> fResourceBucket; |
71 SkBitmap fLegacyBitmap; | 70 SkBitmap fLegacyBitmap; |
72 }; | 71 }; |
73 | 72 |
74 #endif // SkSVGDevice_DEFINED | 73 #endif // SkSVGDevice_DEFINED |
OLD | NEW |