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

Unified Diff: bench/nanobench.cpp

Issue 1733323002: Clean up EGL thread state at thread exit in nanobench and DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix main thread usage also Created 4 years, 10 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 | « no previous file | dm/DM.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index c7cc3f0239ba96256eb82edaa87605ba959a795a..3d24c678f296a4e0d6ae993ad28f0426eae0bfb8 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -1020,7 +1020,11 @@ int nanobench_main();
int nanobench_main() {
SetupCrashHandler();
SkAutoGraphics ag;
+#if SK_SUPPORT_GPU
+ SkTaskGroup::Enabler enabled(FLAGS_threads, GrContextFactory::ReleaseGpuAPIsInThread);
+#else
SkTaskGroup::Enabler enabled(FLAGS_threads);
+#endif
#if SK_SUPPORT_GPU
GrContextOptions grContextOpts;
@@ -1272,7 +1276,10 @@ int nanobench_main() {
// SkEventTracer destructor
gGrFactory.reset(nullptr);
#endif
-
+#if SK_SUPPORT_GPU
+ // The main thread maybe ran GPU code.
+ GrContextFactory::ReleaseGpuAPIsInThread();
+#endif
return 0;
}
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698