Flutter Engine
The Flutter Engine
third_party
skia
tests
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
10
#include "
include/core/SkBitmap.h
"
11
#include "
include/core/SkTypes.h
"
12
#include "
include/pathops/SkPathOps.h
"
13
#include "
include/private/base/SkTDArray.h
"
14
15
#include <cstring>
16
#include <string>
17
18
#define PATH_STR_SIZE 512
19
20
class
PathOpsThreadedRunnable
;
21
enum class
SkPathFillType
;
22
23
namespace
skiatest
{
24
class
Reporter;
25
}
// namespace skiatest
26
27
struct
PathOpsThreadState
{
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];
35
skiatest::Reporter
*
fReporter
;
36
SkBitmap
*
fBitmap
;
37
38
void
outputProgress
(
const
char
* pathStr,
SkPathFillType
);
39
void
outputProgress
(
const
char
* pathStr,
SkPathOp
);
40
};
41
42
class
PathOpsThreadedTestRunner
{
43
public
:
44
PathOpsThreadedTestRunner
(
skiatest::Reporter
*
reporter
) :
fReporter
(
reporter
) {}
45
46
~PathOpsThreadedTestRunner
();
47
48
void
render
();
49
50
public
:
51
SkTDArray<PathOpsThreadedRunnable*>
fRunnables
;
52
skiatest::Reporter
*
fReporter
;
53
};
54
55
class
PathOpsThreadedRunnable
{
56
public
:
57
PathOpsThreadedRunnable
(
void
(*testFun)(
PathOpsThreadState
*),
int
a
,
int
b
,
int
c,
int
d
,
58
PathOpsThreadedTestRunner
* runner) {
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,
68
PathOpsThreadedTestRunner
* runner) {
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,
76
PathOpsThreadedTestRunner
* runner) {
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()
() {
85
SkBitmap
bitmap
;
86
fState.
fBitmap
= &
bitmap
;
87
(*fTestFun)(&fState);
88
}
89
90
private
:
91
PathOpsThreadState
fState;
92
void (*fTestFun)(
PathOpsThreadState
*);
93
};
94
95
#endif
reporter
reporter
Definition:
FontMgrTest.cpp:39
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
SkBitmap.h
SkPathOps.h
SkPathOp
SkPathOp
Definition:
SkPathOps.h:22
SkPathFillType
SkPathFillType
Definition:
SkPathTypes.h:11
SkTDArray.h
SkTypes.h
PathOpsThreadedRunnable
Definition:
PathOpsThreadedCommon.h:55
PathOpsThreadedRunnable::PathOpsThreadedRunnable
PathOpsThreadedRunnable(void(*testFun)(PathOpsThreadState *), int a, int b, int c, int d, PathOpsThreadedTestRunner *runner)
Definition:
PathOpsThreadedCommon.h:57
PathOpsThreadedRunnable::PathOpsThreadedRunnable
PathOpsThreadedRunnable(void(*testFun)(PathOpsThreadState *), const char *str, PathOpsThreadedTestRunner *runner)
Definition:
PathOpsThreadedCommon.h:67
PathOpsThreadedRunnable::PathOpsThreadedRunnable
PathOpsThreadedRunnable(void(*testFun)(PathOpsThreadState *), int dirNo, const char *str, PathOpsThreadedTestRunner *runner)
Definition:
PathOpsThreadedCommon.h:75
PathOpsThreadedRunnable::operator()
void operator()()
Definition:
PathOpsThreadedCommon.h:84
PathOpsThreadedTestRunner
Definition:
PathOpsThreadedCommon.h:42
PathOpsThreadedTestRunner::render
void render()
Definition:
PathOpsThreadedCommon.cpp:19
PathOpsThreadedTestRunner::~PathOpsThreadedTestRunner
~PathOpsThreadedTestRunner()
Definition:
PathOpsThreadedCommon.cpp:13
PathOpsThreadedTestRunner::fRunnables
SkTDArray< PathOpsThreadedRunnable * > fRunnables
Definition:
PathOpsThreadedCommon.h:51
PathOpsThreadedTestRunner::fReporter
skiatest::Reporter * fReporter
Definition:
PathOpsThreadedCommon.h:52
PathOpsThreadedTestRunner::PathOpsThreadedTestRunner
PathOpsThreadedTestRunner(skiatest::Reporter *reporter)
Definition:
PathOpsThreadedCommon.h:44
SkBitmap
Definition:
SkBitmap.h:59
SkTDArray< PathOpsThreadedRunnable * >
skiatest::Reporter
Definition:
Test.h:58
d
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition:
main.cc:19
b
static bool b
Definition:
ffi_native_test_module.c:74
a
struct MyStruct a[10]
bitmap
Definition:
bitmap.py:1
skiatest
Definition:
DMGpuTestProcs.cpp:27
PathOpsThreadState
Definition:
PathOpsThreadedCommon.h:27
PathOpsThreadState::fPathStr
std::string fPathStr
Definition:
PathOpsThreadedCommon.h:32
PathOpsThreadState::fSerialNo
char fSerialNo[256]
Definition:
PathOpsThreadedCommon.h:34
PathOpsThreadState::fC
unsigned char fC
Definition:
PathOpsThreadedCommon.h:30
PathOpsThreadState::outputProgress
void outputProgress(const char *pathStr, SkPathFillType)
Definition:
PathOpsExtendedTest.cpp:673
PathOpsThreadState::fKey
const char * fKey
Definition:
PathOpsThreadedCommon.h:33
PathOpsThreadState::fReporter
skiatest::Reporter * fReporter
Definition:
PathOpsThreadedCommon.h:35
PathOpsThreadState::fBitmap
SkBitmap * fBitmap
Definition:
PathOpsThreadedCommon.h:36
PathOpsThreadState::fB
unsigned char fB
Definition:
PathOpsThreadedCommon.h:29
PathOpsThreadState::fA
unsigned char fA
Definition:
PathOpsThreadedCommon.h:28
PathOpsThreadState::fD
unsigned char fD
Definition:
PathOpsThreadedCommon.h:31
Generated on Sun Jun 23 2024 21:56:46 for Flutter Engine by
1.9.4