Index: src/utils/SkDeferredCanvas.cpp |
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp |
index 34b9146996edc4e6d0d9da8ba3bef52503042132..3c845b1d65f470bfea98d8afb54db6bb3119138b 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)) { |