Index: tests/GLProgramsTest.cpp |
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp |
index a7482120b4f453d20e3ee117bdfbd01bed1de76b..8ca33c2450de0347dd0c921ddb3a0befa450b281 100644 |
--- a/tests/GLProgramsTest.cpp |
+++ b/tests/GLProgramsTest.cpp |
@@ -42,8 +42,12 @@ bool GrGLProgramDesc::setRandom(SkRandom* random, |
const GrEffectStage* stages[], |
int numColorStages, |
int numCoverageStages, |
- int currAttribIndex) { |
- bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::kMaxVertexAttribCnt; |
+ int currAttribIndex, |
+ GrGpu::DrawType drawType) { |
+ bool isPathRendering = GrGpu::IsPathRenderingDrawType(drawType); |
+ bool useLocalCoords = !isPathRendering && |
+ random->nextBool() && |
+ currAttribIndex < GrDrawState::kMaxVertexAttribCnt; |
int numStages = numColorStages + numCoverageStages; |
fKey.reset(); |
@@ -110,12 +114,10 @@ bool GrGLProgramDesc::setRandom(SkRandom* random, |
// if the effects have used up all off the available attributes, |
// don't try to use color or coverage attributes as input |
do { |
- uint32_t colorRand = random->nextULessThan(2); |
- header->fColorInput = (0 == colorRand) ? GrGLProgramDesc::kAttribute_ColorInput : |
- GrGLProgramDesc::kUniform_ColorInput; |
- } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex && |
+ header->fColorInput = static_cast<GrGLProgramDesc::ColorInput>( |
+ random->nextULessThan(kColorInputCnt)); |
+ } while ((GrDrawState::kMaxVertexAttribCnt <= currAttribIndex || isPathRendering) && |
kAttribute_ColorInput == header->fColorInput); |
- |
header->fColorAttributeIndex = (header->fColorInput == kAttribute_ColorInput) ? |
currAttribIndex++ : |
-1; |
@@ -123,7 +125,7 @@ bool GrGLProgramDesc::setRandom(SkRandom* random, |
do { |
header->fCoverageInput = static_cast<GrGLProgramDesc::ColorInput>( |
random->nextULessThan(kColorInputCnt)); |
- } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex && |
+ } while ((GrDrawState::kMaxVertexAttribCnt <= currAttribIndex || isPathRendering) && |
kAttribute_ColorInput == header->fCoverageInput); |
header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_ColorInput) ? |
currAttribIndex++ : |
@@ -151,10 +153,7 @@ bool GrGLProgramDesc::setRandom(SkRandom* random, |
header->fFragPosKey = 0; |
} |
- header->fRequiresVertexShader = vertexShader || |
- useLocalCoords || |
- kAttribute_ColorInput == header->fColorInput || |
- kAttribute_ColorInput == header->fCoverageInput; |
+ header->fDoPathRendering = isPathRendering; |
header->fHasGeometryProcessor = vertexShader; |
CoverageOutput coverageOutput; |
@@ -247,8 +246,11 @@ bool GrGpuGL::programUnitTest(int maxStages) { |
SkAutoSTMalloc<8, const GrEffectStage*> stages(numStages); |
bool useFixedFunctionPathRendering = this->glCaps().pathRenderingSupport() && |
- this->glPathRendering()->texturingMode() == GrGLPathRendering::FixedFunction_TexturingMode && |
- random.nextBool(); |
+ this->glPathRendering()->texturingMode() == GrGLPathRendering::FixedFunction_TexturingMode; |
+ bool usePathRenderingDrawType = useFixedFunctionPathRendering && random.nextBool(); |
+ |
+ GrGpu::DrawType drawType = usePathRenderingDrawType ? GrGpu::kDrawPath_DrawType : |
+ GrGpu::kDrawPoints_DrawType; |
SkAutoTDelete<GrEffectStage> geometryProcessor; |
bool hasGeometryProcessor = useFixedFunctionPathRendering ? false : random.nextBool(); |
@@ -325,7 +327,8 @@ bool GrGpuGL::programUnitTest(int maxStages) { |
stages.get(), |
numColorStages, |
numCoverageStages, |
- currAttribIndex)) { |
+ currAttribIndex, |
+ drawType)) { |
return false; |
} |