diff options
Diffstat (limited to 'src/utils/SkDeferredCanvas.cpp')
-rw-r--r-- | src/utils/SkDeferredCanvas.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index 34b9146996..3c845b1d65 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -170,6 +170,8 @@ protected: // None of the following drawing methods should ever get called on the // deferred device + virtual void clear(SkColor color) SK_OVERRIDE + {SkASSERT(0);} virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE {SkASSERT(0);} virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, @@ -739,6 +741,16 @@ void SkDeferredCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) this->recordedDrawCommand(); } +void SkDeferredCanvas::clear(SkColor color) { + // purge pending commands + if (fDeferredDrawing) { + this->getDeferredDevice()->skipPendingCommands(); + } + + this->drawingCanvas()->clear(color); + this->recordedDrawCommand(); +} + void SkDeferredCanvas::drawPaint(const SkPaint& paint) { if (fDeferredDrawing && this->isFullFrame(NULL, &paint) && isPaintOpaque(&paint)) { |