| Index: sky/engine/core/painting/PictureRecorder.cpp
|
| diff --git a/sky/engine/core/painting/PictureRecorder.cpp b/sky/engine/core/painting/PictureRecorder.cpp
|
| index 4896215210088f05beabeffd410676e47a4f8b2b..4eb2bd6418eead57481819e44274bc51d889c24e 100644
|
| --- a/sky/engine/core/painting/PictureRecorder.cpp
|
| +++ b/sky/engine/core/painting/PictureRecorder.cpp
|
| @@ -9,25 +9,31 @@
|
|
|
| namespace blink {
|
|
|
| -PassRefPtr<PictureRecorder> PictureRecorder::create(double width, double height)
|
| +PictureRecorder::PictureRecorder()
|
| + : m_pictureRecorder(adoptPtr(new SkPictureRecorder()))
|
| {
|
| - return adoptRef(new PictureRecorder(FloatSize(width, height)));
|
| }
|
|
|
| -PictureRecorder::PictureRecorder(const FloatSize& size)
|
| - : Canvas(size)
|
| +PictureRecorder::~PictureRecorder()
|
| {
|
| }
|
|
|
| -PictureRecorder::~PictureRecorder()
|
| +PassRefPtr<Canvas> PictureRecorder::beginRecording(double width, double height)
|
| {
|
| + m_canvas = Canvas::create(
|
| + m_pictureRecorder->beginRecording(width, height));
|
| + return m_canvas;
|
| }
|
|
|
| PassRefPtr<Picture> PictureRecorder::endRecording()
|
| {
|
| if (!isRecording())
|
| return nullptr;
|
| - return Picture::create(finishRecording());
|
| + auto picture = Picture::create(
|
| + adoptRef(m_pictureRecorder->endRecording()));
|
| + m_canvas->clearSkCanvas();
|
| + m_canvas = nullptr;
|
| + return picture;
|
| }
|
|
|
| } // namespace blink
|
|
|