blob: 5f7e972f49799bd3117ac23b1619d81a52aa1b74 [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"
caryclark65b427c2014-09-18 10:32:57 -070011#include "SkCommandLineFlags.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +000012#include "SkPath.h"
caryclark@google.com66089e42013-04-10 15:55:37 +000013#include "SkPathOpsTypes.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +000014#include "SkStream.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +000015#include "SkThread.h"
caryclark@google.com66089e42013-04-10 15:55:37 +000016#include "SkThreadUtils.h"
17#include "Test.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +000018
caryclark65b427c2014-09-18 10:32:57 -070019DECLARE_bool(runFail);
20
caryclark@google.com66089e42013-04-10 15:55:37 +000021struct PathOpsThreadState;
caryclark@google.com818b0cc2013-04-08 11:50:46 +000022
23struct TestDesc {
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000024 void (*fun)(skiatest::Reporter*, const char* filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000025 const char* str;
26};
27
caryclark@google.com818b0cc2013-04-08 11:50:46 +000028//extern int comparePaths(const SkPath& one, const SkPath& two);
29extern int comparePaths(const SkPath& one, const SkPath& two, SkBitmap& bitmap);
30extern bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths);
31extern void showOp(const SkPathOp op);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000032extern bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
caryclark65f55312014-11-13 06:58:52 -080033 const SkPathOp , const char* testName);
34extern bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
35 const SkPathOp , const char* testName, bool checkFail);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000036extern bool testPathFailOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
caryclark65f55312014-11-13 06:58:52 -080037 const SkPathOp , const char* testName);
caryclark@google.com8d0a5242013-07-16 16:11:16 +000038extern bool testThreadedPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
caryclark65f55312014-11-13 06:58:52 -080039 const SkPathOp , const char* testName);
caryclark@google.com66089e42013-04-10 15:55:37 +000040extern bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& state,
41 const char* pathStr);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000042extern bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000043
mtklein406654b2014-09-03 15:34:37 -070044void initializeTests(skiatest::Reporter* reporter, const char* testName);
caryclark@google.com66089e42013-04-10 15:55:37 +000045void outputProgress(char* ramStr, const char* pathStr, SkPath::FillType );
46void outputProgress(char* ramStr, const char* pathStr, SkPathOp op);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000047
48void RunTestSet(skiatest::Reporter* reporter, TestDesc tests[], size_t count,
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000049 void (*firstTest)(skiatest::Reporter* , const char* filename),
50 void (*stopTest)(skiatest::Reporter* , const char* filename), bool reverse);
51void ShowTestArray();
caryclark@google.com03610322013-04-18 15:58:21 +000052void ShowTestName(PathOpsThreadState* data, int a, int b, int c, int d);
caryclark@google.com07e97fc2013-07-08 17:17:02 +000053void ShowFunctionHeader(const char* name);
54void ShowPath(const SkPath& path, const char* pathName);
55void ShowOp(SkPathOp op, const char* pathOne, const char* pathTwo);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000056
57#endif