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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 SkASSERT(!path.isEmpty()); | 136 SkASSERT(!path.isEmpty()); |
137 SkASSERT(kNoSupport_StencilSupport != this->getStencilSupport(path, stro
ke, target)); | 137 SkASSERT(kNoSupport_StencilSupport != this->getStencilSupport(path, stro
ke, target)); |
138 this->onStencilPath(path, stroke, target); | 138 this->onStencilPath(path, stroke, target); |
139 } | 139 } |
140 | 140 |
141 // Helper for determining if we can treat a thin stroke as a hairline w/ cov
erage. | 141 // Helper for determining if we can treat a thin stroke as a hairline w/ cov
erage. |
142 // If we can, we draw lots faster (raster device does this same test). | 142 // If we can, we draw lots faster (raster device does this same test). |
143 static bool IsStrokeHairlineOrEquivalent(const SkStrokeRec& stroke, const Sk
Matrix& matrix, | 143 static bool IsStrokeHairlineOrEquivalent(const SkStrokeRec& stroke, const Sk
Matrix& matrix, |
144 SkScalar* outCoverage) { | 144 SkScalar* outCoverage) { |
145 if (stroke.isHairlineStyle()) { | 145 if (stroke.isHairlineStyle()) { |
146 if (NULL != outCoverage) { | 146 if (outCoverage) { |
147 *outCoverage = SK_Scalar1; | 147 *outCoverage = SK_Scalar1; |
148 } | 148 } |
149 return true; | 149 return true; |
150 } | 150 } |
151 return stroke.getStyle() == SkStrokeRec::kStroke_Style && | 151 return stroke.getStyle() == SkStrokeRec::kStroke_Style && |
152 SkDrawTreatAAStrokeAsHairline(stroke.getWidth(), matrix, outCoverage
); | 152 SkDrawTreatAAStrokeAsHairline(stroke.getWidth(), matrix, outCoverage
); |
153 } | 153 } |
154 | 154 |
155 protected: | 155 protected: |
156 /** | 156 /** |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 SkRect* bounds) { | 204 SkRect* bounds) { |
205 GetPathDevBounds(path, device->width(), device->height(), matrix, bounds
); | 205 GetPathDevBounds(path, device->width(), device->height(), matrix, bounds
); |
206 } | 206 } |
207 | 207 |
208 private: | 208 private: |
209 | 209 |
210 typedef SkRefCnt INHERITED; | 210 typedef SkRefCnt INHERITED; |
211 }; | 211 }; |
212 | 212 |
213 #endif | 213 #endif |
OLD | NEW |