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 } | |
368 if (!this->style().hasNonDashPathEffect()) { | 364 if (!this->style().hasNonDashPathEffect()) { |
369 if (this->style().strokeRec().getStyle() == SkStrokeRec::kStroke_Sty
le || | 365 if (this->style().strokeRec().getStyle() == SkStrokeRec::kStroke_Sty
le || |
370 this->style().strokeRec().getStyle() == SkStrokeRec::kHairline_S
tyle) { | 366 this->style().strokeRec().getStyle() == SkStrokeRec::kHairline_S
tyle) { |
371 // Stroke styles don't differentiate between winding and even/od
d. | 367 // Stroke styles don't differentiate between winding and even/od
d. |
372 // Moreover, dashing ignores inverseness (skbug.com/5421) | 368 // Moreover, dashing ignores inverseness (skbug.com/5421) |
373 bool inverse = !this->style().isDashed() && this->path().isInver
seFillType(); | 369 bool inverse = !this->style().isDashed() && this->path().isInver
seFillType(); |
374 if (inverse) { | 370 if (inverse) { |
375 this->path().setFillType(kDefaultPathInverseFillType); | 371 this->path().setFillType(kDefaultPathInverseFillType); |
376 } else { | 372 } else { |
377 this->path().setFillType(kDefaultPathFillType); | 373 this->path().setFillType(kDefaultPathFillType); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 fStyle = GrStyle::SimpleFill(); | 478 fStyle = GrStyle::SimpleFill(); |
483 return; | 479 return; |
484 } | 480 } |
485 } | 481 } |
486 // Only path effects could care about the order of the points. Otherwise can
onicalize | 482 // Only path effects could care about the order of the points. Otherwise can
onicalize |
487 // the point order. | 483 // the point order. |
488 if (pts[1].fY < pts[0].fY || (pts[1].fY == pts[0].fY && pts[1].fX < pts[0].f
X)) { | 484 if (pts[1].fY < pts[0].fY || (pts[1].fY == pts[0].fY && pts[1].fX < pts[0].f
X)) { |
489 SkTSwap(pts[0], pts[1]); | 485 SkTSwap(pts[0], pts[1]); |
490 } | 486 } |
491 } | 487 } |
OLD | NEW |