caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | #ifndef PathOpsExtendedTest_DEFINED |
| 8 | #define PathOpsExtendedTest_DEFINED |
| 9 | |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 10 | #include "SkBitmap.h" |
| 11 | #include "SkPath.h" |
caryclark@google.com | 66089e4 | 2013-04-10 15:55:37 +0000 | [diff] [blame] | 12 | #include "SkPathOpsTypes.h" |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 13 | #include "SkStream.h" |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 14 | #include "SkThread.h" |
caryclark@google.com | 66089e4 | 2013-04-10 15:55:37 +0000 | [diff] [blame] | 15 | #include "SkThreadUtils.h" |
| 16 | #include "Test.h" |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 17 | |
caryclark@google.com | 66089e4 | 2013-04-10 15:55:37 +0000 | [diff] [blame] | 18 | struct PathOpsThreadState; |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 19 | |
| 20 | struct TestDesc { |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 21 | void (*fun)(skiatest::Reporter*, const char* filename); |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 22 | const char* str; |
| 23 | }; |
| 24 | |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 25 | //extern int comparePaths(const SkPath& one, const SkPath& two); |
| 26 | extern int comparePaths(const SkPath& one, const SkPath& two, SkBitmap& bitmap); |
| 27 | extern bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths); |
| 28 | extern void showOp(const SkPathOp op); |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 29 | extern bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b, |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 30 | const SkPathOp , const char* testName); |
| 31 | extern bool testPathFailOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b, |
| 32 | const SkPathOp , const char* testName); |
caryclark@google.com | 8d0a524 | 2013-07-16 16:11:16 +0000 | [diff] [blame] | 33 | extern bool testThreadedPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b, |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 34 | const SkPathOp , const char* testName); |
caryclark@google.com | 66089e4 | 2013-04-10 15:55:37 +0000 | [diff] [blame] | 35 | extern bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& state, |
| 36 | const char* pathStr); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 37 | extern bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename); |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 38 | |
caryclark@google.com | 16cfe40 | 2013-04-18 18:47:37 +0000 | [diff] [blame] | 39 | int initializeTests(skiatest::Reporter* reporter, const char* testName); |
caryclark@google.com | 66089e4 | 2013-04-10 15:55:37 +0000 | [diff] [blame] | 40 | void outputProgress(char* ramStr, const char* pathStr, SkPath::FillType ); |
| 41 | void outputProgress(char* ramStr, const char* pathStr, SkPathOp op); |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 42 | |
| 43 | void RunTestSet(skiatest::Reporter* reporter, TestDesc tests[], size_t count, |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 44 | void (*firstTest)(skiatest::Reporter* , const char* filename), |
| 45 | void (*stopTest)(skiatest::Reporter* , const char* filename), bool reverse); |
| 46 | void ShowTestArray(); |
caryclark@google.com | 0361032 | 2013-04-18 15:58:21 +0000 | [diff] [blame] | 47 | void ShowTestName(PathOpsThreadState* data, int a, int b, int c, int d); |
caryclark@google.com | 07e97fc | 2013-07-08 17:17:02 +0000 | [diff] [blame] | 48 | void ShowFunctionHeader(const char* name); |
| 49 | void ShowPath(const SkPath& path, const char* pathName); |
| 50 | void ShowOp(SkPathOp op, const char* pathOne, const char* pathTwo); |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 51 | |
| 52 | #endif |