OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |