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 25 matching lines...) Expand all Loading... |
36 SkRecordDraw(*fRecord, | 36 SkRecordDraw(*fRecord, |
37 canvas, | 37 canvas, |
38 this->drawablePicts(), | 38 this->drawablePicts(), |
39 nullptr, | 39 nullptr, |
40 this->drawableCount(), | 40 this->drawableCount(), |
41 useBBH ? fBBH.get() : nullptr, | 41 useBBH ? fBBH.get() : nullptr, |
42 callback); | 42 callback); |
43 } | 43 } |
44 | 44 |
45 void SkBigPicture::partialPlayback(SkCanvas* canvas, | 45 void SkBigPicture::partialPlayback(SkCanvas* canvas, |
46 unsigned start, | 46 int start, |
47 unsigned stop, | 47 int stop, |
48 const SkMatrix& initialCTM) const { | 48 const SkMatrix& initialCTM) const { |
49 SkASSERT(canvas); | 49 SkASSERT(canvas); |
50 SkRecordPartialDraw(*fRecord, | 50 SkRecordPartialDraw(*fRecord, |
51 canvas, | 51 canvas, |
52 this->drawablePicts(), | 52 this->drawablePicts(), |
53 this->drawableCount(), | 53 this->drawableCount(), |
54 start, | 54 start, |
55 stop, | 55 stop, |
56 initialCTM); | 56 initialCTM); |
57 } | 57 } |
(...skipping 21 matching lines...) Expand all Loading... |
79 SkPicture const* const* SkBigPicture::drawablePicts() const { | 79 SkPicture const* const* SkBigPicture::drawablePicts() const { |
80 return fDrawablePicts ? fDrawablePicts->begin() : nullptr; | 80 return fDrawablePicts ? fDrawablePicts->begin() : nullptr; |
81 } | 81 } |
82 | 82 |
83 SkBigPicture::Analysis::Analysis(const SkRecord& record) { | 83 SkBigPicture::Analysis::Analysis(const SkRecord& record) { |
84 SkTextHunter text; | 84 SkTextHunter text; |
85 SkBitmapHunter bitmap; | 85 SkBitmapHunter bitmap; |
86 SkPathCounter path; | 86 SkPathCounter path; |
87 | 87 |
88 bool hasText = false, hasBitmap = false; | 88 bool hasText = false, hasBitmap = false; |
89 for (unsigned i = 0; i < record.count(); i++) { | 89 for (int i = 0; i < record.count(); i++) { |
90 hasText = hasText || record.visit<bool>(i, text); | 90 hasText = hasText || record.visit<bool>(i, text); |
91 hasBitmap = hasBitmap || record.visit<bool>(i, bitmap); | 91 hasBitmap = hasBitmap || record.visit<bool>(i, bitmap); |
92 record.visit<void>(i, path); | 92 record.visit<void>(i, path); |
93 } | 93 } |
94 | 94 |
95 fHasText = hasText; | 95 fHasText = hasText; |
96 fWillPlaybackBitmaps = hasBitmap; | 96 fWillPlaybackBitmaps = hasBitmap; |
97 fNumSlowPathsAndDashEffects = SkTMin<int>(path.fNumSlowPathsAndDashEffects,
255); | 97 fNumSlowPathsAndDashEffects = SkTMin<int>(path.fNumSlowPathsAndDashEffects,
255); |
98 } | 98 } |
OLD | NEW |