diff options
| author | bsalomon <bsalomon@google.com> | 2016-04-06 14:02:39 -0700 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2016-04-06 14:02:39 -0700 |
| commit | 758586c7f11a6b3529bd4a1c9b4e982a0d0b0582 (patch) | |
| tree | 6a325080ce7cd2b6b1396eade7eaa3ff804b44e6 /tests/GLProgramsTest.cpp | |
| parent | 9e65f9399ea9d50dca723ca23c10ec4145b54abe (diff) | |
Make existing unit tests only run on GL contexts
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1869503002
Review URL: https://codereview.chromium.org/1869503002
Diffstat (limited to 'tests/GLProgramsTest.cpp')
| -rw-r--r-- | tests/GLProgramsTest.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index cf442fd2b8..8e7d800814 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -446,6 +446,16 @@ static void test_glprograms_other_contexts( REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(ctxInfo.fGrContext, maxStages)); } +static bool is_native_gl_context_type(sk_gpu_test::GrContextFactory::ContextType type) { + return type == sk_gpu_test::GrContextFactory::kNativeGL_ContextType; +} + +static bool is_other_rendering_gl_context_type(sk_gpu_test::GrContextFactory::ContextType type) { + return !is_native_gl_context_type(type) && + kOpenGL_GrBackend == sk_gpu_test::GrContextFactory::ContextTypeBackend(type) && + sk_gpu_test::GrContextFactory::IsRenderingContext(type); +} + DEF_GPUTEST(GLPrograms, reporter, /*factory*/) { // Set a locale that would cause shader compilation to fail because of , as decimal separator. // skbug 3330 @@ -459,10 +469,10 @@ DEF_GPUTEST(GLPrograms, reporter, /*factory*/) { GrContextOptions opts; opts.fSuppressPrints = true; sk_gpu_test::GrContextFactory debugFactory(opts); - skiatest::RunWithGPUTestContexts(test_glprograms_native, skiatest::kNative_GPUTestContexts, + skiatest::RunWithGPUTestContexts(test_glprograms_native, &is_native_gl_context_type, reporter, &debugFactory); skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts, - skiatest::kOther_GPUTestContexts, reporter, &debugFactory); + &is_other_rendering_gl_context_type, reporter, &debugFactory); } #endif |
