Index: dm/DMTask.cpp |
diff --git a/dm/DMTask.cpp b/dm/DMTask.cpp |
index 54e7df3803a763324992b65b0c808ca2447d56f5..b7635563094e34279897020133db8be98b736005 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(); |