aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPictureRecorder.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-08-15 08:05:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-15 08:05:39 -0700
commitced26a3d6b77d3a6744a8ccb8eff23eda45fc867 (patch)
tree8b3153cc421fc66c0d8db7754c27ee45be821b45 /include/core/SkPictureRecorder.h
parent851d68aa5692103db67433354c7421863d01dbda (diff)
add parallel public API for recording SkLiteDL.
The API is restricted to pretty much just what Derek calls, but it's enough that we can switch testing over to use it. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2246893002 Review-Url: https://codereview.chromium.org/2246893002
Diffstat (limited to 'include/core/SkPictureRecorder.h')
-rw-r--r--include/core/SkPictureRecorder.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/core/SkPictureRecorder.h b/include/core/SkPictureRecorder.h
index f20a06adf4..96e7aa019d 100644
--- a/include/core/SkPictureRecorder.h
+++ b/include/core/SkPictureRecorder.h
@@ -140,4 +140,30 @@ private:
typedef SkNoncopyable INHERITED;
};
+class SkLiteDL;
+class SkLiteRecorder;
+
+// A similar API to SkPictureRecorder, wrapping SkLiteRecorder and SkLiteDL.
+class SK_API SkPictureRecorder_Lite : SkNoncopyable {
+public:
+ SkPictureRecorder_Lite();
+ ~SkPictureRecorder_Lite();
+
+ SkCanvas* beginRecording(const SkRect& bounds);
+ SkCanvas* beginRecording(SkScalar w, SkScalar h) {
+ return this->beginRecording(SkRect::MakeWH(w,h));
+ }
+
+ SkCanvas* getRecordingCanvas();
+
+ void optimizeFor(GrContext* ctx) { fGrContextToOptimizeFor = ctx; }
+
+ sk_sp<SkDrawable> finishRecordingAsDrawable(uint32_t ignored = 0);
+
+private:
+ std::unique_ptr<SkLiteRecorder> fRecorder;
+ sk_sp<SkLiteDL> fDL;
+ GrContext* fGrContextToOptimizeFor = nullptr;
+};
+
#endif