diff options
author | mtklein <mtklein@chromium.org> | 2014-07-15 08:27:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-07-15 08:27:06 -0700 |
commit | 1e319f734275b166fefe121ac9f4783ab70bc03b (patch) | |
tree | ae9730f12fecea3f506de73a1acdb3ce3764e2b4 /dm | |
parent | c09e8c2ec9c5cdd9e147b6f48527970b4518fb76 (diff) |
Add --resetGpuContext to both DM and nanobench.
Defaulting to true to be conservative for now.
BUG=skia:
NOTREECHECKS=true
R=mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/398483005
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DMGpuSupport.h | 1 | ||||
-rw-r--r-- | dm/DMTask.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/dm/DMGpuSupport.h b/dm/DMGpuSupport.h index bcc00c27e4..209f3223e5 100644 --- a/dm/DMGpuSupport.h +++ b/dm/DMGpuSupport.h @@ -47,6 +47,7 @@ public: kNVPR_GLContextType = 0, kNative_GLContextType = 0, kNull_GLContextType = 0; + void destroyContexts() {} }; namespace DM { diff --git a/dm/DMTask.cpp b/dm/DMTask.cpp index 54e7df3803..b763556309 100644 --- a/dm/DMTask.cpp +++ b/dm/DMTask.cpp @@ -4,6 +4,7 @@ DEFINE_bool(cpu, true, "Master switch for running CPU-bound work."); DEFINE_bool(gpu, true, "Master switch for running GPU-bound work."); +DEFINE_bool(resetGpuContext, true, "Reset the GrContext before running each task."); DECLARE_bool(dryRun); @@ -70,6 +71,9 @@ GpuTask::GpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, ta void GpuTask::run(GrContextFactory& factory) { if (FLAGS_gpu && !this->shouldSkip()) { + if (FLAGS_resetGpuContext) { + factory.destroyContexts(); + } this->start(); if (!FLAGS_dryRun) this->draw(&factory); this->finish(); |