diff options
author | mtklein <mtklein@chromium.org> | 2016-02-16 19:06:15 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-16 19:06:15 -0800 |
commit | 048494c1e236c4db9d18952de83d2602c1abc7c3 (patch) | |
tree | 69997f908e6a8162e4f2d5ad854f10070bc4b6fd /tests/skia_test.cpp | |
parent | f60a8908d2ee5cc2e699dc42c17a6e431c3a49ac (diff) |
clean up more dead code
- SkSHA1 is unused
- SkRunnable is obsolete now that we have std::function
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1705583003
Review URL: https://codereview.chromium.org/1705583003
Diffstat (limited to 'tests/skia_test.cpp')
-rw-r--r-- | tests/skia_test.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp index 38237e4c02..65fbc32842 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. |