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

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

Issue 18686007: Make GrPaint have a variable sized array of color and coverage stages rather than a fixed size. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rob's comments Created 7 years, 5 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 | « src/effects/SkXfermodeImageFilter.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 "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 10
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 }; 630 };
631 SkSTArray<kPreallocSegmentCnt, Segment, true> segments; 631 SkSTArray<kPreallocSegmentCnt, Segment, true> segments;
632 SkPoint fanPt; 632 SkPoint fanPt;
633 633
634 if (!get_segments(*path, viewMatrix, &segments, &fanPt, &vCount, &iCount)) { 634 if (!get_segments(*path, viewMatrix, &segments, &fanPt, &vCount, &iCount)) {
635 return false; 635 return false;
636 } 636 }
637 637
638 drawState->setVertexAttribs<gPathAttribs>(SK_ARRAY_COUNT(gPathAttribs)); 638 drawState->setVertexAttribs<gPathAttribs>(SK_ARRAY_COUNT(gPathAttribs));
639 639
640 enum {
641 // the edge effects share this stage with glyph rendering
642 // (kGlyphMaskStage in GrTextContext) && SW path rendering
643 // (kPathMaskStage in GrSWMaskHelper)
644 kEdgeEffectStage = GrPaint::kTotalStages,
645 };
646 static const int kEdgeAttrIndex = 1; 640 static const int kEdgeAttrIndex = 1;
647 GrEffectRef* quadEffect = QuadEdgeEffect::Create(); 641 GrEffectRef* quadEffect = QuadEdgeEffect::Create();
648 drawState->addCoverageEffect(quadEffect, kEdgeAttrIndex)->unref(); 642 drawState->addCoverageEffect(quadEffect, kEdgeAttrIndex)->unref();
649 643
650 GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount); 644 GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount);
651 if (!arg.succeeded()) { 645 if (!arg.succeeded()) {
652 return false; 646 return false;
653 } 647 }
654 GrAssert(sizeof(QuadVertex) == drawState->getVertexSize()); 648 GrAssert(sizeof(QuadVertex) == drawState->getVertexSize());
655 verts = reinterpret_cast<QuadVertex*>(arg.vertices()); 649 verts = reinterpret_cast<QuadVertex*>(arg.vertices());
(...skipping 27 matching lines...) Expand all
683 vOffset, // start vertex 677 vOffset, // start vertex
684 0, // start index 678 0, // start index
685 draw.fVertexCnt, 679 draw.fVertexCnt,
686 draw.fIndexCnt, 680 draw.fIndexCnt,
687 &devBounds); 681 &devBounds);
688 vOffset += draw.fVertexCnt; 682 vOffset += draw.fVertexCnt;
689 } 683 }
690 684
691 return true; 685 return true;
692 } 686 }
OLDNEW
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698