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 | 9 |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1200 SkTLazy<SkPath> tmpPath; | 1200 SkTLazy<SkPath> tmpPath; |
1201 SkTCopyOnFirstWrite<SkStrokeRec> stroke(origStroke); | 1201 SkTCopyOnFirstWrite<SkStrokeRec> stroke(origStroke); |
1202 | 1202 |
1203 // Try a 1st time without stroking the path and without allowing the SW rend erer | 1203 // Try a 1st time without stroking the path and without allowing the SW rend erer |
1204 GrPathRenderer* pr = this->getPathRenderer(*pathPtr, *stroke, target, false, type); | 1204 GrPathRenderer* pr = this->getPathRenderer(*pathPtr, *stroke, target, false, type); |
1205 | 1205 |
1206 if (NULL == pr) { | 1206 if (NULL == pr) { |
1207 if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*stroke, this->getMatr ix(), NULL)) { | 1207 if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*stroke, this->getMatr ix(), NULL)) { |
1208 // It didn't work the 1st time, so try again with the stroked path | 1208 // It didn't work the 1st time, so try again with the stroked path |
1209 if (stroke->applyToPath(tmpPath.init(), *pathPtr)) { | 1209 if (stroke->applyToPath(tmpPath.init(), *pathPtr)) { |
1210 // make sure the path will not be inverse-stroked | |
bsalomon
2014/04/23 15:06:12
Shouldn't applyToPath just return a path with the
yunchao
2014/04/24 16:12:43
applyToPath doesn't change the style. For a stroke
bsalomon
2014/04/24 17:33:21
It *should* set the correct fill type.
| |
1211 if (SkStrokeRec::kFill_Style != stroke->getStyle() && | |
1212 tmpPath.get()->isInverseFillType()) { | |
1213 tmpPath.get()->toggleInverseFillType(); | |
1214 } | |
1210 pathPtr = tmpPath.get(); | 1215 pathPtr = tmpPath.get(); |
1211 stroke.writable()->setFillStyle(); | 1216 stroke.writable()->setFillStyle(); |
1212 if (pathPtr->isEmpty()) { | 1217 if (pathPtr->isEmpty()) { |
1213 return; | 1218 return; |
1214 } | 1219 } |
1215 } | 1220 } |
1216 } | 1221 } |
1217 | 1222 |
1218 // This time, allow SW renderer | 1223 // This time, allow SW renderer |
1219 pr = this->getPathRenderer(*pathPtr, *stroke, target, true, type); | 1224 pr = this->getPathRenderer(*pathPtr, *stroke, target, true, type); |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1824 } | 1829 } |
1825 return path; | 1830 return path; |
1826 } | 1831 } |
1827 | 1832 |
1828 /////////////////////////////////////////////////////////////////////////////// | 1833 /////////////////////////////////////////////////////////////////////////////// |
1829 #if GR_CACHE_STATS | 1834 #if GR_CACHE_STATS |
1830 void GrContext::printCacheStats() const { | 1835 void GrContext::printCacheStats() const { |
1831 fTextureCache->printStats(); | 1836 fTextureCache->printStats(); |
1832 } | 1837 } |
1833 #endif | 1838 #endif |
OLD | NEW |