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

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: Created 6 years, 8 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
Index: src/core/SkPictureRecorder.cpp
===================================================================
--- src/core/SkPictureRecorder.cpp (revision 14396)
+++ src/core/SkPictureRecorder.cpp (working copy)
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkPicturePlayback.h"
scroggo 2014/04/30 20:05:43 Isn't this only for SK_BUILD_FOR_ANDROID?
#include "SkPictureRecorder.h"
SkCanvas* SkPictureRecorder::beginRecording(int width, int height,
@@ -13,3 +14,22 @@
fPicture.reset(SkNEW(SkPicture));
return fPicture->beginRecording(width, height, bbhFactory, recordFlags);
}
+
+#ifdef SK_BUILD_FOR_ANDROID
+void SkPictureRecorder::replay(SkCanvas* canvas) {
+ if (NULL == fPicture.get() || NULL == canvas) {
+ // Not recording or nothing to replay into
+ return;
+ }
+
+ SkASSERT(NULL != fPicture->fRecord);
+
+ SkPictInfo info;
+ fPicture->createHeader(&info);
+ // here we do a fake src.endRecording()
+ SkAutoTDelete<SkPicturePlayback> playback(SkNEW_ARGS(SkPicturePlayback, (fPicture,
+ *fPicture->fRecord,
+ info)));
+ playback->draw(*canvas, NULL);
+}
+#endif

Powered by Google App Engine
This is Rietveld 408576698