blob: a604761a7d782753a34ad0f07e51f9f8dc3743b1 [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);
caryclark54359292015-03-26 07:52:43 -070020DECLARE_bool(runBinary);
caryclark65b427c2014-09-18 10:32:57 -070021
caryclark@google.com66089e42013-04-10 15:55:37 +000022struct PathOpsThreadState;
caryclark@google.com818b0cc2013-04-08 11:50:46 +000023
24struct TestDesc {
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000025 void (*fun)(skiatest::Reporter*, const char* filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000026 const char* str;
27};
28
caryclark@google.com818b0cc2013-04-08 11:50:46 +000029//extern int comparePaths(const SkPath& one, const SkPath& two);
caryclark54359292015-03-26 07:52:43 -070030extern int comparePaths(skiatest::Reporter* reporter, const char* filename,
31 const SkPath& one, const SkPath& two, SkBitmap& bitmap);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000032extern bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths);
33extern void showOp(const SkPathOp op);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000034extern bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
caryclark65f55312014-11-13 06:58:52 -080035 const SkPathOp , const char* testName);
36extern bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
37 const SkPathOp , const char* testName, bool checkFail);
caryclark1049f122015-04-20 08:31:59 -070038extern bool testPathOpFailCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
39 const SkPathOp , const char* testName);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000040extern bool testPathFailOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
caryclark65f55312014-11-13 06:58:52 -080041 const SkPathOp , const char* testName);
caryclark@google.com66089e42013-04-10 15:55:37 +000042extern bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& state,
43 const char* pathStr);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000044extern bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename);
caryclark54359292015-03-26 07:52:43 -070045extern bool testSimplifyCheck(skiatest::Reporter* reporter, const SkPath& path,
46 const char* filename, bool checkFail);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000047
mtklein406654b2014-09-03 15:34:37 -070048void initializeTests(skiatest::Reporter* reporter, const char* testName);
caryclark@google.com66089e42013-04-10 15:55:37 +000049void outputProgress(char* ramStr, const char* pathStr, SkPath::FillType );
50void outputProgress(char* ramStr, const char* pathStr, SkPathOp op);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000051
52void RunTestSet(skiatest::Reporter* reporter, TestDesc tests[], size_t count,
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000053 void (*firstTest)(skiatest::Reporter* , const char* filename),
caryclark54359292015-03-26 07:52:43 -070054 void (*skipTest)(skiatest::Reporter* , const char* filename),
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000055 void (*stopTest)(skiatest::Reporter* , const char* filename), bool reverse);
caryclark1049f122015-04-20 08:31:59 -070056void ShowTestArray(const char* testName);
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