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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 bool doAntiAlias) SK_OVERRIDE; | 155 bool doAntiAlias) SK_OVERRIDE; |
156 virtual bool clipPath(const SkPath& path, SkRegion::Op op, | 156 virtual bool clipPath(const SkPath& path, SkRegion::Op op, |
157 bool doAntiAlias) SK_OVERRIDE; | 157 bool doAntiAlias) SK_OVERRIDE; |
158 virtual bool clipRegion(const SkRegion& deviceRgn, | 158 virtual bool clipRegion(const SkRegion& deviceRgn, |
159 SkRegion::Op op) SK_OVERRIDE; | 159 SkRegion::Op op) SK_OVERRIDE; |
160 virtual void clear(SkColor) SK_OVERRIDE; | 160 virtual void clear(SkColor) SK_OVERRIDE; |
161 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; | 161 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; |
162 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], | 162 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], |
163 const SkPaint& paint) SK_OVERRIDE; | 163 const SkPaint& paint) SK_OVERRIDE; |
164 virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE; | 164 virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE; |
| 165 virtual void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE; |
165 virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE; | 166 virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE; |
| 167 virtual void drawPath(const SkPath& path, const SkPaint& paint) |
| 168 SK_OVERRIDE; |
166 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, | 169 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, |
167 SkScalar top, const SkPaint* paint) | 170 SkScalar top, const SkPaint* paint) |
168 SK_OVERRIDE; | 171 SK_OVERRIDE; |
169 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, | 172 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, |
170 const SkRect& dst, const SkPaint* paint, | 173 const SkRect& dst, const SkPaint* paint, |
171 DrawBitmapRectFlags flags) SK_OVERRIDE; | 174 DrawBitmapRectFlags flags) SK_OVERRIDE; |
172 | 175 |
173 virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, | 176 virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, |
174 const SkPaint* paint) SK_OVERRIDE; | 177 const SkPaint* paint) SK_OVERRIDE; |
175 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, | 178 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 227 |
225 /** | 228 /** |
226 * Called after pending draw commands have been skipped, meaning | 229 * Called after pending draw commands have been skipped, meaning |
227 * that they were optimized-out because the canvas is cleared | 230 * that they were optimized-out because the canvas is cleared |
228 * or completely overwritten by the command currently being recorded. | 231 * or completely overwritten by the command currently being recorded. |
229 */ | 232 */ |
230 virtual void skippedPendingDrawCommands() {} | 233 virtual void skippedPendingDrawCommands() {} |
231 }; | 234 }; |
232 | 235 |
233 protected: | 236 protected: |
234 virtual void onDrawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRID
E; | |
235 virtual void onDrawPath(const SkPath& path, const SkPaint& paint) SK_OVERRID
E; | |
236 virtual SkCanvas* canvasForDrawIter(); | 237 virtual SkCanvas* canvasForDrawIter(); |
237 DeferredDevice* getDeferredDevice() const; | 238 DeferredDevice* getDeferredDevice() const; |
238 | 239 |
239 private: | 240 private: |
240 SkDeferredCanvas(DeferredDevice*); | 241 SkDeferredCanvas(DeferredDevice*); |
241 | 242 |
242 void recordedDrawCommand(); | 243 void recordedDrawCommand(); |
243 SkCanvas* drawingCanvas() const; | 244 SkCanvas* drawingCanvas() const; |
244 SkCanvas* immediateCanvas() const; | 245 SkCanvas* immediateCanvas() const; |
245 bool isFullFrame(const SkRect*, const SkPaint*) const; | 246 bool isFullFrame(const SkRect*, const SkPaint*) const; |
246 void validate() const; | 247 void validate() const; |
247 void init(); | 248 void init(); |
248 bool fDeferredDrawing; | 249 bool fDeferredDrawing; |
249 | 250 |
250 friend class SkDeferredCanvasTester; // for unit testing | 251 friend class SkDeferredCanvasTester; // for unit testing |
251 typedef SkCanvas INHERITED; | 252 typedef SkCanvas INHERITED; |
252 }; | 253 }; |
253 | 254 |
254 | 255 |
255 #endif | 256 #endif |
OLD | NEW |