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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 if (!fPath.get()->isLine(nullptr)) { | 330 if (!fPath.get()->isLine(nullptr)) { |
331 fPath.get()->close(); | 331 fPath.get()->close(); |
332 fPath.get()->setIsVolatile(true); | 332 fPath.get()->setIsVolatile(true); |
333 } | 333 } |
334 } | 334 } |
335 if (!this->style().hasNonDashPathEffect()) { | 335 if (!this->style().hasNonDashPathEffect()) { |
336 if (this->style().strokeRec().getStyle() == SkStrokeRec::kStroke_Sty
le || | 336 if (this->style().strokeRec().getStyle() == SkStrokeRec::kStroke_Sty
le || |
337 this->style().strokeRec().getStyle() == SkStrokeRec::kHairline_S
tyle) { | 337 this->style().strokeRec().getStyle() == SkStrokeRec::kHairline_S
tyle) { |
338 // Stroke styles don't differentiate between winding and even/od
d. | 338 // Stroke styles don't differentiate between winding and even/od
d. |
339 // Moreover, dashing ignores inverseness (skbug.com/5421) | 339 // Moreover, dashing ignores inverseness (skbug.com/5421) |
340 bool inverse = !this->fStyle.isDashed() && fPath.get()->isInvers
eFillType(); | 340 bool inverse = !this->style().isDashed() && fPath.get()->isInver
seFillType(); |
341 if (inverse) { | 341 if (inverse) { |
342 fPath.get()->setFillType(kDefaultPathInverseFillType); | 342 fPath.get()->setFillType(kDefaultPathInverseFillType); |
343 } else { | 343 } else { |
344 fPath.get()->setFillType(kDefaultPathFillType); | 344 fPath.get()->setFillType(kDefaultPathFillType); |
345 } | 345 } |
346 } else if (fPath.get()->isConvex()) { | 346 } else if (fPath.get()->isConvex()) { |
347 // There is no distinction between even/odd and non-zero winding
count for convex | 347 // There is no distinction between even/odd and non-zero winding
count for convex |
348 // paths. | 348 // paths. |
349 if (fPath.get()->isInverseFillType()) { | 349 if (fPath.get()->isInverseFillType()) { |
350 fPath.get()->setFillType(kDefaultPathInverseFillType); | 350 fPath.get()->setFillType(kDefaultPathInverseFillType); |
(...skipping 13 matching lines...) Expand all Loading... |
364 return; | 364 return; |
365 } | 365 } |
366 if (!this->style().hasPathEffect()) { | 366 if (!this->style().hasPathEffect()) { |
367 fRRectDir = kDefaultRRectDir; | 367 fRRectDir = kDefaultRRectDir; |
368 fRRectStart = kDefaultRRectStart; | 368 fRRectStart = kDefaultRRectStart; |
369 } else if (fStyle.isDashed()) { | 369 } else if (fStyle.isDashed()) { |
370 // Dashing ignores the inverseness (currently). skbug.com/5421 | 370 // Dashing ignores the inverseness (currently). skbug.com/5421 |
371 fRRectIsInverted = false; | 371 fRRectIsInverted = false; |
372 } | 372 } |
373 } | 373 } |
OLD | NEW |