Index: cc/paint/paint_recorder.cc |
diff --git a/cc/paint/paint_recorder.cc b/cc/paint/paint_recorder.cc |
index 672f0712725d4f1c20b56631d66061c737455c40..f08114852feab4277a542dd8d156390e91971c85 100644 |
--- a/cc/paint/paint_recorder.cc |
+++ b/cc/paint/paint_recorder.cc |
@@ -4,9 +4,26 @@ |
#include "cc/paint/paint_recorder.h" |
+#include "cc/paint/paint_op_buffer.h" |
+ |
namespace cc { |
PaintRecorder::PaintRecorder() = default; |
+ |
PaintRecorder::~PaintRecorder() = default; |
+PaintCanvas* PaintRecorder::beginRecording(const SkRect& bounds) { |
+ buffer_.reset(new PaintOpBuffer(bounds)); |
+ canvas_.emplace(buffer_.get(), bounds); |
+ return getRecordingCanvas(); |
+} |
+ |
+sk_sp<PaintRecord> PaintRecorder::finishRecordingAsPicture() { |
+ // Some users (e.g. printing) use the existence of the recording canvas |
+ // to know if recording is finished, so reset it here. |
+ canvas_.reset(); |
+ // TODO(enne): consider making a mini picture here. |
vmpstr
2017/03/28 18:27:15
Do we still need this with the optimization in the
enne (OOO)
2017/03/28 19:28:05
Yeah, it's possible. I think I would consider mak
|
+ return std::move(buffer_); |
+} |
+ |
} // namespace cc |