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

Side by Side Diff: tests/PathOpsSimplifyTrianglesThreadedTest.cpp

Issue 14002007: allow tests to optionally use multiple threads (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/PathOpsSimplifyRectThreadedTest.cpp ('k') | tests/Test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "PathOpsExtendedTest.h" 7 #include "PathOpsExtendedTest.h"
8 #include "PathOpsThreadedCommon.h" 8 #include "PathOpsThreadedCommon.h"
9 9
10 static void testSimplifyTrianglesMain(PathOpsThreadState* data) { 10 static void testSimplifyTrianglesMain(PathOpsThreadState* data) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 path.setFillType(SkPath::kEvenOdd_FillType); 59 path.setFillType(SkPath::kEvenOdd_FillType);
60 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_FillTyp e); 60 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_FillTyp e);
61 ShowTestName(&state, d, e, f, 1); 61 ShowTestName(&state, d, e, f, 1);
62 testSimplify(path, true, out, state, pathStr); 62 testSimplify(path, true, out, state, pathStr);
63 } 63 }
64 } 64 }
65 } 65 }
66 } 66 }
67 67
68 static void PathOpsSimplifyTrianglesThreadedTest(skiatest::Reporter* reporter) { 68 static void PathOpsSimplifyTrianglesThreadedTest(skiatest::Reporter* reporter) {
69 int threadCount = initializeTests("testTriangles"); 69 int threadCount = initializeTests(reporter, "testTriangles");
70 PathOpsThreadedTestRunner testRunner(reporter, threadCount); 70 PathOpsThreadedTestRunner testRunner(reporter, threadCount);
71 for (int a = 0; a < 15; ++a) { 71 for (int a = 0; a < 15; ++a) {
72 int ax = a & 0x03; 72 int ax = a & 0x03;
73 int ay = a >> 2; 73 int ay = a >> 2;
74 for (int b = a + 1; b < 16; ++b) { 74 for (int b = a + 1; b < 16; ++b) {
75 int bx = b & 0x03; 75 int bx = b & 0x03;
76 int by = b >> 2; 76 int by = b >> 2;
77 for (int c = a + 1; c < 16; ++c) { 77 for (int c = a + 1; c < 16; ++c) {
78 if (b == c) { 78 if (b == c) {
79 continue; 79 continue;
80 } 80 }
81 int cx = c & 0x03; 81 int cx = c & 0x03;
82 int cy = c >> 2; 82 int cy = c >> 2;
83 if ((bx - ax) * (cy - ay) == (by - ay) * (cx - ax)) { 83 if ((bx - ax) * (cy - ay) == (by - ay) * (cx - ax)) {
84 continue; 84 continue;
85 } 85 }
86 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn able, 86 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn able,
87 (&testSimplifyTrianglesMain, a, b, c, 0, &testRunner)); 87 (&testSimplifyTrianglesMain, a, b, c, 0, &testRunner));
88 } 88 }
89 if (!reporter->allowExtendedTest()) goto finish; 89 if (!reporter->allowExtendedTest()) goto finish;
90 } 90 }
91 } 91 }
92 finish: 92 finish:
93 testRunner.render(); 93 testRunner.render();
94 } 94 }
95 95
96 #include "TestClassDef.h" 96 #include "TestClassDef.h"
97 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyTrianglesThreadedTest) 97 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyTrianglesThreadedTest)
OLDNEW
« no previous file with comments | « tests/PathOpsSimplifyRectThreadedTest.cpp ('k') | tests/Test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698