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

Side by Side Diff: src/gpu/GrAAHairLinePathRenderer.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/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrContext.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 2011 Google Inc. 3 * Copyright 2011 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 "GrAAHairLinePathRenderer.h" 9 #include "GrAAHairLinePathRenderer.h"
10 10
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 if (target->getDrawState().getViewMatrix().hasPerspective()) { 826 if (target->getDrawState().getViewMatrix().hasPerspective()) {
827 asr.set(target, GrDrawTarget::kPreserve_ASRInit); 827 asr.set(target, GrDrawTarget::kPreserve_ASRInit);
828 } else if (!asr.setIdentity(target, GrDrawTarget::kPreserve_ASRInit)) { 828 } else if (!asr.setIdentity(target, GrDrawTarget::kPreserve_ASRInit)) {
829 return false; 829 return false;
830 } 830 }
831 GrDrawState* drawState = target->drawState(); 831 GrDrawState* drawState = target->drawState();
832 832
833 // TODO: See whether rendering lines as degenerate quads improves perf 833 // TODO: See whether rendering lines as degenerate quads improves perf
834 // when we have a mix 834 // when we have a mix
835 835
836 enum {
837 // the edge effects share this stage with glyph rendering
838 // (kGlyphMaskStage in GrTextContext) && SW path rendering
839 // (kPathMaskStage in GrSWMaskHelper)
840 kEdgeEffectStage = GrPaint::kTotalStages,
841 };
842 static const int kEdgeAttrIndex = 1; 836 static const int kEdgeAttrIndex = 1;
843 837
844 GrEffectRef* hairLineEffect = HairLineEdgeEffect::Create(); 838 GrEffectRef* hairLineEffect = HairLineEdgeEffect::Create();
845 GrEffectRef* hairQuadEffect = HairQuadEdgeEffect::Create(); 839 GrEffectRef* hairQuadEffect = HairQuadEdgeEffect::Create();
846 840
847 // Check devBounds 841 // Check devBounds
848 #if GR_DEBUG 842 #if GR_DEBUG
849 SkRect tolDevBounds = devBounds; 843 SkRect tolDevBounds = devBounds;
850 tolDevBounds.outset(SK_Scalar1 / 10000, SK_Scalar1 / 10000); 844 tolDevBounds.outset(SK_Scalar1 / 10000, SK_Scalar1 / 10000);
851 SkRect actualBounds; 845 SkRect actualBounds;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 0, // startI 893 0, // startI
900 kVertsPerQuad*n, // vCount 894 kVertsPerQuad*n, // vCount
901 kIdxsPerQuad*n, // iCount 895 kIdxsPerQuad*n, // iCount
902 &devBounds); 896 &devBounds);
903 quads += n; 897 quads += n;
904 } 898 }
905 target->resetIndexSource(); 899 target->resetIndexSource();
906 900
907 return true; 901 return true;
908 } 902 }
OLDNEW
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698