Chromium Code Reviews| 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 |