Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: dm/DMTestTask.h

Issue 179233005: DM: make GPU tasks multithreaded again. Big refactor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: default 1 GPU thread Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMTaskRunner.cpp ('k') | dm/DMTestTask.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « dm/DMTaskRunner.cpp ('k') | dm/DMTestTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698