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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 drawState->setVertexAttribs<gPathAttribs>(SK_ARRAY_COUNT(gPathAttribs)); | 638 drawState->setVertexAttribs<gPathAttribs>(SK_ARRAY_COUNT(gPathAttribs)); |
639 | 639 |
640 enum { | 640 enum { |
641 // the edge effects share this stage with glyph rendering | 641 // the edge effects share this stage with glyph rendering |
642 // (kGlyphMaskStage in GrTextContext) && SW path rendering | 642 // (kGlyphMaskStage in GrTextContext) && SW path rendering |
643 // (kPathMaskStage in GrSWMaskHelper) | 643 // (kPathMaskStage in GrSWMaskHelper) |
644 kEdgeEffectStage = GrPaint::kTotalStages, | 644 kEdgeEffectStage = GrPaint::kTotalStages, |
645 }; | 645 }; |
646 static const int kEdgeAttrIndex = 1; | 646 static const int kEdgeAttrIndex = 1; |
647 GrEffectRef* quadEffect = QuadEdgeEffect::Create(); | 647 GrEffectRef* quadEffect = QuadEdgeEffect::Create(); |
648 drawState->setEffect(kEdgeEffectStage, quadEffect, kEdgeAttrIndex)->unref(); | 648 drawState->addCoverageEffect(quadEffect, kEdgeAttrIndex)->unref(); |
649 | 649 |
650 GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount); | 650 GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount); |
651 if (!arg.succeeded()) { | 651 if (!arg.succeeded()) { |
652 return false; | 652 return false; |
653 } | 653 } |
654 GrAssert(sizeof(QuadVertex) == drawState->getVertexSize()); | 654 GrAssert(sizeof(QuadVertex) == drawState->getVertexSize()); |
655 verts = reinterpret_cast<QuadVertex*>(arg.vertices()); | 655 verts = reinterpret_cast<QuadVertex*>(arg.vertices()); |
656 idxs = reinterpret_cast<uint16_t*>(arg.indices()); | 656 idxs = reinterpret_cast<uint16_t*>(arg.indices()); |
657 | 657 |
658 SkSTArray<kPreallocDrawCnt, Draw, true> draws; | 658 SkSTArray<kPreallocDrawCnt, Draw, true> draws; |
(...skipping 24 matching lines...) Expand all Loading... |
683 vOffset, // start vertex | 683 vOffset, // start vertex |
684 0, // start index | 684 0, // start index |
685 draw.fVertexCnt, | 685 draw.fVertexCnt, |
686 draw.fIndexCnt, | 686 draw.fIndexCnt, |
687 &devBounds); | 687 &devBounds); |
688 vOffset += draw.fVertexCnt; | 688 vOffset += draw.fVertexCnt; |
689 } | 689 } |
690 | 690 |
691 return true; | 691 return true; |
692 } | 692 } |
OLD | NEW |