Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 509153002: Initial change to create GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: last warning Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/beziereffects.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « gm/beziereffects.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698