OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkRecorder_DEFINED | 8 #ifndef SkRecorder_DEFINED |
9 #define SkRecorder_DEFINED | 9 #define SkRecorder_DEFINED |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 // Does not take ownership of the SkRecord. | 38 // Does not take ownership of the SkRecord. |
39 SkRecorder(SkRecord*, int width, int height); // legacy version | 39 SkRecorder(SkRecord*, int width, int height); // legacy version |
40 SkRecorder(SkRecord*, const SkRect& bounds); | 40 SkRecorder(SkRecord*, const SkRect& bounds); |
41 | 41 |
42 SkDrawableList* getDrawableList() const { return fDrawableList.get(); } | 42 SkDrawableList* getDrawableList() const { return fDrawableList.get(); } |
43 SkDrawableList* detachDrawableList() { return fDrawableList.detach(); } | 43 SkDrawableList* detachDrawableList() { return fDrawableList.detach(); } |
44 | 44 |
45 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. | 45 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. |
46 void forgetRecord(); | 46 void forgetRecord(); |
47 | 47 |
48 void willSave() SK_OVERRIDE; | 48 void willSave() override; |
49 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav
eFlags) SK_OVERRIDE; | 49 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav
eFlags) override; |
50 void willRestore() SK_OVERRIDE {} | 50 void willRestore() override {} |
51 void didRestore() SK_OVERRIDE; | 51 void didRestore() override; |
52 | 52 |
53 void didConcat(const SkMatrix&) SK_OVERRIDE; | 53 void didConcat(const SkMatrix&) override; |
54 void didSetMatrix(const SkMatrix&) SK_OVERRIDE; | 54 void didSetMatrix(const SkMatrix&) override; |
55 | 55 |
56 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRID
E; | 56 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override; |
57 void onDrawDrawable(SkDrawable*) SK_OVERRIDE; | 57 void onDrawDrawable(SkDrawable*) override; |
58 void onDrawText(const void* text, | 58 void onDrawText(const void* text, |
59 size_t byteLength, | 59 size_t byteLength, |
60 SkScalar x, | 60 SkScalar x, |
61 SkScalar y, | 61 SkScalar y, |
62 const SkPaint& paint) SK_OVERRIDE; | 62 const SkPaint& paint) override; |
63 void onDrawPosText(const void* text, | 63 void onDrawPosText(const void* text, |
64 size_t byteLength, | 64 size_t byteLength, |
65 const SkPoint pos[], | 65 const SkPoint pos[], |
66 const SkPaint& paint) SK_OVERRIDE; | 66 const SkPaint& paint) override; |
67 void onDrawPosTextH(const void* text, | 67 void onDrawPosTextH(const void* text, |
68 size_t byteLength, | 68 size_t byteLength, |
69 const SkScalar xpos[], | 69 const SkScalar xpos[], |
70 SkScalar constY, | 70 SkScalar constY, |
71 const SkPaint& paint) SK_OVERRIDE; | 71 const SkPaint& paint) override; |
72 void onDrawTextOnPath(const void* text, | 72 void onDrawTextOnPath(const void* text, |
73 size_t byteLength, | 73 size_t byteLength, |
74 const SkPath& path, | 74 const SkPath& path, |
75 const SkMatrix* matrix, | 75 const SkMatrix* matrix, |
76 const SkPaint& paint) SK_OVERRIDE; | 76 const SkPaint& paint) override; |
77 void onDrawTextBlob(const SkTextBlob* blob, | 77 void onDrawTextBlob(const SkTextBlob* blob, |
78 SkScalar x, | 78 SkScalar x, |
79 SkScalar y, | 79 SkScalar y, |
80 const SkPaint& paint) SK_OVERRIDE; | 80 const SkPaint& paint) override; |
81 void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | 81 void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
82 const SkPoint texCoords[4], SkXfermode* xmode, | 82 const SkPoint texCoords[4], SkXfermode* xmode, |
83 const SkPaint& paint) SK_OVERRIDE; | 83 const SkPaint& paint) override; |
84 | 84 |
85 void onDrawPaint(const SkPaint&) SK_OVERRIDE; | 85 void onDrawPaint(const SkPaint&) override; |
86 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPain
t&) SK_OVERRIDE; | 86 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPain
t&) override; |
87 void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; | 87 void onDrawRect(const SkRect&, const SkPaint&) override; |
88 void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; | 88 void onDrawOval(const SkRect&, const SkPaint&) override; |
89 void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; | 89 void onDrawRRect(const SkRRect&, const SkPaint&) override; |
90 void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE; | 90 void onDrawPath(const SkPath&, const SkPaint&) override; |
91 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPain
t*) SK_OVERRIDE; | 91 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPain
t*) override; |
92 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst,
const SkPaint*, | 92 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst,
const SkPaint*, |
93 DrawBitmapRectFlags flags) SK_OVERRIDE; | 93 DrawBitmapRectFlags flags) override; |
94 void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*
) SK_OVERRIDE; | 94 void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*
) override; |
95 void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, | 95 void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, |
96 const SkPaint*) SK_OVERRIDE; | 96 const SkPaint*) override; |
97 void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect&
dst, | 97 void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect&
dst, |
98 const SkPaint*) SK_OVERRIDE; | 98 const SkPaint*) override; |
99 void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVE
RRIDE; | 99 void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) overri
de; |
100 void onDrawVertices(VertexMode vmode, int vertexCount, | 100 void onDrawVertices(VertexMode vmode, int vertexCount, |
101 const SkPoint vertices[], const SkPoint texs[], | 101 const SkPoint vertices[], const SkPoint texs[], |
102 const SkColor colors[], SkXfermode* xmode, | 102 const SkColor colors[], SkXfermode* xmode, |
103 const uint16_t indices[], int indexCount, | 103 const uint16_t indices[], int indexCount, |
104 const SkPaint&) SK_OVERRIDE; | 104 const SkPaint&) override; |
105 | 105 |
106 void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle
) SK_OVERRIDE; | 106 void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle
) override; |
107 void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeSt
yle) SK_OVERRIDE; | 107 void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeSt
yle) override; |
108 void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle
) SK_OVERRIDE; | 108 void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle
) override; |
109 void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) SK_OVERRIDE; | 109 void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) override; |
110 | 110 |
111 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) SK_OVE
RRIDE; | 111 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) overri
de; |
112 | 112 |
113 void beginCommentGroup(const char*) SK_OVERRIDE; | 113 void beginCommentGroup(const char*) override; |
114 void addComment(const char*, const char*) SK_OVERRIDE; | 114 void addComment(const char*, const char*) override; |
115 void endCommentGroup() SK_OVERRIDE; | 115 void endCommentGroup() override; |
116 | 116 |
117 SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRI
DE { return NULL; } | 117 SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) override
{ return NULL; } |
118 | 118 |
119 private: | 119 private: |
120 template <typename T> | 120 template <typename T> |
121 T* copy(const T*); | 121 T* copy(const T*); |
122 | 122 |
123 template <typename T> | 123 template <typename T> |
124 T* copy(const T[], size_t count); | 124 T* copy(const T[], size_t count); |
125 | 125 |
126 SkIRect devBounds() const { | 126 SkIRect devBounds() const { |
127 SkIRect devBounds; | 127 SkIRect devBounds; |
128 this->getClipDeviceBounds(&devBounds); | 128 this->getClipDeviceBounds(&devBounds); |
129 return devBounds; | 129 return devBounds; |
130 } | 130 } |
131 | 131 |
132 SkRecord* fRecord; | 132 SkRecord* fRecord; |
133 | 133 |
134 SkAutoTDelete<SkDrawableList> fDrawableList; | 134 SkAutoTDelete<SkDrawableList> fDrawableList; |
135 }; | 135 }; |
136 | 136 |
137 #endif//SkRecorder_DEFINED | 137 #endif//SkRecorder_DEFINED |
OLD | NEW |