OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkDeferredCanvas_DEFINED | 8 #ifndef SkDeferredCanvas_DEFINED |
9 #define SkDeferredCanvas_DEFINED | 9 #define SkDeferredCanvas_DEFINED |
10 | 10 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 * rendered using the deferred canvas. | 136 * rendered using the deferred canvas. |
137 */ | 137 */ |
138 void setBitmapSizeThreshold(size_t sizeThreshold); | 138 void setBitmapSizeThreshold(size_t sizeThreshold); |
139 size_t getBitmapSizeThreshold() const { return fBitmapSizeThreshold; } | 139 size_t getBitmapSizeThreshold() const { return fBitmapSizeThreshold; } |
140 | 140 |
141 /** | 141 /** |
142 * Executes all pending commands without drawing | 142 * Executes all pending commands without drawing |
143 */ | 143 */ |
144 void silentFlush(); | 144 void silentFlush(); |
145 | 145 |
146 // Overrides of the SkCanvas interface | |
147 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; | |
148 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], | |
149 const SkPaint& paint) SK_OVERRIDE; | |
150 virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE; | |
151 virtual void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE; | |
152 virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE; | |
153 virtual void drawPath(const SkPath& path, const SkPaint& paint) | |
154 SK_OVERRIDE; | |
155 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, | |
156 SkScalar top, const SkPaint* paint) | |
157 SK_OVERRIDE; | |
158 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, | |
159 const SkRect& dst, const SkPaint* paint, | |
160 DrawBitmapRectFlags flags) SK_OVERRIDE; | |
161 | |
162 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, | |
163 const SkRect& dst, const SkPaint* paint) | |
164 SK_OVERRIDE; | |
165 virtual void drawSprite(const SkBitmap& bitmap, int left, int top, | |
166 const SkPaint* paint) SK_OVERRIDE; | |
167 virtual void drawVertices(VertexMode vmode, int vertexCount, | |
168 const SkPoint vertices[], const SkPoint texs[], | |
169 const SkColor colors[], SkXfermode* xmode, | |
170 const uint16_t indices[], int indexCount, | |
171 const SkPaint& paint) SK_OVERRIDE; | |
172 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE; | 146 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE; |
173 | 147 |
174 protected: | 148 protected: |
175 virtual void willSave() SK_OVERRIDE; | 149 virtual void willSave() SK_OVERRIDE; |
176 virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveF
lags) SK_OVERRIDE; | 150 virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveF
lags) SK_OVERRIDE; |
177 virtual void willRestore() SK_OVERRIDE; | 151 virtual void willRestore() SK_OVERRIDE; |
178 | 152 |
179 virtual void didConcat(const SkMatrix&) SK_OVERRIDE; | 153 virtual void didConcat(const SkMatrix&) SK_OVERRIDE; |
180 virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE; | 154 virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE; |
181 | 155 |
182 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK
_OVERRIDE; | 156 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK
_OVERRIDE; |
183 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkS
calar y, | 157 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkS
calar y, |
184 const SkPaint&) SK_OVERRIDE; | 158 const SkPaint&) SK_OVERRIDE; |
185 virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoin
t pos[], | 159 virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoin
t pos[], |
186 const SkPaint&) SK_OVERRIDE; | 160 const SkPaint&) SK_OVERRIDE; |
187 virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkSca
lar xpos[], | 161 virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkSca
lar xpos[], |
188 SkScalar constY, const SkPaint&) SK_OVERRIDE; | 162 SkScalar constY, const SkPaint&) SK_OVERRIDE; |
189 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP
ath& path, | 163 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP
ath& path, |
190 const SkMatrix* matrix, const SkPaint&) SK_OVE
RRIDE; | 164 const SkMatrix* matrix, const SkPaint&) SK_OVE
RRIDE; |
191 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, | 165 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
192 const SkPaint& paint) SK_OVERRIDE; | 166 const SkPaint& paint) SK_OVERRIDE; |
193 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | 167 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
194 const SkPoint texCoords[4], SkXfermode* xmode, | 168 const SkPoint texCoords[4], SkXfermode* xmode, |
195 const SkPaint& paint) SK_OVERRIDE; | 169 const SkPaint& paint) SK_OVERRIDE; |
196 | 170 |
| 171 void onDrawPaint(const SkPaint&) SK_OVERRIDE; |
| 172 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPain
t&) SK_OVERRIDE; |
| 173 void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; |
| 174 void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; |
| 175 void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; |
| 176 void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE; |
| 177 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPain
t*) SK_OVERRIDE; |
| 178 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst,
const SkPaint*, |
| 179 DrawBitmapRectFlags flags) SK_OVERRIDE; |
| 180 #if 0 |
| 181 // rely on conversion to bitmap(for now) |
| 182 void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*
) SK_OVERRIDE; |
| 183 void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, |
| 184 const SkPaint*) SK_OVERRIDE; |
| 185 #endif |
| 186 void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect&
dst, |
| 187 const SkPaint*) SK_OVERRIDE; |
| 188 void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVE
RRIDE; |
| 189 void onDrawVertices(VertexMode vmode, int vertexCount, |
| 190 const SkPoint vertices[], const SkPoint texs[], |
| 191 const SkColor colors[], SkXfermode* xmode, |
| 192 const uint16_t indices[], int indexCount, |
| 193 const SkPaint&) SK_OVERRIDE; |
| 194 |
197 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; | 195 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
198 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; | 196 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; |
199 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; | 197 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
200 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; | 198 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; |
201 | 199 |
202 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*
) SK_OVERRIDE; | 200 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*
) SK_OVERRIDE; |
203 | 201 |
204 public: | 202 public: |
205 class NotificationClient { | 203 class NotificationClient { |
206 public: | 204 public: |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 253 |
256 mutable SkISize fCachedCanvasSize; | 254 mutable SkISize fCachedCanvasSize; |
257 mutable bool fCachedCanvasSizeDirty; | 255 mutable bool fCachedCanvasSizeDirty; |
258 | 256 |
259 friend class SkDeferredCanvasTester; // for unit testing | 257 friend class SkDeferredCanvasTester; // for unit testing |
260 typedef SkCanvas INHERITED; | 258 typedef SkCanvas INHERITED; |
261 }; | 259 }; |
262 | 260 |
263 | 261 |
264 #endif | 262 #endif |
OLD | NEW |