Go to the source code of this file.
◆ DEF_TEST() [1/2]
Definition at line 159 of file ClipperTest.cpp.
159 {
163}
static void test_edgeclipper()
static void test_hairclipping(skiatest::Reporter *reporter)
static void test_intersectline(skiatest::Reporter *reporter)
◆ DEF_TEST() [2/2]
DEF_TEST |
( |
LineClipper_skbug_7981 |
, |
|
|
r |
|
|
) |
| |
Definition at line 165 of file ClipperTest.cpp.
165 {
166 SkPoint src[] = {{ -5.77698802E+17f, -1.81758057E+23f}, {38127, 2}};
168 SkRect clip = { -32767, -32767, 32767, 32767 };
169
171}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
static bool IntersectLine(const SkPoint src[2], const SkRect &clip, SkPoint dst[2])
◆ test_edgeclipper()
static void test_edgeclipper |
( |
| ) |
|
|
static |
Definition at line 60 of file ClipperTest.cpp.
60 {
62
64 { 3.0995476e+010f, 42.929779f },
65 { -3.0995163e+010f, 51.050385f },
66 { -3.0995157e+010f, 51.050392f },
67 { -3.0995134e+010f, 51.050400f },
68 };
69
71
72
73
74
75 clipper.clipCubic(pts,
clip);
76}
◆ test_hairclipping()
We had a bug where we misinterpreted the bottom of the clip, and would draw another pixel (to the right in this case) on the same last scanline. i.e. we would draw to [2,1], even though this hairline should just draw to [1,1], [2,2], [3,3] modulo the clip.
The result of this entire draw should be that we only draw to [1,1]
Fixed in rev. 3366
Definition at line 24 of file ClipperTest.cpp.
24 {
28
30 paint.setAntiAlias(
true);
31
34 canvas.drawLine(1.5f, 1.5f,
36
37
38
39
40
41
42
43
44
45
46
47 for (
int y = 0;
y < 4; ++
y) {
48 for (
int x = 0;
x < 4; ++
x) {
49 bool nonWhite = (1 ==
y) && (1 ==
x);
51 if (nonWhite) {
53 } else {
55 }
56 }
57 }
58}
constexpr SkColor SK_ColorWHITE
#define REPORTER_ASSERT(r, cond,...)
void allocN32Pixels(int width, int height, bool isOpaque=false)
uint32_t * getAddr32(int x, int y) const
void eraseColor(SkColor4f) const
static constexpr SkRect MakeWH(float w, float h)
◆ test_intersectline()
Definition at line 78 of file ClipperTest.cpp.
78 {
86
89
91
96
97 {
L,
T }, {
L - 10,
T - 10 },
98 {
L,
B }, {
L - 10,
B + 10 },
99 {
R,
T }, {
R + 10,
T - 10 },
100 {
R,
B }, {
R + 10,
B + 10 },
101 };
104 if (valid) {
105 SkDebugf(
"----- [%zu] %g %g -> %g %g\n",
107 }
109 }
110
111 static const SkPoint gFull[] = {
112
121
126 };
129 if (!valid || 0 != memcmp(&gFull[
i],
dst,
sizeof(
dst))) {
130 SkDebugf(
"++++ [%zu] %g %g -> %g %g\n",
132 }
134 }
135
136 static const SkPoint gPartial[] = {
141
142 {
L,
T - 10 }, {
L,
B + 10 }, {
L,
T }, {
L,
B },
143 {
R,
T - 10 }, {
R,
B + 10 }, {
R,
T }, {
R,
B },
144 {
L - 10,
T }, {
R + 10,
T }, {
L,
T }, {
R,
T },
145 {
L - 10,
B }, {
R + 10,
B }, {
L,
B }, {
R,
B },
146 };
149 if (!valid || 0 != memcmp(&gPartial[
i+2],
dst,
sizeof(
dst))) {
150 SkDebugf(
"++++ [%zu] %g %g -> %g %g\n",
152 }
154 !memcmp(&gPartial[
i+2],
dst,
sizeof(
dst)));
155 }
156
157}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static SkPathRef * gEmpty
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size