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

Unified Diff: tests/skia_test.cpp

Issue 1705583003: clean up more dead code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 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 | « tests/SkpSkGrTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/skia_test.cpp
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 38237e4c02d7ef19018084926894597ce33bd318..65fbc3284297a9070737fbacd3994e08ac2502f5 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -12,7 +12,6 @@
#include "SkCommonFlags.h"
#include "SkGraphics.h"
#include "SkOSFile.h"
-#include "SkRunnable.h"
#include "SkTArray.h"
#include "SkTaskGroup.h"
#include "SkTemplates.h"
@@ -72,15 +71,14 @@ private:
const int fTotal;
};
-// Deletes self when run.
-class SkTestRunnable : public SkRunnable {
+class SkTestRunnable {
public:
SkTestRunnable(const Test& test,
Status* status,
GrContextFactory* grContextFactory = nullptr)
: fTest(test), fStatus(status), fGrContextFactory(grContextFactory) {}
- virtual void run() {
+ void operator()() {
struct TestReporter : public skiatest::Reporter {
public:
TestReporter() : fError(false), fTestCount(0) {}
@@ -105,7 +103,6 @@ public:
}
fStatus->endTest(fTest.name, !reporter.fError, elapsed,
reporter.fTestCount);
- delete this;
}
private:
@@ -190,7 +187,7 @@ int test_main() {
} else if (test.needsGpu) {
gpuTests.push_back(&test);
} else {
- cpuTests.add(new SkTestRunnable(test, &status));
+ cpuTests.add(SkTestRunnable(test, &status));
}
}
@@ -204,7 +201,7 @@ int test_main() {
// Run GPU tests on this thread.
for (int i = 0; i < gpuTests.count(); i++) {
- (new SkTestRunnable(*gpuTests[i], &status, grContextFactoryPtr))->run();
+ SkTestRunnable(*gpuTests[i], &status, grContextFactoryPtr)();
}
// Block until threaded tests finish.
« no previous file with comments | « tests/SkpSkGrTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698