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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 subPictureBytes += SkPictureUtils::ApproximateBytesUsed(pictList->begin(
)[i]); | 88 subPictureBytes += SkPictureUtils::ApproximateBytesUsed(pictList->begin(
)[i]); |
89 } | 89 } |
90 return SkNEW_ARGS(SkBigPicture, (fCullRect, | 90 return SkNEW_ARGS(SkBigPicture, (fCullRect, |
91 fRecord.detach(), | 91 fRecord.detach(), |
92 pictList, | 92 pictList, |
93 fBBH.detach(), | 93 fBBH.detach(), |
94 saveLayerData.detach(), | 94 saveLayerData.detach(), |
95 subPictureBytes)); | 95 subPictureBytes)); |
96 } | 96 } |
97 | 97 |
| 98 SkPicture* SkPictureRecorder::endRecordingAsPicture(const SkRect& cullRect) { |
| 99 fCullRect = cullRect; |
| 100 return this->endRecordingAsPicture(); |
| 101 } |
| 102 |
| 103 |
98 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const { | 104 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const { |
99 if (NULL == canvas) { | 105 if (NULL == canvas) { |
100 return; | 106 return; |
101 } | 107 } |
102 | 108 |
103 int drawableCount = 0; | 109 int drawableCount = 0; |
104 SkDrawable* const* drawables = NULL; | 110 SkDrawable* const* drawables = NULL; |
105 SkDrawableList* drawableList = fRecorder->getDrawableList(); | 111 SkDrawableList* drawableList = fRecorder->getDrawableList(); |
106 if (drawableList) { | 112 if (drawableList) { |
107 drawableCount = drawableList->count(); | 113 drawableCount = drawableList->count(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 (fRecord, fBBH, fRecorder->detachDrawabl
eList(), | 198 (fRecord, fBBH, fRecorder->detachDrawabl
eList(), |
193 fCullRect, | 199 fCullRect, |
194 SkToBool(fFlags & kComputeSaveLayerInfo
_RecordFlag))); | 200 SkToBool(fFlags & kComputeSaveLayerInfo
_RecordFlag))); |
195 | 201 |
196 // release our refs now, so only the drawable will be the owner. | 202 // release our refs now, so only the drawable will be the owner. |
197 fRecord.reset(NULL); | 203 fRecord.reset(NULL); |
198 fBBH.reset(NULL); | 204 fBBH.reset(NULL); |
199 | 205 |
200 return drawable; | 206 return drawable; |
201 } | 207 } |
OLD | NEW |