Index: dm/DMTestTask.h |
diff --git a/dm/DMTestTask.h b/dm/DMTestTask.h |
index 49a8e773b69decf371a152418a72f7603b0d3367..87f59209b2f2dd63aba1cec230b5e65bfff94560 100644 |
--- a/dm/DMTestTask.h |
+++ b/dm/DMTestTask.h |
@@ -11,34 +11,47 @@ |
// Runs a unit test. |
namespace DM { |
-class TestTask : public Task { |
+class TestReporter : public skiatest::Reporter { |
public: |
- TestTask(Reporter*, TaskRunner*, skiatest::TestRegistry::Factory); |
+ TestReporter() {} |
+ |
+ const char* failure() const { return fFailure.c_str(); } |
+ |
+private: |
+ virtual bool allowExtendedTest() const SK_OVERRIDE; |
+ virtual bool allowThreaded() const SK_OVERRIDE; |
+ virtual bool verbose() const SK_OVERRIDE; |
+ |
+ virtual void onReportFailed(const SkString& desc) SK_OVERRIDE { |
+ fFailure = desc; |
+ } |
+ |
+ SkString fFailure; |
+}; |
+ |
+class CpuTestTask : public CpuTask { |
+public: |
+ CpuTestTask(Reporter*, TaskRunner*, skiatest::TestRegistry::Factory); |
virtual void draw() SK_OVERRIDE; |
- virtual bool usesGpu() const SK_OVERRIDE { return fTest->isGPUTest(); } |
virtual bool shouldSkip() const SK_OVERRIDE { return false; } |
virtual SkString name() const SK_OVERRIDE { return fName; } |
private: |
- class TestReporter : public skiatest::Reporter { |
- public: |
- TestReporter() {} |
- |
- const char* failure() const { return fFailure.c_str(); } |
- |
- private: |
- virtual bool allowExtendedTest() const SK_OVERRIDE; |
- virtual bool allowThreaded() const SK_OVERRIDE; |
- virtual bool verbose() const SK_OVERRIDE; |
+ TestReporter fTestReporter; |
+ SkAutoTDelete<skiatest::Test> fTest; |
+ const SkString fName; |
+}; |
- virtual void onReportFailed(const SkString& desc) SK_OVERRIDE { |
- fFailure = desc; |
- } |
+class GpuTestTask : public GpuTask { |
+public: |
+ GpuTestTask(Reporter*, TaskRunner*, skiatest::TestRegistry::Factory); |
- SkString fFailure; |
- }; |
+ virtual void draw(GrContextFactory*) SK_OVERRIDE; |
+ virtual bool shouldSkip() const SK_OVERRIDE { return false; } |
+ virtual SkString name() const SK_OVERRIDE { return fName; } |
+private: |
TestReporter fTestReporter; |
SkAutoTDelete<skiatest::Test> fTest; |
const SkString fName; |