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

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

Issue 16952006: Replace fixed-size array of effect stages in GrDrawState with two appendable arrays, one for color,… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix comments Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « include/gpu/GrEffectStage.h ('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 "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 10
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « include/gpu/GrEffectStage.h ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698