path ops : remove countdown overkill
authorcaryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 18 Apr 2013 19:50:01 +0000 (19:50 +0000)
committercaryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 18 Apr 2013 19:50:01 +0000 (19:50 +0000)
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
tests/PathOpsThreadedCommon.h

index 6d9821d..9b5240c 100644 (file)
@@ -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;
index d1f6ff0..7b9f482 100644 (file)
@@ -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<PathOpsThreadedRunnable*> 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