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

Side by Side Diff: tests/PathOpsSimplifyDegenerateThreadedTest.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
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 testSimplifyDegeneratesMain(PathOpsThreadState* data) { 10 static void testSimplifyDegeneratesMain(PathOpsThreadState* data) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 testSimplify(path, false, out, state, pathStr); 54 testSimplify(path, false, out, state, pathStr);
55 path.setFillType(SkPath::kEvenOdd_FillType); 55 path.setFillType(SkPath::kEvenOdd_FillType);
56 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_FillTyp e); 56 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_FillTyp e);
57 testSimplify(path, true, out, state, pathStr); 57 testSimplify(path, true, out, state, pathStr);
58 } 58 }
59 } 59 }
60 } 60 }
61 } 61 }
62 62
63 static void PathOpsSimplifyDegeneratesThreadedTest(skiatest::Reporter* reporter) { 63 static void PathOpsSimplifyDegeneratesThreadedTest(skiatest::Reporter* reporter) {
64 int threadCount = initializeTests("testDegenerates"); 64 int threadCount = initializeTests(reporter, "testDegenerates");
65 PathOpsThreadedTestRunner testRunner(reporter, threadCount); 65 PathOpsThreadedTestRunner testRunner(reporter, threadCount);
66 for (int a = 0; a < 16; ++a) { 66 for (int a = 0; a < 16; ++a) {
67 int ax = a & 0x03; 67 int ax = a & 0x03;
68 int ay = a >> 2; 68 int ay = a >> 2;
69 for (int b = a ; b < 16; ++b) { 69 for (int b = a ; b < 16; ++b) {
70 int bx = b & 0x03; 70 int bx = b & 0x03;
71 int by = b >> 2; 71 int by = b >> 2;
72 for (int c = a ; c < 16; ++c) { 72 for (int c = a ; c < 16; ++c) {
73 int cx = c & 0x03; 73 int cx = c & 0x03;
74 int cy = c >> 2; 74 int cy = c >> 2;
75 bool abcIsATriangle = (bx - ax) * (cy - ay) != (by - ay) * (cx - ax); 75 bool abcIsATriangle = (bx - ax) * (cy - ay) != (by - ay) * (cx - ax);
76 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn able, 76 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn able,
77 (&testSimplifyDegeneratesMain, a, b, c, abcIsATriangle, 77 (&testSimplifyDegeneratesMain, a, b, c, abcIsATriangle,
78 &testRunner)); 78 &testRunner));
79 } 79 }
80 if (!reporter->allowExtendedTest()) goto finish; 80 if (!reporter->allowExtendedTest()) goto finish;
81 } 81 }
82 } 82 }
83 finish: 83 finish:
84 testRunner.render(); 84 testRunner.render();
85 } 85 }
86 86
87 #include "TestClassDef.h" 87 #include "TestClassDef.h"
88 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyDegeneratesThreadedTest) 88 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyDegeneratesThreadedTest)
OLDNEW
« no previous file with comments | « tests/PathOpsQuadLineIntersectionThreadedTest.cpp ('k') | tests/PathOpsSimplifyQuadThreadedTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698