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 auto create = [&]() { return new Analysis(*fRecord); }; | 61 return *fAnalysis.get([&]{ return new Analysis(*fRecord); }); |
62 return *fAnalysis.get(create); | |
63 } | 62 } |
64 | 63 |
65 SkRect SkBigPicture::cullRect() const { return fCullRect; } | 64 SkRect SkBigPicture::cullRect() const { return fCullRect; } |
66 bool SkBigPicture::hasText() const { return this->analysis().fHasT
ext; } | 65 bool SkBigPicture::hasText() const { return this->analysis().fHasT
ext; } |
67 bool SkBigPicture::willPlayBackBitmaps() const { return this->analysis().fWill
PlaybackBitmaps; } | 66 bool SkBigPicture::willPlayBackBitmaps() const { return this->analysis().fWill
PlaybackBitmaps; } |
68 int SkBigPicture::numSlowPaths() const { return this->analysis().fNumSlowPath
sAndDashEffects; } | 67 int SkBigPicture::numSlowPaths() const { return this->analysis().fNumSlowPath
sAndDashEffects; } |
69 int SkBigPicture::approximateOpCount() const { return fRecord->count(); } | 68 int SkBigPicture::approximateOpCount() const { return fRecord->count(); } |
70 size_t SkBigPicture::approximateBytesUsed() const { | 69 size_t SkBigPicture::approximateBytesUsed() const { |
71 size_t bytes = sizeof(*this) + fRecord->bytesUsed() + fApproxBytesUsedBySubP
ictures; | 70 size_t bytes = sizeof(*this) + fRecord->bytesUsed() + fApproxBytesUsedBySubP
ictures; |
72 if (fBBH) { bytes += fBBH->bytesUsed(); } | 71 if (fBBH) { bytes += fBBH->bytesUsed(); } |
(...skipping 18 matching lines...) Expand all Loading... |
91 for (int i = 0; i < record.count(); i++) { | 90 for (int i = 0; i < record.count(); i++) { |
92 hasText = hasText || record.visit<bool>(i, text); | 91 hasText = hasText || record.visit<bool>(i, text); |
93 hasBitmap = hasBitmap || record.visit<bool>(i, bitmap); | 92 hasBitmap = hasBitmap || record.visit<bool>(i, bitmap); |
94 record.visit<void>(i, path); | 93 record.visit<void>(i, path); |
95 } | 94 } |
96 | 95 |
97 fHasText = hasText; | 96 fHasText = hasText; |
98 fWillPlaybackBitmaps = hasBitmap; | 97 fWillPlaybackBitmaps = hasBitmap; |
99 fNumSlowPathsAndDashEffects = SkTMin<int>(path.fNumSlowPathsAndDashEffects,
255); | 98 fNumSlowPathsAndDashEffects = SkTMin<int>(path.fNumSlowPathsAndDashEffects,
255); |
100 } | 99 } |
OLD | NEW |