2012-03-01 19:16:31 +00:00
|
|
|
|
|
|
|
|
2012-03-27 13:23:51 +00:00
|
|
|
#include "ShapeOps.h"
|
2012-04-17 11:40:34 +00:00
|
|
|
#include "SkBitmap.h"
|
2012-08-21 13:13:52 +00:00
|
|
|
#include "SkStream.h"
|
2012-04-17 11:40:34 +00:00
|
|
|
#include <pthread.h>
|
2012-03-01 19:16:31 +00:00
|
|
|
|
2012-03-30 18:47:02 +00:00
|
|
|
class SkCanvas;
|
2012-08-09 18:17:47 +00:00
|
|
|
struct State4;
|
2012-03-30 18:47:02 +00:00
|
|
|
|
|
|
|
//extern int comparePaths(const SkPath& one, const SkPath& two);
|
2012-05-22 17:01:14 +00:00
|
|
|
extern int comparePaths(const SkPath& one, const SkPath& two, SkBitmap& bitmap,
|
|
|
|
SkCanvas* canvas);
|
2012-03-01 19:16:31 +00:00
|
|
|
extern void comparePathsTiny(const SkPath& one, const SkPath& two);
|
2012-03-22 21:11:17 +00:00
|
|
|
extern bool drawAsciiPaths(const SkPath& one, const SkPath& two,
|
2012-03-20 21:11:59 +00:00
|
|
|
bool drawPaths);
|
|
|
|
extern void showPath(const SkPath& path, const char* str = NULL);
|
2012-03-30 18:47:02 +00:00
|
|
|
extern bool testSimplify(const SkPath& path, bool fill, SkPath& out,
|
|
|
|
SkBitmap& bitmap, SkCanvas* canvas = 0);
|
2012-08-20 12:43:57 +00:00
|
|
|
extern bool testSimplifyx(SkPath& path, bool useXor, SkPath& out,
|
2012-08-09 18:17:47 +00:00
|
|
|
State4& state, const char* pathStr);
|
2012-07-02 20:27:02 +00:00
|
|
|
extern bool testSimplifyx(const SkPath& path);
|
2012-04-17 11:40:34 +00:00
|
|
|
|
|
|
|
struct State4 {
|
|
|
|
State4();
|
2012-08-07 21:25:27 +00:00
|
|
|
static pthread_mutex_t addQueue;
|
|
|
|
static pthread_cond_t checkQueue;
|
|
|
|
pthread_cond_t initialized;
|
|
|
|
static State4* queue;
|
|
|
|
pthread_t threadID;
|
|
|
|
int index;
|
|
|
|
bool done;
|
|
|
|
bool last;
|
2012-04-17 11:40:34 +00:00
|
|
|
int a;
|
|
|
|
int b;
|
|
|
|
int c;
|
2012-08-09 18:17:47 +00:00
|
|
|
int d; // sometimes 1 if abc_is_a_triangle
|
2012-07-27 18:26:38 +00:00
|
|
|
int testsRun;
|
2012-07-23 12:14:49 +00:00
|
|
|
char filename[256];
|
2012-08-23 18:14:13 +00:00
|
|
|
|
2012-04-17 11:40:34 +00:00
|
|
|
SkCanvas* canvas;
|
|
|
|
SkBitmap bitmap;
|
|
|
|
};
|
|
|
|
|
|
|
|
void createThread(State4* statePtr, void* (*test)(void* ));
|
2012-08-09 18:17:47 +00:00
|
|
|
int dispatchTest4(void* (*testFun)(void* ), int a, int b, int c, int d);
|
|
|
|
void initializeTests(const char* testName, size_t testNameSize);
|
2012-08-20 12:43:57 +00:00
|
|
|
void outputProgress(const State4& state, const char* pathStr, SkPath::FillType );
|
|
|
|
void outputToStream(const State4& state, const char* pathStr, SkPath::FillType, SkWStream& outFile);
|
2012-08-09 18:17:47 +00:00
|
|
|
bool runNextTestSet(State4& state);
|
|
|
|
int waitForCompletion();
|