Go to the source code of this file.
◆ DEF_TEST() [1/2]
Definition at line 86 of file VerticesTest.cpp.
86 {
87 int vCount = 5;
88 int iCount = 9;
89
90
93 for (auto texF : texFlags) {
94 for (auto colF : colFlags) {
95 uint32_t
flags = texF | colF;
96
98
99 for (
int i = 0;
i < vCount; ++
i) {
104 }
107 }
108 }
109 for (
int i = 0;
i < iCount; ++
i) {
111 }
113 }
114 }
115
116 {
117
118
122 }
123 {
124
128 }
129 {
130
134 }
135 {
136
140 }
141 {
142
146 }
147}
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
#define REPORTER_ASSERT(r, cond,...)
static void self_test(const sk_sp< SkVertices > &v0, skiatest::Reporter *reporter)
@ kHasTexCoords_BuilderFlag
@ kTriangleFan_VertexMode
FlutterSemanticsFlag flags
◆ DEF_TEST() [2/2]
DEF_TEST |
( |
Vertices_clipping |
, |
|
|
reporter |
|
|
) |
| |
Definition at line 155 of file VerticesTest.cpp.
155 {
156
157
158
160
161 SkPoint pts[] = { { -10, 1 }, { -10, 2 }, { 1e9f, 1.5f } };
163
166 while (
void*
addr = iter.next(&loc)) {
170 } else {
172 }
173 }
174}
constexpr SkColor SK_ColorBLACK
static void fill_triangle(SkCanvas *canvas, const SkPoint pts[], SkColor c)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)
◆ equal()
Definition at line 26 of file VerticesTest.cpp.
26 {
28
29 if (v0.mode() != v1.mode()) {
30 return false;
31 }
32 if (v0.vertexCount() != v1.vertexCount()) {
33 return false;
34 }
35 if (v0.indexCount() != v1.indexCount()) {
36 return false;
37 }
38
39 if (!!v0.texCoords() != !!v1.texCoords()) {
40 return false;
41 }
42 if (!!v0.colors() != !!v1.colors()) {
43 return false;
44 }
45
46 for (
int i = 0;
i < v0.vertexCount(); ++
i) {
47 if (v0.positions()[
i] != v1.positions()[
i]) {
48 return false;
49 }
50 if (v0.texCoords()) {
51 if (v0.texCoords()[
i] != v1.texCoords()[
i]) {
52 return false;
53 }
54 }
55 if (v0.colors()) {
56 if (v0.colors()[
i] != v1.colors()[
i]) {
57 return false;
58 }
59 }
60 }
61 for (
int i = 0;
i < v0.indexCount(); ++
i) {
62 if (v0.indices()[
i] != v1.indices()[
i]) {
63 return false;
64 }
65 }
66 return true;
67}
◆ fill_triangle()
Definition at line 149 of file VerticesTest.cpp.
149 {
153}
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
PODArray< SkColor > colors
◆ self_test()
Definition at line 69 of file VerticesTest.cpp.
69 {
72
74 writer.writeToMemory(buf.get());
76
78
84}
static bool equal(const SkVertices *vert0, const SkVertices *vert1)
void encode(SkWriteBuffer &) const
static sk_sp< SkVertices > Decode(SkReadBuffer &)
uint32_t uniqueID() const