aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsThreadedCommon.cpp
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-10 15:55:37 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-10 15:55:37 +0000
commit66089e4ec4f1702caf2154780471417872862148 (patch)
treee078d7a335a396cc325f2d2f55723315307eb07d /tests/PathOpsThreadedCommon.cpp
parent51dbabee67ea1285e1115e535d26944d4da99be5 (diff)
Make parallel unit testing work on windows
Review URL: https://codereview.chromium.org/14072002 git-svn-id: http://skia.googlecode.com/svn/trunk@8594 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/PathOpsThreadedCommon.cpp')
-rw-r--r--tests/PathOpsThreadedCommon.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/PathOpsThreadedCommon.cpp b/tests/PathOpsThreadedCommon.cpp
new file mode 100644
index 0000000000..44e86ab50d
--- /dev/null
+++ b/tests/PathOpsThreadedCommon.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "PathOpsExtendedTest.h"
+#include "PathOpsThreadedCommon.h"
+
+PathOpsThreadedTestRunner::~PathOpsThreadedTestRunner() {
+ for (int index = 0; index < fRunnables.count(); index++) {
+ SkDELETE(fRunnables[index]);
+ }
+}
+
+void PathOpsThreadedTestRunner::render() {
+ fCountdown.reset(fRunnables.count());
+ for (int index = 0; index < fRunnables.count(); ++ index) {
+ fThreadPool.add(fRunnables[index]);
+ }
+ fCountdown.wait();
+#ifdef SK_DEBUG
+ gDebugMaxWindSum = SK_MaxS32;
+ gDebugMaxWindValue = SK_MaxS32;
+#endif
+}
+
+