OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrDefaultPathRenderer.h" | 8 #include "GrDefaultPathRenderer.h" |
9 | 9 |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } | 506 } |
507 return true; | 507 return true; |
508 } | 508 } |
509 | 509 |
510 bool GrDefaultPathRenderer::canDrawPath(const SkPath& path, | 510 bool GrDefaultPathRenderer::canDrawPath(const SkPath& path, |
511 const SkStrokeRec& stroke, | 511 const SkStrokeRec& stroke, |
512 const GrDrawTarget* target, | 512 const GrDrawTarget* target, |
513 bool antiAlias) const { | 513 bool antiAlias) const { |
514 // this class can draw any path with any fill but doesn't do any anti-aliasi
ng. | 514 // this class can draw any path with any fill but doesn't do any anti-aliasi
ng. |
515 | 515 |
516 return !antiAlias && | 516 return !antiAlias && !(SkPath::kConic_SegmentMask & path.getSegmentMasks())
&& |
517 (stroke.isFillStyle() || | 517 (stroke.isFillStyle() || |
518 IsStrokeHairlineOrEquivalent(stroke, target->getDrawState().getViewMatr
ix(), NULL)); | 518 IsStrokeHairlineOrEquivalent(stroke, target->getDrawState().getViewMatr
ix(), NULL)); |
519 } | 519 } |
520 | 520 |
521 bool GrDefaultPathRenderer::onDrawPath(const SkPath& path, | 521 bool GrDefaultPathRenderer::onDrawPath(const SkPath& path, |
522 const SkStrokeRec& stroke, | 522 const SkStrokeRec& stroke, |
523 GrDrawTarget* target, | 523 GrDrawTarget* target, |
524 bool antiAlias) { | 524 bool antiAlias) { |
525 return this->internalDrawPath(path, | 525 return this->internalDrawPath(path, |
526 stroke, | 526 stroke, |
527 target, | 527 target, |
528 false); | 528 false); |
529 } | 529 } |
530 | 530 |
531 void GrDefaultPathRenderer::onStencilPath(const SkPath& path, | 531 void GrDefaultPathRenderer::onStencilPath(const SkPath& path, |
532 const SkStrokeRec& stroke, | 532 const SkStrokeRec& stroke, |
533 GrDrawTarget* target) { | 533 GrDrawTarget* target) { |
534 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); | 534 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); |
535 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); | 535 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); |
536 this->internalDrawPath(path, stroke, target, true); | 536 this->internalDrawPath(path, stroke, target, true); |
537 } | 537 } |
OLD | NEW |