OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef GrPathRenderer_DEFINED | 9 #ifndef GrPathRenderer_DEFINED |
10 #define GrPathRenderer_DEFINED | 10 #define GrPathRenderer_DEFINED |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 this->onStencilPath(target, ds, viewMatrix, path, stroke); | 153 this->onStencilPath(target, ds, viewMatrix, path, stroke); |
154 } | 154 } |
155 | 155 |
156 // Helper for determining if we can treat a thin stroke as a hairline w/ cov
erage. | 156 // Helper for determining if we can treat a thin stroke as a hairline w/ cov
erage. |
157 // If we can, we draw lots faster (raster device does this same test). | 157 // If we can, we draw lots faster (raster device does this same test). |
158 static bool IsStrokeHairlineOrEquivalent(const GrStrokeInfo& stroke, const S
kMatrix& matrix, | 158 static bool IsStrokeHairlineOrEquivalent(const GrStrokeInfo& stroke, const S
kMatrix& matrix, |
159 SkScalar* outCoverage) { | 159 SkScalar* outCoverage) { |
160 if (stroke.isDashed()) { | 160 if (stroke.isDashed()) { |
161 return false; | 161 return false; |
162 } | 162 } |
163 if (stroke.getStrokeRec().isHairlineStyle()) { | 163 if (stroke.isHairlineStyle()) { |
164 if (outCoverage) { | 164 if (outCoverage) { |
165 *outCoverage = SK_Scalar1; | 165 *outCoverage = SK_Scalar1; |
166 } | 166 } |
167 return true; | 167 return true; |
168 } | 168 } |
169 return stroke.getStrokeRec().getStyle() == SkStrokeRec::kStroke_Style && | 169 return stroke.getStyle() == SkStrokeRec::kStroke_Style && |
170 SkDrawTreatAAStrokeAsHairline(stroke.getStrokeRec().getWidth(), matr
ix, outCoverage); | 170 SkDrawTreatAAStrokeAsHairline(stroke.getWidth(), matrix, outCoverage
); |
171 } | 171 } |
172 | 172 |
173 protected: | 173 protected: |
174 /** | 174 /** |
175 * Subclass overrides if it has any limitations of stenciling support. | 175 * Subclass overrides if it has any limitations of stenciling support. |
176 */ | 176 */ |
177 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, | 177 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, |
178 const GrPipelineBuilder*, | 178 const GrPipelineBuilder*, |
179 const SkPath&, | 179 const SkPath&, |
180 const GrStrokeInfo&) const { | 180 const GrStrokeInfo&) const { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 SkRect* bounds) { | 228 SkRect* bounds) { |
229 GetPathDevBounds(path, device->width(), device->height(), matrix, bounds
); | 229 GetPathDevBounds(path, device->width(), device->height(), matrix, bounds
); |
230 } | 230 } |
231 | 231 |
232 private: | 232 private: |
233 | 233 |
234 typedef SkRefCnt INHERITED; | 234 typedef SkRefCnt INHERITED; |
235 }; | 235 }; |
236 | 236 |
237 #endif | 237 #endif |
OLD | NEW |