dm is like gm, but faster and with fewer features.

This is sort of the near-minimal proof-of-concept skeleton.

  - It can run existing GMs.
  - It supports most configs (just not PDF).
  - --replay is the only "fancy" feature it currently supports

Hopefully you will be disturbed by its speed.

BUG=
R=epoger@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11802 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/dm/DMReporter.h b/dm/DMReporter.h
new file mode 100644
index 0000000..4f4ad43
--- /dev/null
+++ b/dm/DMReporter.h
@@ -0,0 +1,39 @@
+#ifndef DMReporter_DEFINED
+#define DMReporter_DEFINED
+
+#include "SkString.h"
+#include "SkTArray.h"
+#include "SkThread.h"
+#include "SkTypes.h"
+
+// Used to report status changes including failures.  All public methods are threadsafe.
+
+namespace DM {
+
+class Reporter : SkNoncopyable {
+public:
+    Reporter() : fStarted(0), fFinished(0) {}
+
+    void start()  { sk_atomic_inc(&fStarted); }
+    void finish() { sk_atomic_inc(&fFinished); }
+    void fail(SkString name);
+
+    int32_t started()  const { return fStarted; }
+    int32_t finished() const { return fFinished; }
+    int32_t failed()   const;
+
+    void updateStatusLine() const;
+
+    void getFailures(SkTArray<SkString>*) const;
+
+private:
+    int32_t fStarted, fFinished;
+
+    mutable SkMutex fMutex;  // Guards fFailures.
+    SkTArray<SkString> fFailures;
+};
+
+
+}  // namespace DM
+
+#endif  // DMReporter_DEFINED