OLD | NEW |
(Empty) | |
| 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 |
| 10 #include "Test.h" |
| 11 #include "SkPathOpsTypes.h" |
| 12 #include "SkBitmap.h" |
| 13 #include "SkPath.h" |
| 14 #include "SkStream.h" |
| 15 #include <pthread.h> |
| 16 |
| 17 struct State4; |
| 18 |
| 19 struct TestDesc { |
| 20 void (*fun)(skiatest::Reporter*); |
| 21 const char* str; |
| 22 }; |
| 23 |
| 24 extern bool gShowTestProgress; |
| 25 extern bool gAllowExtendedTest; |
| 26 |
| 27 //extern int comparePaths(const SkPath& one, const SkPath& two); |
| 28 extern int comparePaths(const SkPath& one, const SkPath& two, SkBitmap& bitmap); |
| 29 extern bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths)
; |
| 30 extern void showOp(const SkPathOp op); |
| 31 extern void showPath(const SkPath& path, const char* str); |
| 32 extern void showPath(const SkPath& path); |
| 33 extern void showPathData(const SkPath& path); |
| 34 extern bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPa
th& b, |
| 35 const SkPathOp ); |
| 36 extern bool testSimplify(SkPath& path, bool useXor, SkPath& out, |
| 37 State4& state, const char* pathStr); |
| 38 extern bool testSimplify(skiatest::Reporter* reporter, const SkPath& path); |
| 39 |
| 40 struct State4 { |
| 41 State4(); |
| 42 static pthread_mutex_t addQueue; |
| 43 static pthread_cond_t checkQueue; |
| 44 pthread_cond_t initialized; |
| 45 static State4* queue; |
| 46 pthread_t threadID; |
| 47 int index; |
| 48 bool done; |
| 49 bool last; |
| 50 int a; |
| 51 int b; |
| 52 int c; |
| 53 int d; // sometimes 1 if abc_is_a_triangle |
| 54 int testsRun; |
| 55 char filename[256]; |
| 56 skiatest::Reporter* reporter; |
| 57 SkBitmap bitmap; |
| 58 }; |
| 59 |
| 60 void createThread(State4* statePtr, void* (*test)(void* )); |
| 61 int dispatchTest4(void* (*testFun)(void* ), int a, int b, int c, int d); |
| 62 void initializeTests(skiatest::Reporter* reporter, const char* testName, size_t
testNameSize); |
| 63 void outputProgress(const State4& state, const char* pathStr, SkPath::FillType )
; |
| 64 void outputProgress(const State4& state, const char* pathStr, SkPathOp op); |
| 65 void outputToStream(const State4& state, const char* pathStr, const char* pathPr
efix, |
| 66 const char* nameSuffix, |
| 67 const char* testFunction, SkWStream& outFile); |
| 68 bool runNextTestSet(State4& state); |
| 69 int waitForCompletion(); |
| 70 |
| 71 void RunTestSet(skiatest::Reporter* reporter, TestDesc tests[], size_t count, |
| 72 void (*firstTest)(skiatest::Reporter* ), |
| 73 void (*stopTest)(skiatest::Reporter* ), bool reverse); |
| 74 |
| 75 #endif |
OLD | NEW |