blob: 723135a33bd48d8a0e1157d0ee3da3ef3e9d9296 [file] [log] [blame]
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001/*
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.com818b0cc2013-04-08 11:50:46 +000010#include "SkBitmap.h"
11#include "SkPath.h"
caryclark@google.com66089e42013-04-10 15:55:37 +000012#include "SkPathOpsTypes.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +000013#include "SkStream.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +000014#include "SkThread.h"
caryclark@google.com66089e42013-04-10 15:55:37 +000015#include "SkThreadUtils.h"
16#include "Test.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +000017
caryclark@google.com66089e42013-04-10 15:55:37 +000018struct PathOpsThreadState;
caryclark@google.com818b0cc2013-04-08 11:50:46 +000019
20struct TestDesc {
21 void (*fun)(skiatest::Reporter*);
22 const char* str;
23};
24
caryclark@google.com818b0cc2013-04-08 11:50:46 +000025//extern int comparePaths(const SkPath& one, const SkPath& two);
26extern int comparePaths(const SkPath& one, const SkPath& two, SkBitmap& bitmap);
27extern bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths);
28extern void showOp(const SkPathOp op);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000029extern bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
caryclark@google.com07e97fc2013-07-08 17:17:02 +000030 const SkPathOp , const char* testName = NULL);
caryclark@google.com66089e42013-04-10 15:55:37 +000031extern bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& state,
32 const char* pathStr);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000033extern bool testSimplify(skiatest::Reporter* reporter, const SkPath& path);
34
caryclark@google.com16cfe402013-04-18 18:47:37 +000035int initializeTests(skiatest::Reporter* reporter, const char* testName);
caryclark@google.com66089e42013-04-10 15:55:37 +000036void outputProgress(char* ramStr, const char* pathStr, SkPath::FillType );
37void outputProgress(char* ramStr, const char* pathStr, SkPathOp op);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000038
39void RunTestSet(skiatest::Reporter* reporter, TestDesc tests[], size_t count,
40 void (*firstTest)(skiatest::Reporter* ),
41 void (*stopTest)(skiatest::Reporter* ), bool reverse);
caryclark@google.com03610322013-04-18 15:58:21 +000042void ShowTestName(PathOpsThreadState* data, int a, int b, int c, int d);
caryclark@google.com07e97fc2013-07-08 17:17:02 +000043void ShowFunctionHeader(const char* name);
44void ShowPath(const SkPath& path, const char* pathName);
45void ShowOp(SkPathOp op, const char* pathOne, const char* pathTwo);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000046
47#endif