OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
10 | 10 |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 }; | 630 }; |
631 SkSTArray<kPreallocSegmentCnt, Segment, true> segments; | 631 SkSTArray<kPreallocSegmentCnt, Segment, true> segments; |
632 SkPoint fanPt; | 632 SkPoint fanPt; |
633 | 633 |
634 if (!get_segments(*path, viewMatrix, &segments, &fanPt, &vCount, &iCount)) { | 634 if (!get_segments(*path, viewMatrix, &segments, &fanPt, &vCount, &iCount)) { |
635 return false; | 635 return false; |
636 } | 636 } |
637 | 637 |
638 drawState->setVertexAttribs<gPathAttribs>(SK_ARRAY_COUNT(gPathAttribs)); | 638 drawState->setVertexAttribs<gPathAttribs>(SK_ARRAY_COUNT(gPathAttribs)); |
639 | 639 |
640 enum { | |
641 // the edge effects share this stage with glyph rendering | |
642 // (kGlyphMaskStage in GrTextContext) && SW path rendering | |
643 // (kPathMaskStage in GrSWMaskHelper) | |
644 kEdgeEffectStage = GrPaint::kTotalStages, | |
645 }; | |
646 static const int kEdgeAttrIndex = 1; | 640 static const int kEdgeAttrIndex = 1; |
647 GrEffectRef* quadEffect = QuadEdgeEffect::Create(); | 641 GrEffectRef* quadEffect = QuadEdgeEffect::Create(); |
648 drawState->addCoverageEffect(quadEffect, kEdgeAttrIndex)->unref(); | 642 drawState->addCoverageEffect(quadEffect, kEdgeAttrIndex)->unref(); |
649 | 643 |
650 GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount); | 644 GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount); |
651 if (!arg.succeeded()) { | 645 if (!arg.succeeded()) { |
652 return false; | 646 return false; |
653 } | 647 } |
654 GrAssert(sizeof(QuadVertex) == drawState->getVertexSize()); | 648 GrAssert(sizeof(QuadVertex) == drawState->getVertexSize()); |
655 verts = reinterpret_cast<QuadVertex*>(arg.vertices()); | 649 verts = reinterpret_cast<QuadVertex*>(arg.vertices()); |
(...skipping 27 matching lines...) Expand all Loading... |
683 vOffset, // start vertex | 677 vOffset, // start vertex |
684 0, // start index | 678 0, // start index |
685 draw.fVertexCnt, | 679 draw.fVertexCnt, |
686 draw.fIndexCnt, | 680 draw.fIndexCnt, |
687 &devBounds); | 681 &devBounds); |
688 vOffset += draw.fVertexCnt; | 682 vOffset += draw.fVertexCnt; |
689 } | 683 } |
690 | 684 |
691 return true; | 685 return true; |
692 } | 686 } |
OLD | NEW |