17839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger/* 27839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger * Copyright 2012 Google Inc. 37839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger * 47839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger * Use of this source code is governed by a BSD-style license that can be 57839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger * found in the LICENSE file. 67839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger */ 77839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger#ifndef PathOpsExtendedTest_DEFINED 87839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger#define PathOpsExtendedTest_DEFINED 97839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger 107839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger#include "SkBitmap.h" 117839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger#include "SkPath.h" 127839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger#include "SkPathOpsTypes.h" 137839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger#include "SkStream.h" 147839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger#include "SkThread.h" 157839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger#include "SkThreadUtils.h" 167839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger#include "Test.h" 177839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger 187839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergerstruct PathOpsThreadState; 197839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger 207839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergerstruct TestDesc { 217839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger void (*fun)(skiatest::Reporter*); 227839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger const char* str; 237839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger}; 247839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger 257839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger//extern int comparePaths(const SkPath& one, const SkPath& two); 267839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergerextern int comparePaths(const SkPath& one, const SkPath& two, SkBitmap& bitmap); 277839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergerextern bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths); 287839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergerextern void showOp(const SkPathOp op); 297839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergerextern bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b, 3058190644c30e1c4aa8e527f3503c58f841e0fcf3Derek Sollenberger const SkPathOp , const char* testName = NULL); 3158190644c30e1c4aa8e527f3503c58f841e0fcf3Derek Sollenbergerextern bool testThreadedPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b, 3258190644c30e1c4aa8e527f3503c58f841e0fcf3Derek Sollenberger const SkPathOp , const char* testName = NULL); 337839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergerextern bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& state, 347839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger const char* pathStr); 357839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergerextern bool testSimplify(skiatest::Reporter* reporter, const SkPath& path); 367839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger 377839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergerint initializeTests(skiatest::Reporter* reporter, const char* testName); 387839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergervoid outputProgress(char* ramStr, const char* pathStr, SkPath::FillType ); 397839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergervoid outputProgress(char* ramStr, const char* pathStr, SkPathOp op); 407839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger 417839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergervoid RunTestSet(skiatest::Reporter* reporter, TestDesc tests[], size_t count, 427839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger void (*firstTest)(skiatest::Reporter* ), 437839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger void (*stopTest)(skiatest::Reporter* ), bool reverse); 447839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenbergervoid ShowTestName(PathOpsThreadState* data, int a, int b, int c, int d); 4558190644c30e1c4aa8e527f3503c58f841e0fcf3Derek Sollenbergervoid ShowFunctionHeader(const char* name); 4658190644c30e1c4aa8e527f3503c58f841e0fcf3Derek Sollenbergervoid ShowPath(const SkPath& path, const char* pathName); 4758190644c30e1c4aa8e527f3503c58f841e0fcf3Derek Sollenbergervoid ShowOp(SkPathOp op, const char* pathOne, const char* pathTwo); 487839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger 497839ce1af63bf12fe7b3caa866970bbbb3afb13dDerek Sollenberger#endif 50