Chromium Code Reviews| Index: tests/GLProgramsTest.cpp |
| diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp |
| index a16173b9652f772de9ee8eeefe9a3a0117173d54..f3a9f5964eef69f936ff3e36f3dcd128419eb306 100644 |
| --- a/tests/GLProgramsTest.cpp |
| +++ b/tests/GLProgramsTest.cpp |
| @@ -131,7 +131,8 @@ bool GrGLProgramDesc::setRandom(SkRandom* random, |
| -1; |
| bool useGS = random->nextBool(); |
| #if GR_GL_EXPERIMENTAL_GS |
| - header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && useGS; |
| + header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && useGS && |
|
bsalomon
2014/10/01 19:40:58
Feel free to delete this entirely.
|
| + kGL_GrGLStandard == gpu->glStandard(); |
| #else |
| (void) useGS; |
| #endif |
| @@ -331,7 +332,6 @@ bool GrGpuGL::programUnitTest(int maxStages) { |
| drawType)) { |
| return false; |
| } |
| - |
| SkAutoTUnref<GrGLProgram> program(GrGLProgram::Create(this, |
| pdesc, |
| geometryProcessor.get(), |
| @@ -343,7 +343,6 @@ bool GrGpuGL::programUnitTest(int maxStages) { |
| if (NULL == program.get()) { |
| return false; |
| } |
| - |
| // We have to reset the drawstate because we might have added a gp |
| this->drawState()->reset(); |
| } |
| @@ -355,7 +354,21 @@ DEF_GPUTEST(GLPrograms, reporter, factory) { |
| GrContext* context = factory->get(static_cast<GrContextFactory::GLContextType>(type)); |
| if (context) { |
| GrGpuGL* gpu = static_cast<GrGpuGL*>(context->getGpu()); |
| - int maxStages = 6; |
| + /* |
| + * For the time being, we only support the test with desktop GL or for android on |
| + * ARM platforms |
| + * TODO When we run ES 3.00 GLSL in more places, test again |
| + */ |
| + int maxStages; |
|
robertphillips
2014/10/01 19:45:56
This line alignment is a bit odd.
|
| + if (kGL_GrGLStandard == gpu->glStandard() || |
| + kARM_GrGLVendor == gpu->ctxInfo().vendor()) { |
| + maxStages = 6; |
| + } else if (kTegra3_GrGLRenderer == gpu->ctxInfo().renderer() || |
| + kOther_GrGLRenderer == gpu->ctxInfo().renderer()) { |
| + maxStages = 1; |
| + } else { |
| + return; |
| + } |
| #if SK_ANGLE |
| // Some long shaders run out of temporary registers in the D3D compiler on ANGLE. |
| if (type == GrContextFactory::kANGLE_GLContextType) { |
| @@ -367,29 +380,4 @@ DEF_GPUTEST(GLPrograms, reporter, factory) { |
| } |
| } |
| -// This is evil evil evil. The linker may throw away whole translation units as dead code if it |
| -// thinks none of the functions are called. It will do this even if there are static initializers |
| -// in the unit that could pass pointers to functions from the unit out to other translation units! |
| -// We force some of the effects that would otherwise be discarded to link here. |
| - |
| -#include "SkAlphaThresholdFilter.h" |
| -#include "SkColorMatrixFilter.h" |
| -#include "SkLightingImageFilter.h" |
| -#include "SkMagnifierImageFilter.h" |
| - |
| -void forceLinking(); |
| - |
| -void forceLinking() { |
| - SkLightingImageFilter::CreateDistantLitDiffuse(SkPoint3(0,0,0), 0, 0, 0); |
| - SkAlphaThresholdFilter::Create(SkRegion(), .5f, .5f); |
| - SkAutoTUnref<SkImageFilter> mag(SkMagnifierImageFilter::Create( |
| - SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar1)); |
| - GrConfigConversionEffect::Create(NULL, |
| - false, |
| - GrConfigConversionEffect::kNone_PMConversion, |
| - SkMatrix::I()); |
| - SkScalar matrix[20]; |
| - SkAutoTUnref<SkColorMatrixFilter> cmf(SkColorMatrixFilter::Create(matrix)); |
| -} |
| - |
| #endif |