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

Unified Diff: dm/DM.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 | « bench/nanobench.cpp ('k') | include/gpu/gl/SkGLContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index f37fc8b7fff8eeab49ac62ce5f0a098580aacb03..c616e66cad94056ee19c75226d72dfcf8e05717a 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1105,7 +1105,11 @@ int dm_main() {
JsonWriter::DumpJson(); // It's handy for the bots to assume this is ~never missing.
SkAutoGraphics ag;
+#if SK_SUPPORT_GPU
+ SkTaskGroup::Enabler enabled(FLAGS_threads, GrContextFactory::ReleaseGpuAPIsInThread);
+#else
SkTaskGroup::Enabler enabled(FLAGS_threads);
+#endif
gCreateTypefaceDelegate = &create_from_name;
{
@@ -1183,6 +1187,11 @@ int dm_main() {
print_status();
SkDebugf("Finished!\n");
+
+#if SK_SUPPORT_GPU
+ // The main thread maybe ran GPU code.
+ GrContextFactory::ReleaseGpuAPIsInThread();
+#endif
return 0;
}
« no previous file with comments | « bench/nanobench.cpp ('k') | include/gpu/gl/SkGLContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698