OLD | NEW |
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 testSimplifyQuadsMain(PathOpsThreadState* data) | 10 static void testSimplifyQuadsMain(PathOpsThreadState* data) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 path.quadTo(SkIntToScalar(bx), SkIntToScalar(by), | 42 path.quadTo(SkIntToScalar(bx), SkIntToScalar(by), |
43 SkIntToScalar(cx), SkIntToScalar(cy)); | 43 SkIntToScalar(cx), SkIntToScalar(cy)); |
44 path.lineTo(SkIntToScalar(dx), SkIntToScalar(dy)); | 44 path.lineTo(SkIntToScalar(dx), SkIntToScalar(dy)); |
45 path.close(); | 45 path.close(); |
46 path.moveTo(SkIntToScalar(ex), SkIntToScalar(ey)); | 46 path.moveTo(SkIntToScalar(ex), SkIntToScalar(ey)); |
47 path.lineTo(SkIntToScalar(fx), SkIntToScalar(fy)); | 47 path.lineTo(SkIntToScalar(fx), SkIntToScalar(fy)); |
48 path.quadTo(SkIntToScalar(gx), SkIntToScalar(gy), | 48 path.quadTo(SkIntToScalar(gx), SkIntToScalar(gy), |
49 SkIntToScalar(hx), SkIntToScalar(hy)); | 49 SkIntToScalar(hx), SkIntToScalar(hy)); |
50 path.close(); | 50 path.close(); |
51 if (progress) { | 51 if (progress) { |
52 static int quadTest = 65; | 52 static int quadTest = 66; |
53 char* str = pathStr; | 53 char* str = pathStr; |
54 str += sprintf(str, "static void testQuads%d(skiatest::R
eporter* reporter," | 54 str += sprintf(str, "static void testQuads%d(skiatest::R
eporter* reporter," |
55 "const char* filename) {\n", quadTest); | 55 "const char* filename) {\n", quadTest); |
56 str += sprintf(str, " SkPath path;\n"); | 56 str += sprintf(str, " SkPath path;\n"); |
57 str += sprintf(str, " path.moveTo(%d, %d);\n", ax, ay
); | 57 str += sprintf(str, " path.moveTo(%d, %d);\n", ax, ay
); |
58 str += sprintf(str, " path.quadTo(%d, %d, %d, %d);\n"
, bx, by, cx, cy); | 58 str += sprintf(str, " path.quadTo(%d, %d, %d, %d);\n"
, bx, by, cx, cy); |
59 str += sprintf(str, " path.lineTo(%d, %d);\n", dx, dy
); | 59 str += sprintf(str, " path.lineTo(%d, %d);\n", dx, dy
); |
60 str += sprintf(str, " path.close();\n"); | 60 str += sprintf(str, " path.close();\n"); |
61 str += sprintf(str, " path.moveTo(%d, %d);\n", ex, ey
); | 61 str += sprintf(str, " path.moveTo(%d, %d);\n", ex, ey
); |
62 str += sprintf(str, " path.lineTo(%d, %d);\n", fx, fy
); | 62 str += sprintf(str, " path.lineTo(%d, %d);\n", fx, fy
); |
(...skipping 27 matching lines...) Expand all Loading... |
90 (&testSimplifyQuadsMain, a, b, c, d, &testRunner)); | 90 (&testSimplifyQuadsMain, a, b, c, d, &testRunner)); |
91 } | 91 } |
92 if (!reporter->allowExtendedTest()) goto finish; | 92 if (!reporter->allowExtendedTest()) goto finish; |
93 } | 93 } |
94 } | 94 } |
95 } | 95 } |
96 finish: | 96 finish: |
97 testRunner.render(); | 97 testRunner.render(); |
98 ShowTestArray("testQuads"); | 98 ShowTestArray("testQuads"); |
99 } | 99 } |
OLD | NEW |