blob: a9f2b25b0acaf6c05c3e623e093b9d6399c4d46e [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
Mike Kleinc0bd9f92019-04-23 12:05:21 -050010#include "include/core/SkBitmap.h"
11#include "include/core/SkPath.h"
12#include "include/core/SkStream.h"
13#include "src/pathops/SkPathOpsTypes.h"
14#include "tests/Test.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +000015
caryclark@google.com66089e42013-04-10 15:55:37 +000016struct PathOpsThreadState;
caryclark@google.com818b0cc2013-04-08 11:50:46 +000017
18struct TestDesc {
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000019 void (*fun)(skiatest::Reporter*, const char* filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000020 const char* str;
21};
22
caryclark@google.com818b0cc2013-04-08 11:50:46 +000023//extern int comparePaths(const SkPath& one, const SkPath& two);
caryclark54359292015-03-26 07:52:43 -070024extern int comparePaths(skiatest::Reporter* reporter, const char* filename,
25 const SkPath& one, const SkPath& two, SkBitmap& bitmap);
caryclark4e1a4c92015-05-18 12:56:57 -070026
27inline int comparePaths(skiatest::Reporter* reporter, const char* filename,
28 const SkPath& one, const SkPath& two) {
29 SkBitmap bitmap;
30 return comparePaths(reporter, filename, one, two, bitmap);
31}
32
caryclark@google.com818b0cc2013-04-08 11:50:46 +000033extern bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths);
Cary Clarkda6289c2018-08-27 16:10:28 -040034extern void markTestFlakyForPathKit();
caryclark@google.com818b0cc2013-04-08 11:50:46 +000035extern void showOp(const SkPathOp op);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000036extern bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
caryclark65f55312014-11-13 06:58:52 -080037 const SkPathOp , const char* testName);
38extern bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
39 const SkPathOp , const char* testName, bool checkFail);
Cary Clark59d5a0e2017-01-23 14:38:52 +000040extern bool testPathOpFail(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
41 const SkPathOp, const char* testName);
Cary Clark2587f412018-07-24 12:40:10 -040042extern bool testPathOpFuzz(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
43 const SkPathOp , const char* testName);
caryclark@google.com66089e42013-04-10 15:55:37 +000044extern bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& state,
45 const char* pathStr);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000046extern bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename);
caryclark54359292015-03-26 07:52:43 -070047extern bool testSimplifyCheck(skiatest::Reporter* reporter, const SkPath& path,
48 const char* filename, bool checkFail);
Cary Clark2587f412018-07-24 12:40:10 -040049extern bool testSimplifyFail(skiatest::Reporter* reporter, const SkPath& path,
50 const char* filename);
caryclark30b9fdd2016-08-31 14:36:29 -070051extern bool testSimplifyFuzz(skiatest::Reporter* reporter, const SkPath& path,
Cary Clark2587f412018-07-24 12:40:10 -040052 const char* filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000053
mtklein406654b2014-09-03 15:34:37 -070054void initializeTests(skiatest::Reporter* reporter, const char* testName);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000055
56void RunTestSet(skiatest::Reporter* reporter, TestDesc tests[], size_t count,
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000057 void (*firstTest)(skiatest::Reporter* , const char* filename),
caryclark54359292015-03-26 07:52:43 -070058 void (*skipTest)(skiatest::Reporter* , const char* filename),
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000059 void (*stopTest)(skiatest::Reporter* , const char* filename), bool reverse);
caryclark@google.com03610322013-04-18 15:58:21 +000060void ShowTestName(PathOpsThreadState* data, int a, int b, int c, int d);
caryclark@google.com07e97fc2013-07-08 17:17:02 +000061void ShowFunctionHeader(const char* name);
62void ShowPath(const SkPath& path, const char* pathName);
63void ShowOp(SkPathOp op, const char* pathOne, const char* pathTwo);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000064
65#endif