Index: tests/skia_test.cpp |
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp |
index 65fbc3284297a9070737fbacd3994e08ac2502f5..d10f65bf2edf4af045c90071d9a19cc36e4533f5 100644 |
--- a/tests/skia_test.cpp |
+++ b/tests/skia_test.cpp |
@@ -174,7 +174,11 @@ int test_main() { |
// Now run them. |
int skipCount = 0; |
+#if SK_SUPPORT_GPU |
+ SkTaskGroup::Enabler enabled(FLAGS_threads, GrContextFactory::ReleaseGpuAPIsInThread); |
+#else |
SkTaskGroup::Enabler enabled(FLAGS_threads); |
+#endif |
SkTaskGroup cpuTests; |
SkTArray<const Test*> gpuTests; |
@@ -218,6 +222,10 @@ int test_main() { |
} |
SkDebugf("\n"); |
+#if SK_SUPPORT_GPU |
+ // The main thread maybe ran GPU code. |
+ GrContextFactory::ReleaseGpuAPIsInThread(); |
+#endif |
return (status.failCount() == 0) ? 0 : 1; |
} |