Index: src/core/SkPictureRecorder.cpp |
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp |
index a22cf5df145637021cbf918577a3381cf1501356..844b0e765b8bba8e937ee2834837492817ad2c1d 100644 |
--- a/src/core/SkPictureRecorder.cpp |
+++ b/src/core/SkPictureRecorder.cpp |
@@ -5,6 +5,9 @@ |
* found in the LICENSE file. |
*/ |
+#ifdef SK_BUILD_FOR_ANDROID |
+#include "SkPicturePlayback.h" |
+#endif |
#include "SkPictureRecorder.h" |
SkCanvas* SkPictureRecorder::beginRecording(int width, int height, |
@@ -13,3 +16,19 @@ SkCanvas* SkPictureRecorder::beginRecording(int width, int height, |
fPicture.reset(SkNEW(SkPicture)); |
return fPicture->beginRecording(width, height, bbhFactory, recordFlags); |
} |
+ |
+#ifdef SK_BUILD_FOR_ANDROID |
+void SkPictureRecorder::partialReplay(SkCanvas* canvas) { |
+ if (NULL == fPicture.get() || NULL == canvas) { |
+ // Not recording or nothing to replay into |
+ return; |
+ } |
+ |
+ SkASSERT(NULL != fPicture->fRecord); |
+ |
+ SkAutoTDelete<SkPicturePlayback> playback(SkPicture::FakeEndRecording(fPicture, |
+ *fPicture->fRecord, |
+ false)); |
+ playback->draw(*canvas, NULL); |
+} |
+#endif |