From 9515f09b6ccbbbec9eb938ab2ef1249d291a9551 Mon Sep 17 00:00:00 2001 From: "caryclark@google.com" Date: Thu, 18 Apr 2013 19:50:01 +0000 Subject: [PATCH] path ops : remove countdown overkill Review URL: https://codereview.chromium.org/13958005 git-svn-id: http://skia.googlecode.com/svn/trunk@8756 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/PathOpsThreadedCommon.cpp | 5 ++--- tests/PathOpsThreadedCommon.h | 7 ------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/tests/PathOpsThreadedCommon.cpp b/tests/PathOpsThreadedCommon.cpp index 6d9821d..9b5240c 100644 --- a/tests/PathOpsThreadedCommon.cpp +++ b/tests/PathOpsThreadedCommon.cpp @@ -15,11 +15,10 @@ PathOpsThreadedTestRunner::~PathOpsThreadedTestRunner() { } void PathOpsThreadedTestRunner::render() { - fCountdown.reset(fRunnables.count()); + SkThreadPool pool(fNumThreads); for (int index = 0; index < fRunnables.count(); ++ index) { - fThreadPool.add(fRunnables[index]); + pool.add(fRunnables[index]); } - fCountdown.wait(); #ifdef SK_DEBUG gDebugMaxWindSum = SK_MaxS32; gDebugMaxWindValue = SK_MaxS32; diff --git a/tests/PathOpsThreadedCommon.h b/tests/PathOpsThreadedCommon.h index d1f6ff0..7b9f482 100644 --- a/tests/PathOpsThreadedCommon.h +++ b/tests/PathOpsThreadedCommon.h @@ -36,8 +36,6 @@ class PathOpsThreadedTestRunner { public: PathOpsThreadedTestRunner(skiatest::Reporter* reporter, int threadCount) : fNumThreads(threadCount) - , fThreadPool(threadCount) - , fCountdown(threadCount) , fReporter(reporter) { } @@ -48,8 +46,6 @@ public: public: int fNumThreads; SkTDArray fRunnables; - SkThreadPool fThreadPool; - SkCountdown fCountdown; skiatest::Reporter* fReporter; }; @@ -63,7 +59,6 @@ public: fState.fD = d; fState.fReporter = runner->fReporter; fTestFun = testFun; - fDone = &runner->fCountdown; } virtual void run() SK_OVERRIDE { @@ -72,13 +67,11 @@ public: char pathStr[PATH_STR_SIZE]; fState.fPathStr = pathStr; (*fTestFun)(&fState); - fDone->run(); } private: PathOpsThreadState fState; void (*fTestFun)(PathOpsThreadState*); - SkRunnable* fDone; }; #endif -- 2.7.4