blob: 9f8b0aeaac89a53d7c80393d757b8398d652a30e [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.com66089e42013-04-10 15:55:37 +000014#include "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);
34extern void showOp(const SkPathOp op);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000035extern bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
caryclark65f55312014-11-13 06:58:52 -080036 const SkPathOp , const char* testName);
37extern bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
38 const SkPathOp , const char* testName, bool checkFail);
Cary Clark59d5a0e2017-01-23 14:38:52 +000039extern bool testPathOpFail(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
40 const SkPathOp, const char* testName);
caryclark30b9fdd2016-08-31 14:36:29 -070041extern bool testPathOpFuzz(skiatest::Reporter* reporter, const SkPath& a,
42 const SkPath& b, const SkPathOp , const char* testName);
caryclark@google.com66089e42013-04-10 15:55:37 +000043extern bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& state,
44 const char* pathStr);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000045extern bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename);
caryclark54359292015-03-26 07:52:43 -070046extern bool testSimplifyCheck(skiatest::Reporter* reporter, const SkPath& path,
47 const char* filename, bool checkFail);
caryclark30b9fdd2016-08-31 14:36:29 -070048extern bool testSimplifyFuzz(skiatest::Reporter* reporter, const SkPath& path,
Cary Clark59d5a0e2017-01-23 14:38:52 +000049 const char* filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000050
mtklein406654b2014-09-03 15:34:37 -070051void initializeTests(skiatest::Reporter* reporter, const char* testName);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000052
53void RunTestSet(skiatest::Reporter* reporter, TestDesc tests[], size_t count,
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000054 void (*firstTest)(skiatest::Reporter* , const char* filename),
caryclark54359292015-03-26 07:52:43 -070055 void (*skipTest)(skiatest::Reporter* , const char* filename),
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000056 void (*stopTest)(skiatest::Reporter* , const char* filename), bool reverse);
caryclark@google.com03610322013-04-18 15:58:21 +000057void ShowTestName(PathOpsThreadState* data, int a, int b, int c, int d);
caryclark@google.com07e97fc2013-07-08 17:17:02 +000058void ShowFunctionHeader(const char* name);
59void ShowPath(const SkPath& path, const char* pathName);
60void ShowOp(SkPathOp op, const char* pathOne, const char* pathTwo);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000061
62#endif