| 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 20 matching lines...) Expand all Loading... |
| 31 fFlags = recordFlags; | 31 fFlags = recordFlags; |
| 32 | 32 |
| 33 if (bbhFactory) { | 33 if (bbhFactory) { |
| 34 fBBH.reset((*bbhFactory)(cullRect)); | 34 fBBH.reset((*bbhFactory)(cullRect)); |
| 35 SkASSERT(fBBH.get()); | 35 SkASSERT(fBBH.get()); |
| 36 } | 36 } |
| 37 | 37 |
| 38 if (!fRecord) { | 38 if (!fRecord) { |
| 39 fRecord.reset(SkNEW(SkRecord)); | 39 fRecord.reset(SkNEW(SkRecord)); |
| 40 } | 40 } |
| 41 fRecorder->reset(fRecord.get(), cullRect, &fMiniRecorder); | 41 SkRecorder::DrawPictureMode dpm = (recordFlags & kPlaybackDrawPicture_Record
Flag) |
| 42 ? SkRecorder::Playback_DrawPictureMode |
| 43 : SkRecorder::Record_DrawPictureMode; |
| 44 fRecorder->reset(fRecord.get(), cullRect, dpm, &fMiniRecorder); |
| 42 fActivelyRecording = true; | 45 fActivelyRecording = true; |
| 43 return this->getRecordingCanvas(); | 46 return this->getRecordingCanvas(); |
| 44 } | 47 } |
| 45 | 48 |
| 46 SkCanvas* SkPictureRecorder::getRecordingCanvas() { | 49 SkCanvas* SkPictureRecorder::getRecordingCanvas() { |
| 47 return fActivelyRecording ? fRecorder.get() : nullptr; | 50 return fActivelyRecording ? fRecorder.get() : nullptr; |
| 48 } | 51 } |
| 49 | 52 |
| 50 SkPicture* SkPictureRecorder::endRecordingAsPicture() { | 53 SkPicture* SkPictureRecorder::endRecordingAsPicture() { |
| 51 fActivelyRecording = false; | 54 fActivelyRecording = false; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 (fRecord, fBBH, fRecorder->detachDrawabl
eList(), | 192 (fRecord, fBBH, fRecorder->detachDrawabl
eList(), |
| 190 fCullRect, | 193 fCullRect, |
| 191 SkToBool(fFlags & kComputeSaveLayerInfo
_RecordFlag))); | 194 SkToBool(fFlags & kComputeSaveLayerInfo
_RecordFlag))); |
| 192 | 195 |
| 193 // release our refs now, so only the drawable will be the owner. | 196 // release our refs now, so only the drawable will be the owner. |
| 194 fRecord.reset(NULL); | 197 fRecord.reset(NULL); |
| 195 fBBH.reset(NULL); | 198 fBBH.reset(NULL); |
| 196 | 199 |
| 197 return drawable; | 200 return drawable; |
| 198 } | 201 } |
| OLD | NEW |