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

Unified Diff: bench/nanobench.cpp

Issue 398483005: Add --resetGpuContext to both DM and nanobench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 5 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/DMGpuSupport.h » ('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 be8cc4a45f911df1fab12fc5db0ae6c7f65029aa..e2a785e465446e5769667801b6b27d01ce663bcd 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -49,6 +49,7 @@ DEFINE_bool(cpu, true, "Master switch for CPU-bound work.");
DEFINE_bool(gpu, true, "Master switch for GPU-bound work.");
DEFINE_string(outResultsFile, "", "If given, write results here as JSON.");
+DEFINE_bool(resetGpuContext, true, "Reset the GrContext before running each bench.");
static SkString humanize(double ms) {
@@ -214,6 +215,10 @@ static void create_targets(Benchmark* bench, SkTDArray<Target*>* targets) {
}
#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)) { \
t->surface.reset(SkSurface::NewRenderTarget(gGrFactory.get(ctxType), info, samples)); \
« no previous file with comments | « no previous file | dm/DMGpuSupport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698