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

Side by Side Diff: tests/PathOpsSimplifyDegenerateThreadedTest.cpp

Issue 117863005: Get rid of DEFINE_TESTCLASS_SHORT() macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Mike review Created 6 years, 11 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/PathOpsQuadReduceOrderTest.cpp ('k') | tests/PathOpsSimplifyFailTest.cpp » ('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 #include "TestClassDef.h"
9 10
10 static void testSimplifyDegeneratesMain(PathOpsThreadState* data) { 11 static void testSimplifyDegeneratesMain(PathOpsThreadState* data) {
11 SkASSERT(data); 12 SkASSERT(data);
12 PathOpsThreadState& state = *data; 13 PathOpsThreadState& state = *data;
13 char pathStr[1024]; 14 char pathStr[1024];
14 bool progress = state.fReporter->verbose(); // FIXME: break out into its own parameter? 15 bool progress = state.fReporter->verbose(); // FIXME: break out into its own parameter?
15 if (progress) { 16 if (progress) {
16 sk_bzero(pathStr, sizeof(pathStr)); 17 sk_bzero(pathStr, sizeof(pathStr));
17 } 18 }
18 int ax = state.fA & 0x03; 19 int ax = state.fA & 0x03;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 path.setFillType(SkPath::kEvenOdd_FillType); 61 path.setFillType(SkPath::kEvenOdd_FillType);
61 if (progress) { 62 if (progress) {
62 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_Fil lType); 63 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_Fil lType);
63 } 64 }
64 testSimplify(path, true, out, state, pathStr); 65 testSimplify(path, true, out, state, pathStr);
65 } 66 }
66 } 67 }
67 } 68 }
68 } 69 }
69 70
70 static void PathOpsSimplifyDegeneratesThreadedTest(skiatest::Reporter* reporter) { 71 DEF_TEST(PathOpsSimplifyDegeneratesThreaded, reporter) {
71 int threadCount = initializeTests(reporter, "testDegenerates"); 72 int threadCount = initializeTests(reporter, "testDegenerates");
72 PathOpsThreadedTestRunner testRunner(reporter, threadCount); 73 PathOpsThreadedTestRunner testRunner(reporter, threadCount);
73 for (int a = 0; a < 16; ++a) { 74 for (int a = 0; a < 16; ++a) {
74 int ax = a & 0x03; 75 int ax = a & 0x03;
75 int ay = a >> 2; 76 int ay = a >> 2;
76 for (int b = a ; b < 16; ++b) { 77 for (int b = a ; b < 16; ++b) {
77 int bx = b & 0x03; 78 int bx = b & 0x03;
78 int by = b >> 2; 79 int by = b >> 2;
79 for (int c = a ; c < 16; ++c) { 80 for (int c = a ; c < 16; ++c) {
80 int cx = c & 0x03; 81 int cx = c & 0x03;
81 int cy = c >> 2; 82 int cy = c >> 2;
82 bool abcIsATriangle = (bx - ax) * (cy - ay) != (by - ay) * (cx - ax); 83 bool abcIsATriangle = (bx - ax) * (cy - ay) != (by - ay) * (cx - ax);
83 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn able, 84 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn able,
84 (&testSimplifyDegeneratesMain, a, b, c, abcIsATriangle, 85 (&testSimplifyDegeneratesMain, a, b, c, abcIsATriangle,
85 &testRunner)); 86 &testRunner));
86 } 87 }
87 if (!reporter->allowExtendedTest()) goto finish; 88 if (!reporter->allowExtendedTest()) goto finish;
88 } 89 }
89 } 90 }
90 finish: 91 finish:
91 testRunner.render(); 92 testRunner.render();
92 } 93 }
93
94 #include "TestClassDef.h"
95 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyDegeneratesThreadedTest)
OLDNEW
« no previous file with comments | « tests/PathOpsQuadReduceOrderTest.cpp ('k') | tests/PathOpsSimplifyFailTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698