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 // Some shared code used by both SkBigPicture and SkMiniPicture. | 8 // Some shared code used by both SkBigPicture and SkMiniPicture. |
9 // SkTextHunter -- SkRecord visitor that returns true when the op draws text
. | 9 // SkTextHunter -- SkRecord visitor that returns true when the op draws text
. |
10 // SkBitmapHunter -- SkRecord visitor that returns true when the op draws a bi
tmap or image. | 10 // SkBitmapHunter -- SkRecord visitor that returns true when the op draws a bi
tmap or image. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // AA hairline concave path is not slow. | 116 // AA hairline concave path is not slow. |
117 } else if (SkPaint::kFill_Style == paintStyle && pathBounds.width()
< 64.f && | 117 } else if (SkPaint::kFill_Style == paintStyle && pathBounds.width()
< 64.f && |
118 pathBounds.height() < 64.f && !op.path.isVolatile()) { | 118 pathBounds.height() < 64.f && !op.path.isVolatile()) { |
119 // AADF eligible concave path is not slow. | 119 // AADF eligible concave path is not slow. |
120 } else { | 120 } else { |
121 fNumSlowPathsAndDashEffects++; | 121 fNumSlowPathsAndDashEffects++; |
122 } | 122 } |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
| 126 void operator()(const SkRecords::ClipPath& op) { |
| 127 // TODO: does the SkRegion op matter? |
| 128 if (op.opAA.aa && !op.path.isConvex()) { |
| 129 fNumSlowPathsAndDashEffects++; |
| 130 } |
| 131 } |
| 132 |
126 void operator()(const SkRecords::SaveLayer& op) { | 133 void operator()(const SkRecords::SaveLayer& op) { |
127 this->checkPaint(AsPtr(op.paint)); | 134 this->checkPaint(AsPtr(op.paint)); |
128 } | 135 } |
129 | 136 |
130 template <typename T> | 137 template <typename T> |
131 SK_WHEN(T::kTags & SkRecords::kDraw_Tag, void) operator()(const T& op) { | 138 SK_WHEN(T::kTags & SkRecords::kDraw_Tag, void) operator()(const T& op) { |
132 this->checkPaint(AsPtr(op.paint)); | 139 this->checkPaint(AsPtr(op.paint)); |
133 } | 140 } |
134 | 141 |
135 template <typename T> | 142 template <typename T> |
136 SK_WHEN(!(T::kTags & SkRecords::kDraw_Tag), void) operator()(const T& op) {
/* do nothing */ } | 143 SK_WHEN(!(T::kTags & SkRecords::kDraw_Tag), void) operator()(const T& op) {
/* do nothing */ } |
137 | 144 |
138 int fNumSlowPathsAndDashEffects; | 145 int fNumSlowPathsAndDashEffects; |
139 }; | 146 }; |
OLD | NEW |