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 #include "GrShape.h" | 8 #include "GrShape.h" |
9 | 9 |
10 GrShape& GrShape::operator=(const GrShape& that) { | 10 GrShape& GrShape::operator=(const GrShape& that) { |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 this->attemptToSimplifyRRect(); | 354 this->attemptToSimplifyRRect(); |
355 } else if (Type::kLine == fType) { | 355 } else if (Type::kLine == fType) { |
356 this->attemptToSimplifyLine(); | 356 this->attemptToSimplifyLine(); |
357 } | 357 } |
358 } else { | 358 } else { |
359 if (fInheritedKey.count() || this->path().isVolatile()) { | 359 if (fInheritedKey.count() || this->path().isVolatile()) { |
360 fPathData.fGenID = 0; | 360 fPathData.fGenID = 0; |
361 } else { | 361 } else { |
362 fPathData.fGenID = this->path().getGenerationID(); | 362 fPathData.fGenID = this->path().getGenerationID(); |
363 } | 363 } |
| 364 if (this->style().isSimpleFill()) { |
| 365 this->path().close(); |
| 366 this->path().setIsVolatile(true); |
| 367 } |
364 if (!this->style().hasNonDashPathEffect()) { | 368 if (!this->style().hasNonDashPathEffect()) { |
365 if (this->style().strokeRec().getStyle() == SkStrokeRec::kStroke_Sty
le || | 369 if (this->style().strokeRec().getStyle() == SkStrokeRec::kStroke_Sty
le || |
366 this->style().strokeRec().getStyle() == SkStrokeRec::kHairline_S
tyle) { | 370 this->style().strokeRec().getStyle() == SkStrokeRec::kHairline_S
tyle) { |
367 // Stroke styles don't differentiate between winding and even/od
d. | 371 // Stroke styles don't differentiate between winding and even/od
d. |
368 // Moreover, dashing ignores inverseness (skbug.com/5421) | 372 // Moreover, dashing ignores inverseness (skbug.com/5421) |
369 bool inverse = !this->style().isDashed() && this->path().isInver
seFillType(); | 373 bool inverse = !this->style().isDashed() && this->path().isInver
seFillType(); |
370 if (inverse) { | 374 if (inverse) { |
371 this->path().setFillType(kDefaultPathInverseFillType); | 375 this->path().setFillType(kDefaultPathInverseFillType); |
372 } else { | 376 } else { |
373 this->path().setFillType(kDefaultPathFillType); | 377 this->path().setFillType(kDefaultPathFillType); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 fStyle = GrStyle::SimpleFill(); | 482 fStyle = GrStyle::SimpleFill(); |
479 return; | 483 return; |
480 } | 484 } |
481 } | 485 } |
482 // Only path effects could care about the order of the points. Otherwise can
onicalize | 486 // Only path effects could care about the order of the points. Otherwise can
onicalize |
483 // the point order. | 487 // the point order. |
484 if (pts[1].fY < pts[0].fY || (pts[1].fY == pts[0].fY && pts[1].fX < pts[0].f
X)) { | 488 if (pts[1].fY < pts[0].fY || (pts[1].fY == pts[0].fY && pts[1].fX < pts[0].f
X)) { |
485 SkTSwap(pts[0], pts[1]); | 489 SkTSwap(pts[0], pts[1]); |
486 } | 490 } |
487 } | 491 } |
OLD | NEW |