Index: src/core/SkPictureRecorder.cpp |
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp |
index 8e7c7f3b06477240fa38a6298132ed93cecf579b..00450b085aa067658266581ccd2606c0809133b2 100644 |
--- a/src/core/SkPictureRecorder.cpp |
+++ b/src/core/SkPictureRecorder.cpp |
@@ -196,3 +196,26 @@ sk_sp<SkDrawable> SkPictureRecorder::finishRecordingAsDrawable(uint32_t finishFl |
return drawable; |
} |
+ |
+#include "SkLiteDL.h" |
+#include "SkLiteRecorder.h" |
+ |
+SkPictureRecorder_Lite:: SkPictureRecorder_Lite() : fRecorder(new SkLiteRecorder) {} |
+SkPictureRecorder_Lite::~SkPictureRecorder_Lite() {} |
+ |
+SkCanvas* SkPictureRecorder_Lite::beginRecording(const SkRect& bounds) { |
+ fDL = SkLiteDL::New(bounds); |
+ fRecorder->reset(fDL.get()); |
+ return this->getRecordingCanvas(); |
+} |
+ |
+SkCanvas* SkPictureRecorder_Lite::getRecordingCanvas() { |
+ return fDL ? fRecorder.get() : nullptr; |
+} |
+ |
+sk_sp<SkDrawable> SkPictureRecorder_Lite::finishRecordingAsDrawable(uint32_t) { |
+ if (fGrContextToOptimizeFor) { |
+ fDL->optimizeFor(fGrContextToOptimizeFor); |
+ } |
+ return std::move(fDL); |
+} |