blob: 5f3413c572a99b10b2b676691f69895d9d48c151 [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 {
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000021 void (*fun)(skiatest::Reporter*, const char* filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000022 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,
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000030 const SkPathOp , const char* testName);
31extern bool testPathFailOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
32 const SkPathOp , const char* testName);
caryclark@google.com8d0a5242013-07-16 16:11:16 +000033extern bool testThreadedPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000034 const SkPathOp , const char* testName);
caryclark@google.com66089e42013-04-10 15:55:37 +000035extern bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& state,
36 const char* pathStr);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000037extern bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000038
caryclark@google.com16cfe402013-04-18 18:47:37 +000039int initializeTests(skiatest::Reporter* reporter, const char* testName);
caryclark@google.com66089e42013-04-10 15:55:37 +000040void outputProgress(char* ramStr, const char* pathStr, SkPath::FillType );
41void outputProgress(char* ramStr, const char* pathStr, SkPathOp op);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000042
43void RunTestSet(skiatest::Reporter* reporter, TestDesc tests[], size_t count,
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000044 void (*firstTest)(skiatest::Reporter* , const char* filename),
45 void (*stopTest)(skiatest::Reporter* , const char* filename), bool reverse);
46void ShowTestArray();
caryclark@google.com03610322013-04-18 15:58:21 +000047void ShowTestName(PathOpsThreadState* data, int a, int b, int c, int d);
caryclark@google.com07e97fc2013-07-08 17:17:02 +000048void ShowFunctionHeader(const char* name);
49void ShowPath(const SkPath& path, const char* pathName);
50void ShowOp(SkPathOp op, const char* pathOne, const char* pathTwo);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000051
52#endif