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

Side by Side Diff: dm/DMTestTask.cpp

Issue 853883004: Revert of Sketch DM refactor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « dm/DMTestTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include "DMTestTask.h"
2 #include "DMUtil.h"
3 #include "SkCommandLineFlags.h"
4 #include "SkCommonFlags.h"
5
6 DEFINE_bool2(pathOpsExtended, x, false, "Run extended pathOps tests.");
7
8 namespace DM {
9
10 bool TestReporter::allowExtendedTest() const { return FLAGS_pathOpsExtended; }
11 bool TestReporter::verbose() const { return FLAGS_veryVerbose; }
12
13 static SkString test_name(const char* name) {
14 SkString result("test ");
15 result.append(name);
16 return result;
17 }
18
19 CpuTestTask::CpuTestTask(Reporter* reporter,
20 TaskRunner* taskRunner,
21 skiatest::TestRegistry::Factory factory)
22 : CpuTask(reporter, taskRunner)
23 , fTest(factory(NULL))
24 , fName(test_name(fTest->getName())) {}
25
26 GpuTestTask::GpuTestTask(Reporter* reporter,
27 TaskRunner* taskRunner,
28 skiatest::TestRegistry::Factory factory)
29 : GpuTask(reporter, taskRunner)
30 , fTest(factory(NULL))
31 , fName(test_name(fTest->getName())) {}
32
33
34 void CpuTestTask::draw() {
35 fTest->setReporter(&fTestReporter);
36 fTest->run();
37 if (!fTest->passed()) {
38 const SkTArray<SkString>& failures = fTestReporter.failures();
39 for (int i = 0; i < failures.count(); i++) {
40 this->fail(failures[i].c_str());
41 }
42 }
43 }
44
45 void GpuTestTask::draw(GrContextFactory* grFactory) {
46 fTest->setGrContextFactory(grFactory);
47 fTest->setReporter(&fTestReporter);
48 fTest->run();
49 if (!fTest->passed()) {
50 const SkTArray<SkString>& failures = fTestReporter.failures();
51 for (int i = 0; i < failures.count(); i++) {
52 this->fail(failures[i].c_str());
53 }
54 }
55 }
56
57 bool GpuTestTask::shouldSkip() const {
58 return kGPUDisabled;
59 }
60
61 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMTestTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698