| 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 #include "SkBigPicture.h" | 8 #include "SkBigPicture.h" |
| 9 #include "SkData.h" | 9 #include "SkData.h" |
| 10 #include "SkDrawable.h" | 10 #include "SkDrawable.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 sk_sp<SkDrawable> drawable = | 190 sk_sp<SkDrawable> drawable = |
| 191 sk_make_sp<SkRecordedDrawable>(fRecord, fBBH, fRecorder->detachDrawable
List(), fCullRect); | 191 sk_make_sp<SkRecordedDrawable>(fRecord, fBBH, fRecorder->detachDrawable
List(), fCullRect); |
| 192 | 192 |
| 193 // release our refs now, so only the drawable will be the owner. | 193 // release our refs now, so only the drawable will be the owner. |
| 194 fRecord.reset(nullptr); | 194 fRecord.reset(nullptr); |
| 195 fBBH.reset(nullptr); | 195 fBBH.reset(nullptr); |
| 196 | 196 |
| 197 return drawable; | 197 return drawable; |
| 198 } | 198 } |
| 199 | |
| 200 #include "SkLiteDL.h" | |
| 201 #include "SkLiteRecorder.h" | |
| 202 | |
| 203 SkPictureRecorder_Lite:: SkPictureRecorder_Lite() : fRecorder(new SkLiteRecorder
) {} | |
| 204 SkPictureRecorder_Lite::~SkPictureRecorder_Lite() {} | |
| 205 | |
| 206 SkCanvas* SkPictureRecorder_Lite::beginRecording(const SkRect& bounds) { | |
| 207 fDL = SkLiteDL::New(bounds); | |
| 208 fRecorder->reset(fDL.get()); | |
| 209 return this->getRecordingCanvas(); | |
| 210 } | |
| 211 | |
| 212 SkCanvas* SkPictureRecorder_Lite::getRecordingCanvas() { | |
| 213 return fDL ? fRecorder.get() : nullptr; | |
| 214 } | |
| 215 | |
| 216 sk_sp<SkDrawable> SkPictureRecorder_Lite::finishRecordingAsDrawable(uint32_t) { | |
| 217 if (fGrContextToOptimizeFor) { | |
| 218 fDL->optimizeFor(fGrContextToOptimizeFor); | |
| 219 } | |
| 220 return std::move(fDL); | |
| 221 } | |
| OLD | NEW |