diff options
Diffstat (limited to 'dm/DMTask.cpp')
-rw-r--r-- | dm/DMTask.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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(); |