DM: also run benches once.

Also:
  - make GrMemoryPoolBenches threadsafe
  - some tweaks to various DM code
  - rename GM::shortName() to getName() to match benches and tests

On my desktop, (289 GMs, 617 benches) x 4 configs, 227 tests takes 46s in Debug, 14s in Release.  (Still minutes faster than running tests && bench && gm.)  GPU singlethreading is definitely the limiting factor again; going to reexamine whether that's helpful to thread it again.

BUG=skia:
R=reed@google.com, bsalomon@google.com, mtklein@google.com

Author: mtklein@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13603 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/dm/DMTestTask.cpp b/dm/DMTestTask.cpp
index 7a5f8cf..32a698c 100644
--- a/dm/DMTestTask.cpp
+++ b/dm/DMTestTask.cpp
@@ -8,17 +8,22 @@
 
 namespace DM {
 
+static SkString test_name(const char* name) {
+    SkString result("test ");
+    result.append(name);
+    return result;
+}
+
 TestTask::TestTask(Reporter* reporter,
                    TaskRunner* taskRunner,
                    skiatest::TestRegistry::Factory factory)
     : Task(reporter, taskRunner)
-    , fTaskRunner(taskRunner)
     , fTest(factory(NULL))
-    , fName(UnderJoin("test", fTest->getName())) {}
+    , fName(test_name(fTest->getName())) {}
 
 void TestTask::draw() {
     if (this->usesGpu()) {
-        fTest->setGrContextFactory(fTaskRunner->getGrContextFactory());
+        fTest->setGrContextFactory(this->getGrContextFactory());
     }
     fTest->setReporter(&fTestReporter);
     fTest->run();