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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 fBlock = NULL; | 130 fBlock = NULL; |
131 } | 131 } |
132 | 132 |
133 // Release all allocated blocks | 133 // Release all allocated blocks |
134 fAllocator.reset(); | 134 fAllocator.reset(); |
135 } | 135 } |
136 | 136 |
137 //----------------------------------------------------------------------------- | 137 //----------------------------------------------------------------------------- |
138 // DeferredDevice | 138 // DeferredDevice |
139 //----------------------------------------------------------------------------- | 139 //----------------------------------------------------------------------------- |
| 140 // FIXME: Derive from SkBaseDevice. |
140 class DeferredDevice : public SkBitmapDevice { | 141 class DeferredDevice : public SkBitmapDevice { |
141 public: | 142 public: |
142 explicit DeferredDevice(SkBaseDevice* immediateDevice); | 143 explicit DeferredDevice(SkBaseDevice* immediateDevice); |
143 explicit DeferredDevice(SkSurface* surface); | 144 explicit DeferredDevice(SkSurface* surface); |
144 ~DeferredDevice(); | 145 ~DeferredDevice(); |
145 | 146 |
146 void setNotificationClient(SkDeferredCanvas::NotificationClient* notificatio
nClient); | 147 void setNotificationClient(SkDeferredCanvas::NotificationClient* notificatio
nClient); |
147 SkCanvas* recordingCanvas(); | 148 SkCanvas* recordingCanvas(); |
148 SkCanvas* immediateCanvas() const {return fImmediateCanvas;} | 149 SkCanvas* immediateCanvas() const {return fImmediateCanvas;} |
149 SkBaseDevice* immediateDevice() const {return fImmediateCanvas->getTopDevice
();} | 150 SkBaseDevice* immediateDevice() const {return fImmediateCanvas->getTopDevice
();} |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 {SkASSERT(0);} | 191 {SkASSERT(0);} |
191 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE | 192 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE |
192 {SkASSERT(0);} | 193 {SkASSERT(0);} |
193 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, | 194 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, |
194 size_t count, const SkPoint[], | 195 size_t count, const SkPoint[], |
195 const SkPaint& paint) SK_OVERRIDE | 196 const SkPaint& paint) SK_OVERRIDE |
196 {SkASSERT(0);} | 197 {SkASSERT(0);} |
197 virtual void drawRect(const SkDraw&, const SkRect& r, | 198 virtual void drawRect(const SkDraw&, const SkRect& r, |
198 const SkPaint& paint) SK_OVERRIDE | 199 const SkPaint& paint) SK_OVERRIDE |
199 {SkASSERT(0);} | 200 {SkASSERT(0);} |
| 201 virtual void drawRRect(const SkDraw&, const SkRRect& rr, |
| 202 const SkPaint& paint) SK_OVERRIDE |
| 203 {SkASSERT(0);} |
200 virtual void drawPath(const SkDraw&, const SkPath& path, | 204 virtual void drawPath(const SkDraw&, const SkPath& path, |
201 const SkPaint& paint, | 205 const SkPaint& paint, |
202 const SkMatrix* prePathMatrix = NULL, | 206 const SkMatrix* prePathMatrix = NULL, |
203 bool pathIsMutable = false) SK_OVERRIDE | 207 bool pathIsMutable = false) SK_OVERRIDE |
204 {SkASSERT(0);} | 208 {SkASSERT(0);} |
205 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, | 209 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, |
206 const SkMatrix& matrix, const SkPaint& paint) SK_OVE
RRIDE | 210 const SkMatrix& matrix, const SkPaint& paint) SK_OVE
RRIDE |
207 {SkASSERT(0);} | 211 {SkASSERT(0);} |
208 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, | 212 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, |
209 int x, int y, const SkPaint& paint) SK_OVERRIDE | 213 int x, int y, const SkPaint& paint) SK_OVERRIDE |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { | 1007 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { |
1004 this->drawingCanvas()->setDrawFilter(filter); | 1008 this->drawingCanvas()->setDrawFilter(filter); |
1005 this->INHERITED::setDrawFilter(filter); | 1009 this->INHERITED::setDrawFilter(filter); |
1006 this->recordedDrawCommand(); | 1010 this->recordedDrawCommand(); |
1007 return filter; | 1011 return filter; |
1008 } | 1012 } |
1009 | 1013 |
1010 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { | 1014 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { |
1011 return this->drawingCanvas(); | 1015 return this->drawingCanvas(); |
1012 } | 1016 } |
OLD | NEW |