EdgeWalker_Test.h revision 2ddff9388694263c7be9347de7eb768cd0847997
1
2
3#include "ShapeOps.h"
4#include "SkBitmap.h"
5#include <pthread.h>
6
7class SkCanvas;
8
9//extern int comparePaths(const SkPath& one, const SkPath& two);
10extern int comparePaths(const SkPath& one, const SkPath& two, SkBitmap& bitmap,
11        SkCanvas* canvas);
12extern void comparePathsTiny(const SkPath& one, const SkPath& two);
13extern bool drawAsciiPaths(const SkPath& one, const SkPath& two,
14        bool drawPaths);
15extern void showPath(const SkPath& path, const char* str = NULL);
16extern bool testSimplify(const SkPath& path, bool fill, SkPath& out,
17        SkBitmap& bitmap, SkCanvas* canvas = 0);
18extern bool testSimplifyx(const SkPath& path, SkPath& out,
19        SkBitmap& bitmap, SkCanvas* canvas = 0);
20extern bool testSimplifyx(const SkPath& path);
21
22struct State4 {
23    State4();
24    static pthread_mutex_t addQueue;
25    static pthread_cond_t checkQueue;
26    pthread_cond_t initialized;
27    static State4* queue;
28    State4* next;
29    pthread_t threadID;
30    int index;
31    bool done;
32    bool last;
33    int a;
34    int b;
35    int c;
36    int d;
37    int testsRun;
38    char filename[256];
39
40    SkCanvas* canvas;
41    SkBitmap bitmap;
42    bool abcIsATriangle;
43};
44
45void createThread(State4* statePtr, void* (*test)(void* ));
46void waitForCompletion(State4 threadState[], int& threadIndex);
47