| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #ifndef GrShape_DEFINED | 8 #ifndef GrShape_DEFINED |
| 9 #define GrShape_DEFINED | 9 #define GrShape_DEFINED |
| 10 | 10 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 if (Type::kPath != fType) { | 286 if (Type::kPath != fType) { |
| 287 fPath.reset(); | 287 fPath.reset(); |
| 288 fInheritedKey.reset(0); | 288 fInheritedKey.reset(0); |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 | 291 |
| 292 void attemptToReduceFromRRect() { | 292 void attemptToReduceFromRRect() { |
| 293 SkASSERT(Type::kRRect == fType); | 293 SkASSERT(Type::kRRect == fType); |
| 294 SkASSERT(!fInheritedKey.count()); | 294 SkASSERT(!fInheritedKey.count()); |
| 295 if (fRRectIsInverted) { | 295 if (fRRectIsInverted) { |
| 296 if (!fStyle.hasNonDashPathEffect()) { | 296 if (fStyle.isDashed()) { |
| 297 SkStrokeRec::Style recStyle = fStyle.strokeRec().getStyle(); | 297 // Dashing ignores the inverseness (currently). skbug.com/5421 |
| 298 if (SkStrokeRec::kStroke_Style == recStyle || | 298 fRRectIsInverted = false; |
| 299 SkStrokeRec::kHairline_Style == recStyle) { | |
| 300 // stroking ignores the path fill rule. | |
| 301 fRRectIsInverted = false; | |
| 302 } | |
| 303 } | 299 } |
| 304 } else if (fRRect.isEmpty()) { | 300 } else if (fRRect.isEmpty()) { |
| 305 fType = Type::kEmpty; | 301 fType = Type::kEmpty; |
| 306 } | 302 } |
| 307 } | 303 } |
| 308 | 304 |
| 309 static Type AttemptToReduceFromPathImpl(const SkPath& path, SkRRect* rrect, | 305 static Type AttemptToReduceFromPathImpl(const SkPath& path, SkRRect* rrect, |
| 310 SkPath::Direction* rrectDir, unsigne
d* rrectStart, | 306 SkPath::Direction* rrectDir, unsigne
d* rrectStart, |
| 311 bool* rrectIsInverted, const SkPathE
ffect* pe, | 307 bool* rrectIsInverted, const SkPathE
ffect* pe, |
| 312 const SkStrokeRec& strokeRec); | 308 const SkStrokeRec& strokeRec); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 Type fType; | 355 Type fType; |
| 360 SkRRect fRRect; | 356 SkRRect fRRect; |
| 361 SkPath::Direction fRRectDir; | 357 SkPath::Direction fRRectDir; |
| 362 unsigned fRRectStart; | 358 unsigned fRRectStart; |
| 363 bool fRRectIsInverted; | 359 bool fRRectIsInverted; |
| 364 SkTLazy<SkPath> fPath; | 360 SkTLazy<SkPath> fPath; |
| 365 GrStyle fStyle; | 361 GrStyle fStyle; |
| 366 SkAutoSTArray<8, uint32_t> fInheritedKey; | 362 SkAutoSTArray<8, uint32_t> fInheritedKey; |
| 367 }; | 363 }; |
| 368 #endif | 364 #endif |
| OLD | NEW |