Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Unified Diff: tests/GLProgramsTest.cpp

Issue 1869503002: Make existing unit tests only run on GL contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/FloatingPointTextureTest.cpp ('k') | tests/GpuColorFilterTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GLProgramsTest.cpp
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index cf442fd2b85c31c30f57d036f9db25620c331ff8..8e7d800814446a61a9c8c4ccef128891498e5582 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
« no previous file with comments | « tests/FloatingPointTextureTest.cpp ('k') | tests/GpuColorFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698