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 // This is a GPU-backend specific test. It relies on static intializers to work | 9 // This is a GPU-backend specific test. It relies on static intializers to work |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 fColorFilterXfermode = random->nextULessThan(SkXfermode::kCoeffModesCnt); | 32 fColorFilterXfermode = random->nextULessThan(SkXfermode::kCoeffModesCnt); |
33 | 33 |
34 fFirstCoverageStage = random->nextULessThan(GrDrawState::kNumStages); | 34 fFirstCoverageStage = random->nextULessThan(GrDrawState::kNumStages); |
35 | 35 |
36 fAttribBindings |= random->nextBool() ? GrDrawState::kCoverage_AttribBinding
sBit : 0; | 36 fAttribBindings |= random->nextBool() ? GrDrawState::kCoverage_AttribBinding
sBit : 0; |
37 | 37 |
38 #if GR_GL_EXPERIMENTAL_GS | 38 #if GR_GL_EXPERIMENTAL_GS |
39 fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->nextBool()
; | 39 fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->nextBool()
; |
40 #endif | 40 #endif |
41 | 41 |
42 bool edgeAA = random->nextBool(); | 42 if (gpu->caps()->shaderDerivativeSupport()) { |
43 if (edgeAA) { | 43 fDiscardIfOutsideEdge = random->nextBool(); |
44 fAttribBindings |= GrDrawState::kEdge_AttribBindingsBit; | 44 } else { |
45 if (gpu->caps()->shaderDerivativeSupport()) { | 45 fDiscardIfOutsideEdge = false; |
46 fVertexEdgeType = (GrDrawState::VertexEdgeType) | |
47 random->nextULessThan(GrDrawState::kVertexEdgeType
Cnt); | |
48 fDiscardIfOutsideEdge = random->nextBool(); | |
49 } else { | |
50 fVertexEdgeType = GrDrawState::kHairLine_EdgeType; | |
51 fDiscardIfOutsideEdge = false; | |
52 } | |
53 } | 46 } |
54 | 47 |
55 if (gpu->caps()->dualSourceBlendingSupport()) { | 48 if (gpu->caps()->dualSourceBlendingSupport()) { |
56 fDualSrcOutput = random->nextULessThan(kDualSrcOutputCnt); | 49 fDualSrcOutput = random->nextULessThan(kDualSrcOutputCnt); |
57 } else { | 50 } else { |
58 fDualSrcOutput = kNone_DualSrcOutput; | 51 fDualSrcOutput = kNone_DualSrcOutput; |
59 } | 52 } |
60 | 53 |
61 // use separate tex coords? | 54 // use separate tex coords? |
62 if (random->nextBool()) { | 55 if (random->nextBool()) { |
(...skipping 14 matching lines...) Expand all Loading... |
77 fPositionAttributeIndex = attributeIndex; | 70 fPositionAttributeIndex = attributeIndex; |
78 ++attributeIndex; | 71 ++attributeIndex; |
79 if (fColorInput || (fAttribBindings & GrDrawState::kColor_AttribBindingsBit)
) { | 72 if (fColorInput || (fAttribBindings & GrDrawState::kColor_AttribBindingsBit)
) { |
80 fColorAttributeIndex = attributeIndex; | 73 fColorAttributeIndex = attributeIndex; |
81 ++attributeIndex; | 74 ++attributeIndex; |
82 } | 75 } |
83 if (fCoverageInput || (fAttribBindings & GrDrawState::kCoverage_AttribBindin
gsBit)) { | 76 if (fCoverageInput || (fAttribBindings & GrDrawState::kCoverage_AttribBindin
gsBit)) { |
84 fCoverageAttributeIndex = attributeIndex; | 77 fCoverageAttributeIndex = attributeIndex; |
85 ++attributeIndex; | 78 ++attributeIndex; |
86 } | 79 } |
87 if (fAttribBindings & GrDrawState::kEdge_AttribBindingsBit) { | |
88 fEdgeAttributeIndex = attributeIndex; | |
89 ++attributeIndex; | |
90 } | |
91 if (fAttribBindings & GrDrawState::kLocalCoords_AttribBindingsBit) { | 80 if (fAttribBindings & GrDrawState::kLocalCoords_AttribBindingsBit) { |
92 fLocalCoordsAttributeIndex = attributeIndex; | 81 fLocalCoordsAttributeIndex = attributeIndex; |
93 ++attributeIndex; | 82 ++attributeIndex; |
94 } | 83 } |
95 } | 84 } |
96 | 85 |
97 bool GrGpuGL::programUnitTest(int maxStages) { | 86 bool GrGpuGL::programUnitTest(int maxStages) { |
98 | 87 |
99 maxStages = GrMin(maxStages, (int)GrDrawState::kNumStages); | 88 maxStages = GrMin(maxStages, (int)GrDrawState::kNumStages); |
100 | 89 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar
1); | 191 SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar
1); |
203 GrConfigConversionEffect::Create(NULL, | 192 GrConfigConversionEffect::Create(NULL, |
204 false, | 193 false, |
205 GrConfigConversionEffect::kNone_PMConversio
n, | 194 GrConfigConversionEffect::kNone_PMConversio
n, |
206 SkMatrix::I()); | 195 SkMatrix::I()); |
207 SkScalar matrix[20]; | 196 SkScalar matrix[20]; |
208 SkColorMatrixFilter cmf(matrix); | 197 SkColorMatrixFilter cmf(matrix); |
209 } | 198 } |
210 | 199 |
211 #endif | 200 #endif |
OLD | NEW |