| 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 "gl/builders/GrGLProgramBuilder.h" | 9 #include "gl/builders/GrGLProgramBuilder.h" |
| 10 #include "GrAAConvexPathRenderer.h" | 10 #include "GrAAConvexPathRenderer.h" |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 return false; | 671 return false; |
| 672 } | 672 } |
| 673 | 673 |
| 674 // Our computed verts should all be within one pixel of the segment control
points. | 674 // Our computed verts should all be within one pixel of the segment control
points. |
| 675 devBounds.outset(SK_Scalar1, SK_Scalar1); | 675 devBounds.outset(SK_Scalar1, SK_Scalar1); |
| 676 | 676 |
| 677 drawState->setVertexAttribs<gPathAttribs>(SK_ARRAY_COUNT(gPathAttribs), size
of(QuadVertex)); | 677 drawState->setVertexAttribs<gPathAttribs>(SK_ARRAY_COUNT(gPathAttribs), size
of(QuadVertex)); |
| 678 | 678 |
| 679 static const int kEdgeAttrIndex = 1; | 679 static const int kEdgeAttrIndex = 1; |
| 680 GrEffect* quadEffect = QuadEdgeEffect::Create(); | 680 GrEffect* quadEffect = QuadEdgeEffect::Create(); |
| 681 drawState->addCoverageEffect(quadEffect, kEdgeAttrIndex)->unref(); | 681 drawState->setGeometryProcessor(quadEffect, kEdgeAttrIndex)->unref(); |
| 682 | 682 |
| 683 GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount); | 683 GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount); |
| 684 if (!arg.succeeded()) { | 684 if (!arg.succeeded()) { |
| 685 return false; | 685 return false; |
| 686 } | 686 } |
| 687 verts = reinterpret_cast<QuadVertex*>(arg.vertices()); | 687 verts = reinterpret_cast<QuadVertex*>(arg.vertices()); |
| 688 idxs = reinterpret_cast<uint16_t*>(arg.indices()); | 688 idxs = reinterpret_cast<uint16_t*>(arg.indices()); |
| 689 | 689 |
| 690 SkSTArray<kPreallocDrawCnt, Draw, true> draws; | 690 SkSTArray<kPreallocDrawCnt, Draw, true> draws; |
| 691 create_vertices(segments, fanPt, &draws, verts, idxs); | 691 create_vertices(segments, fanPt, &draws, verts, idxs); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 709 vOffset, // start vertex | 709 vOffset, // start vertex |
| 710 0, // start index | 710 0, // start index |
| 711 draw.fVertexCnt, | 711 draw.fVertexCnt, |
| 712 draw.fIndexCnt, | 712 draw.fIndexCnt, |
| 713 &devBounds); | 713 &devBounds); |
| 714 vOffset += draw.fVertexCnt; | 714 vOffset += draw.fVertexCnt; |
| 715 } | 715 } |
| 716 | 716 |
| 717 return true; | 717 return true; |
| 718 } | 718 } |
| OLD | NEW |