OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkDeferredCanvas.h" | 9 #include "SkDeferredCanvas.h" |
10 | 10 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 int x, int y, | 179 int x, int y, |
180 SkCanvas::Config8888 config8888) SK_OVERRIDE; | 180 SkCanvas::Config8888 config8888) SK_OVERRIDE; |
181 | 181 |
182 // The following methods are no-ops on a deferred device | 182 // The following methods are no-ops on a deferred device |
183 virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) | 183 virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) |
184 SK_OVERRIDE | 184 SK_OVERRIDE |
185 {return false;} | 185 {return false;} |
186 | 186 |
187 // None of the following drawing methods should ever get called on the | 187 // None of the following drawing methods should ever get called on the |
188 // deferred device | 188 // deferred device |
189 virtual void clear(SkColor color) | 189 virtual void clear(SkColor color) SK_OVERRIDE |
190 {SkASSERT(0);} | 190 {SkASSERT(0);} |
191 virtual void drawPaint(const SkDraw&, const SkPaint& paint) | 191 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE |
192 {SkASSERT(0);} | 192 {SkASSERT(0);} |
193 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, | 193 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, |
194 size_t count, const SkPoint[], | 194 size_t count, const SkPoint[], |
195 const SkPaint& paint) | 195 const SkPaint& paint) SK_OVERRIDE |
196 {SkASSERT(0);} | 196 {SkASSERT(0);} |
197 virtual void drawRect(const SkDraw&, const SkRect& r, | 197 virtual void drawRect(const SkDraw&, const SkRect& r, |
198 const SkPaint& paint) | 198 const SkPaint& paint) SK_OVERRIDE |
199 {SkASSERT(0);} | 199 {SkASSERT(0);} |
200 virtual void drawPath(const SkDraw&, const SkPath& path, | 200 virtual void drawPath(const SkDraw&, const SkPath& path, |
201 const SkPaint& paint, | 201 const SkPaint& paint, |
202 const SkMatrix* prePathMatrix = NULL, | 202 const SkMatrix* prePathMatrix = NULL, |
203 bool pathIsMutable = false) | 203 bool pathIsMutable = false) SK_OVERRIDE |
204 {SkASSERT(0);} | 204 {SkASSERT(0);} |
205 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, | 205 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, |
206 const SkIRect* srcRectOrNull, | 206 const SkIRect* srcRectOrNull, |
207 const SkMatrix& matrix, const SkPaint& paint) | 207 const SkMatrix& matrix, const SkPaint& paint) SK_OVE
RRIDE |
208 {SkASSERT(0);} | 208 {SkASSERT(0);} |
209 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, | 209 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, |
210 int x, int y, const SkPaint& paint) | 210 int x, int y, const SkPaint& paint) SK_OVERRIDE |
211 {SkASSERT(0);} | 211 {SkASSERT(0);} |
212 virtual void drawText(const SkDraw&, const void* text, size_t len, | 212 virtual void drawText(const SkDraw&, const void* text, size_t len, |
213 SkScalar x, SkScalar y, const SkPaint& paint) | 213 SkScalar x, SkScalar y, const SkPaint& paint) SK_OVE
RRIDE |
214 {SkASSERT(0);} | 214 {SkASSERT(0);} |
215 virtual void drawPosText(const SkDraw&, const void* text, size_t len, | 215 virtual void drawPosText(const SkDraw&, const void* text, size_t len, |
216 const SkScalar pos[], SkScalar constY, | 216 const SkScalar pos[], SkScalar constY, |
217 int scalarsPerPos, const SkPaint& paint) | 217 int scalarsPerPos, const SkPaint& paint) SK_OVER
RIDE |
218 {SkASSERT(0);} | 218 {SkASSERT(0);} |
219 virtual void drawTextOnPath(const SkDraw&, const void* text, | 219 virtual void drawTextOnPath(const SkDraw&, const void* text, |
220 size_t len, const SkPath& path, | 220 size_t len, const SkPath& path, |
221 const SkMatrix* matrix, | 221 const SkMatrix* matrix, |
222 const SkPaint& paint) | 222 const SkPaint& paint) SK_OVERRIDE |
223 {SkASSERT(0);} | 223 {SkASSERT(0);} |
| 224 #ifdef SK_BUILD_FOR_ANDROID |
224 virtual void drawPosTextOnPath(const SkDraw& draw, const void* text, | 225 virtual void drawPosTextOnPath(const SkDraw& draw, const void* text, |
225 size_t len, const SkPoint pos[], | 226 size_t len, const SkPoint pos[], |
226 const SkPaint& paint, | 227 const SkPaint& paint, |
227 const SkPath& path, | 228 const SkPath& path, |
228 const SkMatrix* matrix) | 229 const SkMatrix* matrix) SK_OVERRIDE |
229 {SkASSERT(0);} | 230 {SkASSERT(0);} |
| 231 #endif |
230 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, | 232 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, |
231 int vertexCount, const SkPoint verts[], | 233 int vertexCount, const SkPoint verts[], |
232 const SkPoint texs[], const SkColor colors[], | 234 const SkPoint texs[], const SkColor colors[], |
233 SkXfermode* xmode, const uint16_t indices[], | 235 SkXfermode* xmode, const uint16_t indices[], |
234 int indexCount, const SkPaint& paint) | 236 int indexCount, const SkPaint& paint) SK_OVERRID
E |
235 {SkASSERT(0);} | 237 {SkASSERT(0);} |
236 virtual void drawDevice(const SkDraw&, SkDevice*, int x, int y, | 238 virtual void drawDevice(const SkDraw&, SkDevice*, int x, int y, |
237 const SkPaint&) | 239 const SkPaint&) SK_OVERRIDE |
238 {SkASSERT(0);} | 240 {SkASSERT(0);} |
239 private: | 241 private: |
240 virtual void flush(); | 242 virtual void flush() SK_OVERRIDE; |
241 | 243 |
242 void beginRecording(); | 244 void beginRecording(); |
243 void init(); | 245 void init(); |
244 | 246 |
245 DeferredPipeController fPipeController; | 247 DeferredPipeController fPipeController; |
246 SkGPipeWriter fPipeWriter; | 248 SkGPipeWriter fPipeWriter; |
247 SkCanvas* fImmediateCanvas; | 249 SkCanvas* fImmediateCanvas; |
248 SkCanvas* fRecordingCanvas; | 250 SkCanvas* fRecordingCanvas; |
249 SkSurface* fSurface; | 251 SkSurface* fSurface; |
250 SkDeferredCanvas::NotificationClient* fNotificationClient; | 252 SkDeferredCanvas::NotificationClient* fNotificationClient; |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { | 1008 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { |
1007 this->drawingCanvas()->setDrawFilter(filter); | 1009 this->drawingCanvas()->setDrawFilter(filter); |
1008 this->INHERITED::setDrawFilter(filter); | 1010 this->INHERITED::setDrawFilter(filter); |
1009 this->recordedDrawCommand(); | 1011 this->recordedDrawCommand(); |
1010 return filter; | 1012 return filter; |
1011 } | 1013 } |
1012 | 1014 |
1013 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { | 1015 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { |
1014 return this->drawingCanvas(); | 1016 return this->drawingCanvas(); |
1015 } | 1017 } |
OLD | NEW |