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

Unified Diff: dm/DMTestTask.cpp

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/DMTestTask.h ('k') | dm/DMTileGridTask.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMTestTask.cpp
diff --git a/dm/DMTestTask.cpp b/dm/DMTestTask.cpp
index 32a698c6738cbfd9bb28ed5decfc106ea2e6d896..6c3fcedf543f2f42686435ccb414ae6eaba6d148 100644
--- a/dm/DMTestTask.cpp
+++ b/dm/DMTestTask.cpp
@@ -8,23 +8,32 @@ DEFINE_bool2(pathOpsVerbose, V, false, "Tell pathOps tests to be verbose.")
namespace DM {
+bool TestReporter::allowExtendedTest() const { return FLAGS_pathOpsExtended; }
+bool TestReporter::allowThreaded() const { return !FLAGS_pathOpsSingleThread; }
+bool TestReporter::verbose() const { return FLAGS_pathOpsVerbose; }
+
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)
+CpuTestTask::CpuTestTask(Reporter* reporter,
+ TaskRunner* taskRunner,
+ skiatest::TestRegistry::Factory factory)
+ : CpuTask(reporter, taskRunner)
, fTest(factory(NULL))
, fName(test_name(fTest->getName())) {}
-void TestTask::draw() {
- if (this->usesGpu()) {
- fTest->setGrContextFactory(this->getGrContextFactory());
- }
+GpuTestTask::GpuTestTask(Reporter* reporter,
+ TaskRunner* taskRunner,
+ skiatest::TestRegistry::Factory factory)
+ : GpuTask(reporter, taskRunner)
+ , fTest(factory(NULL))
+ , fName(test_name(fTest->getName())) {}
+
+
+void CpuTestTask::draw() {
fTest->setReporter(&fTestReporter);
fTest->run();
if (!fTest->passed()) {
@@ -32,8 +41,13 @@ void TestTask::draw() {
}
}
-bool TestTask::TestReporter::allowExtendedTest() const { return FLAGS_pathOpsExtended; }
-bool TestTask::TestReporter::allowThreaded() const { return !FLAGS_pathOpsSingleThread; }
-bool TestTask::TestReporter::verbose() const { return FLAGS_pathOpsVerbose; }
+void GpuTestTask::draw(GrContextFactory* grFactory) {
+ fTest->setGrContextFactory(grFactory);
+ fTest->setReporter(&fTestReporter);
+ fTest->run();
+ if (!fTest->passed()) {
+ this->fail(fTestReporter.failure());
+ }
+}
} // namespace DM
« no previous file with comments | « dm/DMTestTask.h ('k') | dm/DMTileGridTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698