Home | History | Annotate | Download | only in tests
      1 /*
      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 
     10 #include "SkBitmap.h"
     11 #include "SkPath.h"
     12 #include "SkPathOpsTypes.h"
     13 #include "SkStream.h"
     14 #include "SkThread.h"
     15 #include "SkThreadUtils.h"
     16 #include "Test.h"
     17 
     18 struct PathOpsThreadState;
     19 
     20 struct TestDesc {
     21     void (*fun)(skiatest::Reporter*, const char* filename);
     22     const char* str;
     23 };
     24 
     25 //extern int comparePaths(const SkPath& one, const SkPath& two);
     26 extern int comparePaths(const SkPath& one, const SkPath& two, SkBitmap& bitmap);
     27 extern bool drawAsciiPaths(const SkPath& one, const SkPath& two, bool drawPaths);
     28 extern void showOp(const SkPathOp op);
     29 extern bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
     30                         const SkPathOp , const char* testName);
     31 extern bool testPathFailOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
     32                         const SkPathOp , const char* testName);
     33 extern bool testThreadedPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
     34                         const SkPathOp , const char* testName);
     35 extern bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& state,
     36                          const char* pathStr);
     37 extern bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename);
     38 
     39 int initializeTests(skiatest::Reporter* reporter, const char* testName);
     40 void outputProgress(char* ramStr, const char* pathStr, SkPath::FillType );
     41 void outputProgress(char* ramStr, const char* pathStr, SkPathOp op);
     42 
     43 void RunTestSet(skiatest::Reporter* reporter, TestDesc tests[], size_t count,
     44                 void (*firstTest)(skiatest::Reporter* , const char* filename),
     45                 void (*stopTest)(skiatest::Reporter* , const char* filename), bool reverse);
     46 void ShowTestArray();
     47 void ShowTestName(PathOpsThreadState* data, int a, int b, int c, int d);
     48 void ShowFunctionHeader(const char* name);
     49 void ShowPath(const SkPath& path, const char* pathName);
     50 void ShowOp(SkPathOp op, const char* pathOne, const char* pathTwo);
     51 
     52 #endif
     53