DM: destroy contexts after each GPU task instead of before
authorMike Klein <mtklein@google.com>
Tue, 15 Jul 2014 20:10:02 +0000 (16:10 -0400)
committerMike Klein <mtklein@google.com>
Tue, 15 Jul 2014 20:10:02 +0000 (16:10 -0400)
This is for consistency with bench/nanobench/GM.  Haven't seen it make a difference.

BUG=skia:

Review URL: https://codereview.chromium.org/397743004

dm/DMTask.cpp

index b763556..2c7cdd7 100644 (file)
@@ -71,12 +71,12 @@ 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();
+        if (FLAGS_resetGpuContext) {
+            factory.destroyContexts();
+        }
     }
     SkDELETE(this);
 }