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