Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: src/core/SkPictureRecorder.cpp

Issue 252873005: add replay entry point to SkPictureRecorder for Android (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fix Android compiler issue Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698