Flutter Engine
The Flutter Engine
PathOpsThreadedCommon.h
Go to the documentation of this file.
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 PathOpsThreadedCommon_DEFINED
8#define PathOpsThreadedCommon_DEFINED
9
14
15#include <cstring>
16#include <string>
17
18#define PATH_STR_SIZE 512
19
21enum class SkPathFillType;
22
23namespace skiatest {
24class Reporter;
25} // namespace skiatest
26
28 unsigned char fA;
29 unsigned char fB;
30 unsigned char fC;
31 unsigned char fD;
32 std::string fPathStr;
33 const char* fKey;
34 char fSerialNo[256];
37
38 void outputProgress(const char* pathStr, SkPathFillType);
39 void outputProgress(const char* pathStr, SkPathOp);
40};
41
43public:
45
47
48 void render();
49
50public:
53};
54
56public:
57 PathOpsThreadedRunnable(void (*testFun)(PathOpsThreadState*), int a, int b, int c, int d,
59 fState.fA = (a & 0xFF);
60 fState.fB = (b & 0xFF);
61 fState.fC = (c & 0xFF);
62 fState.fD = (d & 0xFF);
63 fState.fReporter = runner->fReporter;
64 fTestFun = testFun;
65 }
66
67 PathOpsThreadedRunnable(void (*testFun)(PathOpsThreadState*), const char* str,
69 SkASSERT(strlen(str) < sizeof(fState.fSerialNo) - 1);
70 strcpy(fState.fSerialNo, str);
71 fState.fReporter = runner->fReporter;
72 fTestFun = testFun;
73 }
74
75 PathOpsThreadedRunnable(void (*testFun)(PathOpsThreadState*), int dirNo, const char* str,
77 SkASSERT(strlen(str) < sizeof(fState.fSerialNo) - 1);
78 fState.fA = dirNo;
79 strcpy(fState.fSerialNo, str);
80 fState.fReporter = runner->fReporter;
81 fTestFun = testFun;
82 }
83
84 void operator()() {
86 fState.fBitmap = &bitmap;
87 (*fTestFun)(&fState);
88 }
89
90private:
91 PathOpsThreadState fState;
92 void (*fTestFun)(PathOpsThreadState*);
93};
94
95#endif
reporter
Definition: FontMgrTest.cpp:39
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkPathOp
Definition: SkPathOps.h:22
SkPathFillType
Definition: SkPathTypes.h:11
PathOpsThreadedRunnable(void(*testFun)(PathOpsThreadState *), int a, int b, int c, int d, PathOpsThreadedTestRunner *runner)
PathOpsThreadedRunnable(void(*testFun)(PathOpsThreadState *), const char *str, PathOpsThreadedTestRunner *runner)
PathOpsThreadedRunnable(void(*testFun)(PathOpsThreadState *), int dirNo, const char *str, PathOpsThreadedTestRunner *runner)
SkTDArray< PathOpsThreadedRunnable * > fRunnables
skiatest::Reporter * fReporter
PathOpsThreadedTestRunner(skiatest::Reporter *reporter)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
static bool b
struct MyStruct a[10]
Definition: bitmap.py:1
void outputProgress(const char *pathStr, SkPathFillType)
skiatest::Reporter * fReporter