| Index: include/core/SkPictureRecorder.h
|
| diff --git a/include/core/SkPictureRecorder.h b/include/core/SkPictureRecorder.h
|
| index b496aee28e25e54b7239135ff5700eb5d9926156..8ae9a4f229c212df2bf2d79340cfed9dc7e5d088 100644
|
| --- a/include/core/SkPictureRecorder.h
|
| +++ b/include/core/SkPictureRecorder.h
|
| @@ -9,6 +9,7 @@
|
| #define SkPictureRecorder_DEFINED
|
|
|
| #include "SkBBHFactory.h"
|
| +#include "SkCanvas.h"
|
| #include "SkPicture.h"
|
| #include "SkRefCnt.h"
|
|
|
| @@ -16,6 +17,8 @@ class SkCanvas;
|
|
|
| class SK_API SkPictureRecorder : SkNoncopyable {
|
| public:
|
| + SkPictureRecorder() { }
|
| +
|
| /** Returns the canvas that records the drawing commands.
|
| @param width the base width for the picture, as if the recording
|
| canvas' bitmap had this width.
|
| @@ -34,10 +37,7 @@ public:
|
| not active. This does not alter the refcnt on the canvas (if present).
|
| */
|
| SkCanvas* getRecordingCanvas() {
|
| - if (NULL != fPicture.get()) {
|
| - return fPicture->getRecordingCanvas();
|
| - }
|
| - return NULL;
|
| + return fCanvas.get();
|
| }
|
|
|
| /** Signal that the caller is done recording. This invalidates the canvas
|
| @@ -45,13 +45,7 @@ public:
|
| created SkPicture. Note that the returned picture has its creation
|
| ref which the caller must take ownership of.
|
| */
|
| - SkPicture* endRecording() {
|
| - if (NULL != fPicture.get()) {
|
| - fPicture->endRecording();
|
| - return fPicture.detach();
|
| - }
|
| - return NULL;
|
| - }
|
| + SkPicture* endRecording();
|
|
|
| /** Enable/disable all the picture recording optimizations (i.e.,
|
| those in SkPictureRecord). It is mainly intended for testing the
|
| @@ -59,11 +53,7 @@ public:
|
| appear in an .skp we have to disable the optimization). Call right
|
| after 'beginRecording'.
|
| */
|
| - void internalOnly_EnableOpts(bool enableOpts) {
|
| - if (NULL != fPicture.get()) {
|
| - fPicture->internalOnly_EnableOpts(enableOpts);
|
| - }
|
| - }
|
| + void internalOnly_EnableOpts(bool enableOpts);
|
|
|
| private:
|
| #ifdef SK_BUILD_FOR_ANDROID
|
| @@ -76,6 +66,7 @@ private:
|
| #endif
|
|
|
| SkAutoTUnref<SkPicture> fPicture;
|
| + SkAutoTUnref<SkCanvas> fCanvas;
|
|
|
| typedef SkNoncopyable INHERITED;
|
| };
|
|
|