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

Unified Diff: tests/PathOpsOpCubicThreadedTest.cpp

Issue 1096923003: working on initial winding for cubics (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/PathOpsIssue3651.cpp ('k') | tests/PathOpsOpLoopThreadedTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsOpCubicThreadedTest.cpp
diff --git a/tests/PathOpsOpCubicThreadedTest.cpp b/tests/PathOpsOpCubicThreadedTest.cpp
index 2289ca6090c182d8e4e628b70a82602d435ee034..0d905c6e230646b2bdca8855a12f4546fcc65f9c 100644
--- a/tests/PathOpsOpCubicThreadedTest.cpp
+++ b/tests/PathOpsOpCubicThreadedTest.cpp
@@ -7,6 +7,8 @@
#include "PathOpsExtendedTest.h"
#include "PathOpsThreadedCommon.h"
+static int loopNo = 132;
+
static void testOpCubicsMain(PathOpsThreadState* data) {
#if DEBUG_SHOW_TEST_NAME
strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
@@ -25,30 +27,6 @@ static void testOpCubicsMain(PathOpsThreadState* data) {
for (int e = SkPath::kWinding_FillType ; e <= SkPath::kEvenOdd_FillType; ++e) {
for (int f = SkPath::kWinding_FillType ; f <= SkPath::kEvenOdd_FillType; ++f) {
SkPath pathA, pathB;
- if (progress) {
- char* str = pathStr;
- const int loopNo = 133;
- str += sprintf(str, "static void cubicOp%d(skiatest::Reporter* reporter,"
- " const char* filename) {\n", loopNo);
- str += sprintf(str, " SkPath path, pathB;\n");
- str += sprintf(str, " path.setFillType(SkPath::k%s_FillType);\n",
- e == SkPath::kWinding_FillType ? "Winding" : e == SkPath::kEvenOdd_FillType
- ? "EvenOdd" : "?UNDEFINED");
- str += sprintf(str, " path.moveTo(%d,%d);\n", state.fA, state.fB);
- str += sprintf(str, " path.cubicTo(%d,%d, %d,%d, %d,%d);\n", state.fC, state.fD,
- b, a, d, c);
- str += sprintf(str, " path.close();\n");
- str += sprintf(str, " pathB.setFillType(SkPath::k%s_FillType);\n",
- f == SkPath::kWinding_FillType ? "Winding" : f == SkPath::kEvenOdd_FillType
- ? "EvenOdd" : "?UNDEFINED");
- str += sprintf(str, " pathB.moveTo(%d,%d);\n", a, b);
- str += sprintf(str, " pathB.cubicTo(%d,%d, %d,%d, %d,%d);\n", c, d,
- state.fB, state.fA, state.fD, state.fC);
- str += sprintf(str, " pathB.close();\n");
- str += sprintf(str, " testPathOp(reporter, path, pathB, kDifference_SkPathOp,"
- " filename);\n");
- str += sprintf(str, "}\n");
- }
pathA.setFillType((SkPath::FillType) e);
pathA.moveTo(SkIntToScalar(state.fA), SkIntToScalar(state.fB));
pathA.cubicTo(SkIntToScalar(state.fC), SkIntToScalar(state.fD), SkIntToScalar(b),
@@ -63,10 +41,39 @@ static void testOpCubicsMain(PathOpsThreadState* data) {
if (progress) {
outputProgress(state.fPathStr, pathStr, (SkPathOp) op);
}
- testThreadedPathOp(state.fReporter, pathA, pathB, (SkPathOp) op, "cubics");
+ if (progress) {
+ char* str = pathStr;
+ str += sprintf(str, "static void cubicOp%d(skiatest::Reporter* reporter,"
+ " const char* filename) {\n", loopNo);
+ str += sprintf(str, " SkPath path, pathB;\n");
+ str += sprintf(str, " path.setFillType(SkPath::k%s_FillType);\n",
+ e == SkPath::kWinding_FillType ? "Winding" : e == SkPath::kEvenOdd_FillType
+ ? "EvenOdd" : "?UNDEFINED");
+ str += sprintf(str, " path.moveTo(%d,%d);\n", state.fA, state.fB);
+ str += sprintf(str, " path.cubicTo(%d,%d, %d,%d, %d,%d);\n", state.fC, state.fD,
+ b, a, d, c);
+ str += sprintf(str, " path.close();\n");
+ str += sprintf(str, " pathB.setFillType(SkPath::k%s_FillType);\n",
+ f == SkPath::kWinding_FillType ? "Winding" : f == SkPath::kEvenOdd_FillType
+ ? "EvenOdd" : "?UNDEFINED");
+ str += sprintf(str, " pathB.moveTo(%d,%d);\n", a, b);
+ str += sprintf(str, " pathB.cubicTo(%d,%d, %d,%d, %d,%d);\n", c, d,
+ state.fB, state.fA, state.fD, state.fC);
+ str += sprintf(str, " pathB.close();\n");
+ str += sprintf(str, " testPathOp(reporter, path, pathB, %s, filename);\n",
+ SkPathOpsDebug::OpStr((SkPathOp) op));
+ str += sprintf(str, "}\n");
+ }
+ if (!testThreadedPathOp(state.fReporter, pathA, pathB, (SkPathOp) op, "cubics")) {
+ if (progress) {
+ ++loopNo;
+ goto skipToNext;
+ }
+ }
}
}
}
+skipToNext: ;
}
}
}
« no previous file with comments | « tests/PathOpsIssue3651.cpp ('k') | tests/PathOpsOpLoopThreadedTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698