destroyContexts after each bench instead of before
BUG=skia:
Review URL: https://codereview.chromium.org/394893002
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 69e5de9..8f3d4aa 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -219,9 +219,6 @@
}
#if SK_SUPPORT_GPU
- if (FLAGS_resetGpuContext) {
- gGrFactory.destroyContexts();
- }
#define GPU_TARGET(config, ctxType, info, samples) \
if (Target* t = is_enabled(bench, Benchmark::kGPU_Backend, #config)) { \
@@ -360,6 +357,12 @@
}
}
targets.deleteAll();
+
+ #if SK_SUPPORT_GPU
+ if (FLAGS_resetGpuContext) {
+ gGrFactory.destroyContexts();
+ }
+ #endif
}
return 0;