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 "SkData.h" | 8 #include "SkData.h" |
9 #include "SkDrawable.h" | 9 #include "SkDrawable.h" |
10 #include "SkLayerInfo.h" | 10 #include "SkLayerInfo.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 SkDrawableList* drawableList = fRecorder->getDrawableList(); | 54 SkDrawableList* drawableList = fRecorder->getDrawableList(); |
55 SkPicture::SnapshotArray* pictList = drawableList ? drawableList->newDrawabl
eSnapshot() : NULL; | 55 SkPicture::SnapshotArray* pictList = drawableList ? drawableList->newDrawabl
eSnapshot() : NULL; |
56 | 56 |
57 if (fBBH.get()) { | 57 if (fBBH.get()) { |
58 if (saveLayerData) { | 58 if (saveLayerData) { |
59 SkRecordComputeLayers(fCullRect, *fRecord, pictList, fBBH.get(), sav
eLayerData); | 59 SkRecordComputeLayers(fCullRect, *fRecord, pictList, fBBH.get(), sav
eLayerData); |
60 } else { | 60 } else { |
61 SkRecordFillBounds(fCullRect, *fRecord, fBBH.get()); | 61 SkRecordFillBounds(fCullRect, *fRecord, fBBH.get()); |
62 } | 62 } |
63 SkRect bbhBound = fBBH->getRootBound(); | |
64 SkASSERT((bbhBound.isEmpty() || fCullRect.contains(bbhBound)) | |
65 || (bbhBound.isEmpty() && fCullRect.isEmpty())); | |
66 fCullRect = bbhBound; | |
67 } | 63 } |
68 | 64 |
69 SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullRect, fRecord, pictList, fBBH)
); | 65 SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullRect, fRecord, pictList, fBBH)
); |
70 | 66 |
71 if (saveLayerData) { | 67 if (saveLayerData) { |
72 pict->EXPERIMENTAL_addAccelData(saveLayerData); | 68 pict->EXPERIMENTAL_addAccelData(saveLayerData); |
73 } | 69 } |
74 | 70 |
75 // release our refs now, so only the picture will be the owner. | 71 // release our refs now, so only the picture will be the owner. |
76 fRecorder.reset(NULL); | 72 fRecorder.reset(NULL); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 fCullRect, | 166 fCullRect, |
171 SkToBool(fFlags & kComputeSaveLayerInfo
_RecordFlag))); | 167 SkToBool(fFlags & kComputeSaveLayerInfo
_RecordFlag))); |
172 | 168 |
173 // release our refs now, so only the drawable will be the owner. | 169 // release our refs now, so only the drawable will be the owner. |
174 fRecorder.reset(NULL); | 170 fRecorder.reset(NULL); |
175 fRecord.reset(NULL); | 171 fRecord.reset(NULL); |
176 fBBH.reset(NULL); | 172 fBBH.reset(NULL); |
177 | 173 |
178 return drawable; | 174 return drawable; |
179 } | 175 } |
OLD | NEW |