OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkPictureRecorder_DEFINED | 8 #ifndef SkPictureRecorder_DEFINED |
9 #define SkPictureRecorder_DEFINED | 9 #define SkPictureRecorder_DEFINED |
10 | 10 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 SkAutoTUnref<SkBBoxHierarchy> fBBH; | 133 SkAutoTUnref<SkBBoxHierarchy> fBBH; |
134 SkAutoTUnref<SkRecorder> fRecorder; | 134 SkAutoTUnref<SkRecorder> fRecorder; |
135 SkAutoTUnref<SkRecord> fRecord; | 135 SkAutoTUnref<SkRecord> fRecord; |
136 SkMiniRecorder fMiniRecorder; | 136 SkMiniRecorder fMiniRecorder; |
137 | 137 |
138 GrContext* fGrContextToOptimizeFor = nullptr; | 138 GrContext* fGrContextToOptimizeFor = nullptr; |
139 | 139 |
140 typedef SkNoncopyable INHERITED; | 140 typedef SkNoncopyable INHERITED; |
141 }; | 141 }; |
142 | 142 |
143 class SkLiteDL; | |
reed1
2016/08/15 15:52:51
Perhaps we can make this a separate file for now,
| |
144 class SkLiteRecorder; | |
145 | |
146 // A similar API to SkPictureRecorder, wrapping SkLiteRecorder and SkLiteDL. | |
147 class SK_API SkPictureRecorder_Lite : SkNoncopyable { | |
148 public: | |
149 SkPictureRecorder_Lite(); | |
150 ~SkPictureRecorder_Lite(); | |
151 | |
152 SkCanvas* beginRecording(const SkRect& bounds); | |
153 SkCanvas* beginRecording(SkScalar w, SkScalar h) { | |
154 return this->beginRecording(SkRect::MakeWH(w,h)); | |
155 } | |
156 | |
157 SkCanvas* getRecordingCanvas(); | |
158 | |
159 void optimizeFor(GrContext* ctx) { fGrContextToOptimizeFor = ctx; } | |
160 | |
161 sk_sp<SkDrawable> finishRecordingAsDrawable(uint32_t ignored = 0); | |
djsollen
2016/08/15 14:47:43
will this return a nullptr if there were no drawin
| |
162 | |
163 private: | |
164 std::unique_ptr<SkLiteRecorder> fRecorder; | |
165 sk_sp<SkLiteDL> fDL; | |
166 GrContext* fGrContextToOptimizeFor = nullptr; | |
167 }; | |
168 | |
143 #endif | 169 #endif |
OLD | NEW |