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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 SkDebugf("Could not allocate indices\n"); | 816 SkDebugf("Could not allocate indices\n"); |
817 return; | 817 return; |
818 } | 818 } |
819 | 819 |
820 QuadVertex* verts = reinterpret_cast<QuadVertex*>(vertices); | 820 QuadVertex* verts = reinterpret_cast<QuadVertex*>(vertices); |
821 uint16_t* idxs = reinterpret_cast<uint16_t*>(indices); | 821 uint16_t* idxs = reinterpret_cast<uint16_t*>(indices); |
822 | 822 |
823 SkSTArray<kPreallocDrawCnt, Draw, true> draws; | 823 SkSTArray<kPreallocDrawCnt, Draw, true> draws; |
824 create_vertices(segments, fanPt, &draws, verts, idxs); | 824 create_vertices(segments, fanPt, &draws, verts, idxs); |
825 | 825 |
826 GrDrawTarget::DrawInfo info; | 826 GrVertices info; |
827 | 827 |
828 for (int i = 0; i < draws.count(); ++i) { | 828 for (int i = 0; i < draws.count(); ++i) { |
829 const Draw& draw = draws[i]; | 829 const Draw& draw = draws[i]; |
830 info.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, index
Buffer, firstVertex, | 830 info.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, index
Buffer, firstVertex, |
831 firstIndex, draw.fVertexCnt, draw.fIndexCnt); | 831 firstIndex, draw.fVertexCnt, draw.fIndexCnt); |
832 batchTarget->draw(info); | 832 batchTarget->draw(info); |
833 firstVertex += draw.fVertexCnt; | 833 firstVertex += draw.fVertexCnt; |
834 firstIndex += draw.fIndexCnt; | 834 firstIndex += draw.fIndexCnt; |
835 } | 835 } |
836 } | 836 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 geometry.fColor = color; | 895 geometry.fColor = color; |
896 geometry.fViewMatrix = vm; | 896 geometry.fViewMatrix = vm; |
897 geometry.fPath = path; | 897 geometry.fPath = path; |
898 | 898 |
899 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); | 899 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); |
900 target->drawBatch(pipelineBuilder, batch); | 900 target->drawBatch(pipelineBuilder, batch); |
901 | 901 |
902 return true; | 902 return true; |
903 | 903 |
904 } | 904 } |
OLD | NEW |