diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GLProgramsTest.cpp | 8 | ||||
-rw-r--r-- | tests/GpuSampleLocationsTest.cpp | 5 | ||||
-rw-r--r-- | tests/ResourceCacheTest.cpp | 3 | ||||
-rw-r--r-- | tests/SurfaceTest.cpp | 3 | ||||
-rw-r--r-- | tests/TestConfigParsing.cpp | 2 |
5 files changed, 18 insertions, 3 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 6e9bef9fc8..3cf28daad2 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -251,7 +251,11 @@ static bool set_random_state(GrPaint* paint, SkRandom* random) { } // right now, the only thing we seem to care about in drawState's stencil is 'doesWrite()' -static const GrUserStencilSettings* get_random_stencil(SkRandom* random) { +static const GrUserStencilSettings* get_random_stencil(SkRandom* random, GrContext* context) { + if (context->caps()->avoidStencilBuffers()) { + return &GrUserStencilSettings::kUnused; + } + static constexpr GrUserStencilSettings kDoesWriteStencil( GrUserStencilSettings::StaticInit< 0xffff, @@ -332,7 +336,7 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) { set_random_color_coverage_stages(&grPaint, &ptd, maxStages); set_random_xpf(&grPaint, &ptd); bool snapToCenters = set_random_state(&grPaint, &random); - const GrUserStencilSettings* uss = get_random_stencil(&random); + const GrUserStencilSettings* uss = get_random_stencil(&random, context); // We don't use kHW because we will hit an assertion if the render target is not // multisampled static constexpr GrAAType kAATypes[] = {GrAAType::kNone, GrAAType::kCoverage}; diff --git a/tests/GpuSampleLocationsTest.cpp b/tests/GpuSampleLocationsTest.cpp index 6e685463b7..75d2846dd6 100644 --- a/tests/GpuSampleLocationsTest.cpp +++ b/tests/GpuSampleLocationsTest.cpp @@ -190,6 +190,11 @@ private: DEF_GPUTEST(GLSampleLocations, reporter, /*factory*/) { GLTestSampleLocationsInterface testInterface; sk_sp<GrContext> ctx(GrContext::Create(kOpenGL_GrBackend, testInterface)); + + // This test relies on at least 2 samples. + if (ctx->caps()->maxSampleCount() < 2) { + return; + } test_sampleLocations(reporter, &testInterface, ctx.get()); } diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp index 5590c868bf..3a11bb9c2e 100644 --- a/tests/ResourceCacheTest.cpp +++ b/tests/ResourceCacheTest.cpp @@ -101,6 +101,9 @@ DEF_GPUTEST_FOR_CONTEXTS(ResourceCacheStencilBuffers, &is_rendering_and_not_angl smallDesc.fHeight = 4; smallDesc.fSampleCnt = 0; + if (context->caps()->avoidStencilBuffers()) { + return; + } GrResourceProvider* resourceProvider = context->resourceProvider(); // Test that two budgeted RTs with the same desc share a stencil buffer. sk_sp<GrTexture> smallRT0(resourceProvider->createTexture(smallDesc, SkBudgeted::kYes)); diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp index aa351edf56..1a03f15b0b 100644 --- a/tests/SurfaceTest.cpp +++ b/tests/SurfaceTest.cpp @@ -781,6 +781,9 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceAttachStencil_Gpu, reporter, ctxInf if (!gpu) { return; } + if (gpu->caps()->avoidStencilBuffers()) { + return; + } static const uint32_t kOrigColor = 0xFFAABBCC; for (auto& surfaceFunc : {&create_gpu_surface_backend_texture, diff --git a/tests/TestConfigParsing.cpp b/tests/TestConfigParsing.cpp index f9ac9318f2..83051aa2cc 100644 --- a/tests/TestConfigParsing.cpp +++ b/tests/TestConfigParsing.cpp @@ -80,7 +80,7 @@ DEF_TEST(ParseConfigs_DefaultConfigs, reporter) { "pdf", "skp", "svg", "xps", "angle_d3d11_es2", "angle_gl_es2", "commandbuffer", "mesa", "hwui", "glf16", "glessrgb", "gl", "glnvpr4", "glnvprdit4", "glsrgb", "glmsaa4", "vk", "glinst", "glinst4", "glinstdit4", "glinst8", "glinstdit8", "glesinst", "glesinst4", - "glesinstdit4", "glwide", "glnarrow" + "glesinstdit4", "glwide", "glnarrow", "glnostencils" }); SkCommandLineConfigArray configs; |