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 SkXMLWriter; | 13 class SkXMLWriter; |
14 | 14 |
15 class SkSVGDevice : public SkBaseDevice { | 15 class SkSVGDevice : public SkBaseDevice { |
16 public: | 16 public: |
17 static SkBaseDevice* Create(const SkISize& size, SkXMLWriter* writer); | 17 static SkBaseDevice* Create(const SkISize& size, SkXMLWriter* writer); |
18 | 18 |
19 virtual SkImageInfo imageInfo() const SK_OVERRIDE; | 19 virtual SkImageInfo imageInfo() const override; |
20 | 20 |
21 protected: | 21 protected: |
22 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; | 22 virtual void drawPaint(const SkDraw&, const SkPaint& paint) override; |
23 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, |
24 const SkPoint[], const SkPaint& paint) SK_OVERRIDE; | 24 const SkPoint[], const SkPaint& paint) override; |
25 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)
override; |
26 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) override; |
27 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) override; |
28 virtual void drawPath(const SkDraw&, const SkPath& path, | 28 virtual void drawPath(const SkDraw&, const SkPath& path, |
29 const SkPaint& paint, | 29 const SkPaint& paint, |
30 const SkMatrix* prePathMatrix = NULL, | 30 const SkMatrix* prePathMatrix = NULL, |
31 bool pathIsMutable = false) SK_OVERRIDE; | 31 bool pathIsMutable = false) override; |
32 | 32 |
33 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, | 33 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, |
34 const SkMatrix& matrix, const SkPaint& paint) SK_OVE
RRIDE; | 34 const SkMatrix& matrix, const SkPaint& paint) overri
de; |
35 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, | 35 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, |
36 int x, int y, const SkPaint& paint) SK_OVERRIDE; | 36 int x, int y, const SkPaint& paint) override; |
37 virtual void drawBitmapRect(const SkDraw&, const SkBitmap&, | 37 virtual void drawBitmapRect(const SkDraw&, const SkBitmap&, |
38 const SkRect* srcOrNull, const SkRect& dst, | 38 const SkRect* srcOrNull, const SkRect& dst, |
39 const SkPaint& paint, | 39 const SkPaint& paint, |
40 SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE
; | 40 SkCanvas::DrawBitmapRectFlags flags) override; |
41 | 41 |
42 virtual void drawText(const SkDraw&, const void* text, size_t len, | 42 virtual void drawText(const SkDraw&, const void* text, size_t len, |
43 SkScalar x, SkScalar y, const SkPaint& paint) SK_OVERR
IDE; | 43 SkScalar x, SkScalar y, const SkPaint& paint) override
; |
44 virtual void drawPosText(const SkDraw&, const void* text, size_t len, | 44 virtual void drawPosText(const SkDraw&, const void* text, size_t len, |
45 const SkScalar pos[], int scalarsPerPos, | 45 const SkScalar pos[], int scalarsPerPos, |
46 const SkPoint& offset, const SkPaint& paint) SK_OVE
RRIDE; | 46 const SkPoint& offset, const SkPaint& paint) overri
de; |
47 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, | 47 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, |
48 const SkPath& path, const SkMatrix* matrix, | 48 const SkPath& path, const SkMatrix* matrix, |
49 const SkPaint& paint) SK_OVERRIDE; | 49 const SkPaint& paint) override; |
50 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, | 50 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, |
51 const SkPoint verts[], const SkPoint texs[], | 51 const SkPoint verts[], const SkPoint texs[], |
52 const SkColor colors[], SkXfermode* xmode, | 52 const SkColor colors[], SkXfermode* xmode, |
53 const uint16_t indices[], int indexCount, | 53 const uint16_t indices[], int indexCount, |
54 const SkPaint& paint) SK_OVERRIDE; | 54 const SkPaint& paint) override; |
55 | 55 |
56 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 56 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
57 const SkPaint&) SK_OVERRIDE; | 57 const SkPaint&) override; |
58 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; | 58 virtual const SkBitmap& onAccessBitmap() override; |
59 | 59 |
60 private: | 60 private: |
61 SkSVGDevice(const SkISize& size, SkXMLWriter* writer); | 61 SkSVGDevice(const SkISize& size, SkXMLWriter* writer); |
62 virtual ~SkSVGDevice(); | 62 virtual ~SkSVGDevice(); |
63 | 63 |
64 void drawBitmapCommon(const SkDraw& draw, const SkBitmap& bm, const SkPaint&
paint); | 64 void drawBitmapCommon(const SkDraw& draw, const SkBitmap& bm, const SkPaint&
paint); |
65 | 65 |
66 class AutoElement; | 66 class AutoElement; |
67 class ResourceBucket; | 67 class ResourceBucket; |
68 | 68 |
69 SkXMLWriter* fWriter; | 69 SkXMLWriter* fWriter; |
70 SkAutoTDelete<AutoElement> fRootElement; | 70 SkAutoTDelete<AutoElement> fRootElement; |
71 SkAutoTDelete<ResourceBucket> fResourceBucket; | 71 SkAutoTDelete<ResourceBucket> fResourceBucket; |
72 SkBitmap fLegacyBitmap; | 72 SkBitmap fLegacyBitmap; |
73 }; | 73 }; |
74 | 74 |
75 #endif // SkSVGDevice_DEFINED | 75 #endif // SkSVGDevice_DEFINED |
OLD | NEW |