OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2015 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef SkSVGDevice_DEFINED | |
9 #define SkSVGDevice_DEFINED | |
10 | |
11 #include "SkDevice.h" | |
12 | |
13 class SkWStream; | |
14 class SkXMLWriter; | |
15 | |
16 class SkSVGDevice : public SkBaseDevice { | |
17 public: | |
18 static SkBaseDevice* Create(const SkISize& size, SkWStream* wstream); | |
19 | |
20 virtual SkImageInfo imageInfo() const SK_OVERRIDE; | |
21 | |
22 protected: | |
23 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; | |
24 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t coun
t, | |
25 const SkPoint[], const SkPaint& paint) SK_OVERRIDE; | |
26 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; | |
28 virtual void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& pain
t) SK_OVERRIDE; | |
29 virtual void drawPath(const SkDraw&, const SkPath& path, | |
30 const SkPaint& paint, | |
31 const SkMatrix* prePathMatrix = NULL, | |
32 bool pathIsMutable = false) SK_OVERRIDE; | |
33 | |
34 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, | |
35 const SkMatrix& matrix, const SkPaint& paint) SK_OVE
RRIDE; | |
36 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, | |
37 int x, int y, const SkPaint& paint) SK_OVERRIDE; | |
38 virtual void drawBitmapRect(const SkDraw&, const SkBitmap&, | |
39 const SkRect* srcOrNull, const SkRect& dst, | |
40 const SkPaint& paint, | |
41 SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE
; | |
42 | |
43 virtual void drawText(const SkDraw&, const void* text, size_t len, | |
44 SkScalar x, SkScalar y, const SkPaint& paint) SK_OVERR
IDE; | |
45 virtual void drawPosText(const SkDraw&, const void* text, size_t len, | |
46 const SkScalar pos[], int scalarsPerPos, | |
47 const SkPoint& offset, const SkPaint& paint) SK_OVE
RRIDE; | |
48 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, | |
49 const SkPath& path, const SkMatrix* matrix, | |
50 const SkPaint& paint) SK_OVERRIDE; | |
51 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, | |
52 const SkPoint verts[], const SkPoint texs[], | |
53 const SkColor colors[], SkXfermode* xmode, | |
54 const uint16_t indices[], int indexCount, | |
55 const SkPaint& paint) SK_OVERRIDE; | |
56 | |
57 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | |
58 const SkPaint&) SK_OVERRIDE; | |
59 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; | |
60 | |
61 private: | |
62 SkSVGDevice(const SkISize& size, SkWStream* wstream); | |
63 virtual ~SkSVGDevice(); | |
64 | |
65 class AutoElement; | |
66 class ResourceBucket; | |
67 | |
68 SkAutoTDelete<SkXMLWriter> fWriter; | |
69 SkAutoTDelete<AutoElement> fRootElement; | |
70 SkAutoTDelete<ResourceBucket> fResourceBucket; | |
71 SkBitmap fLegacyBitmap; | |
72 }; | |
73 | |
74 #endif // SkSVGDevice_DEFINED | |
OLD | NEW |