OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
9 #include "SkBigPicture.h" | 9 #include "SkBigPicture.h" |
10 #include "SkPictureCommon.h" | 10 #include "SkPictureCommon.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 SkRecordPartialDraw(*fRecord, | 51 SkRecordPartialDraw(*fRecord, |
52 canvas, | 52 canvas, |
53 this->drawablePicts(), | 53 this->drawablePicts(), |
54 this->drawableCount(), | 54 this->drawableCount(), |
55 start, | 55 start, |
56 stop, | 56 stop, |
57 initialCTM); | 57 initialCTM); |
58 } | 58 } |
59 | 59 |
60 const SkBigPicture::Analysis& SkBigPicture::analysis() const { | 60 const SkBigPicture::Analysis& SkBigPicture::analysis() const { |
61 return *fAnalysis.get([&]{ return new Analysis(*fRecord); }); | 61 auto create = [&]() { return new Analysis(*fRecord); }; |
| 62 return *fAnalysis.get(create); |
62 } | 63 } |
63 | 64 |
64 SkRect SkBigPicture::cullRect() const { return fCullRect; } | 65 SkRect SkBigPicture::cullRect() const { return fCullRect; } |
65 bool SkBigPicture::hasText() const { return this->analysis().fHasT
ext; } | 66 bool SkBigPicture::hasText() const { return this->analysis().fHasT
ext; } |
66 bool SkBigPicture::willPlayBackBitmaps() const { return this->analysis().fWill
PlaybackBitmaps; } | 67 bool SkBigPicture::willPlayBackBitmaps() const { return this->analysis().fWill
PlaybackBitmaps; } |
67 int SkBigPicture::numSlowPaths() const { return this->analysis().fNumSlowPath
sAndDashEffects; } | 68 int SkBigPicture::numSlowPaths() const { return this->analysis().fNumSlowPath
sAndDashEffects; } |
68 int SkBigPicture::approximateOpCount() const { return fRecord->count(); } | 69 int SkBigPicture::approximateOpCount() const { return fRecord->count(); } |
69 size_t SkBigPicture::approximateBytesUsed() const { | 70 size_t SkBigPicture::approximateBytesUsed() const { |
70 size_t bytes = sizeof(*this) + fRecord->bytesUsed() + fApproxBytesUsedBySubP
ictures; | 71 size_t bytes = sizeof(*this) + fRecord->bytesUsed() + fApproxBytesUsedBySubP
ictures; |
71 if (fBBH) { bytes += fBBH->bytesUsed(); } | 72 if (fBBH) { bytes += fBBH->bytesUsed(); } |
(...skipping 18 matching lines...) Expand all Loading... |
90 for (int i = 0; i < record.count(); i++) { | 91 for (int i = 0; i < record.count(); i++) { |
91 hasText = hasText || record.visit<bool>(i, text); | 92 hasText = hasText || record.visit<bool>(i, text); |
92 hasBitmap = hasBitmap || record.visit<bool>(i, bitmap); | 93 hasBitmap = hasBitmap || record.visit<bool>(i, bitmap); |
93 record.visit<void>(i, path); | 94 record.visit<void>(i, path); |
94 } | 95 } |
95 | 96 |
96 fHasText = hasText; | 97 fHasText = hasText; |
97 fWillPlaybackBitmaps = hasBitmap; | 98 fWillPlaybackBitmaps = hasBitmap; |
98 fNumSlowPathsAndDashEffects = SkTMin<int>(path.fNumSlowPathsAndDashEffects,
255); | 99 fNumSlowPathsAndDashEffects = SkTMin<int>(path.fNumSlowPathsAndDashEffects,
255); |
99 } | 100 } |
OLD | NEW |