26 {
29
33 size_t vertexStride;
35
36 auto fuzzByteToASCII = [&](uint8_t c,
SkString* str) ->
bool {
37
38 if ((c >= 32 && c <= 127) || c == '\r' || c == '\n' || c == '\t') {
39 char ascii = c;
41 return true;
42 }
43 return false;
44 };
45
46 auto fuzzByteToSkSL = [&](uint8_t c,
SkString* str) ->
bool {
47
48 if (c < 128) {
49 return fuzzByteToASCII(c, str);
50 }
51 c -= 128;
52
53
55 if (!attributes.
empty()) {
56 str->append(attributes[c % attributes.
size()].name);
57 }
58 return true;
59 }
61
63 if (!varyings.
empty()) {
64 str->append(varyings[c % varyings.
size()].name);
65 }
66 return true;
67 }
69
70
71
72
73 static constexpr std::string_view kSkSLData[] = {
74 " true ",
75 " false ",
76 " if ",
77 " else ",
78 " for ",
79 " while ",
80 " do ",
81 " switch ",
82 " case ",
83 " default ",
84 " break ",
85 " continue ",
86 " discard ",
87 " return ",
88 " in ",
89 " out ",
90 " inout ",
91 " uniform ",
92 " const ",
93 " flat ",
94 " noperspective ",
95 " inline ",
96 " noinline ",
97 " $pure ",
98 " readonly ",
99 " writeonly ",
100 " buffer ",
101 " struct ",
102 " layout ",
103 " highp ",
104 " mediump ",
105 " lowp ",
106 " $es3 ",
107 " $export ",
108 " workgroup ",
109 " << ",
110 " >> ",
111 " && ",
112 " || ",
113 " ^^ ",
114 " == ",
115 " != ",
116 " <= ",
117 " >= ",
118 " += ",
119 " -= ",
120 " *= ",
121 " /= ",
122 " %= ",
123 " <<= ",
124 " >>= ",
125 " &= ",
126 " |= ",
127 " ^= ",
128 " ++ ",
129 " -- ",
130 " //",
131 " /*",
132 "*/ ",
133 " float",
134 " half",
135 " int",
136 " uint",
137 " short",
138 " ushort",
139 " bool",
140 " void",
141 " vec",
142 " ivec",
143 " bvec",
144 " mat",
145 " Attributes ",
146 " Varyings ",
147 };
148
150 str->append(kSkSLData[c]);
151 return true;
152 };
153
154
156
157 while (!
data.empty()) {
158 uint8_t control = extract<uint8_t>(
data) % 4;
159
161 break;
162 }
163 switch (control) {
164 case 0: {
165
170 while (uint8_t c = extract<char>(
data)) {
171 if (!fuzzByteToASCII(c, &
a.name)) {
172 break;
173 }
174 }
175 break;
176 }
177 case 1: {
178
181 while (uint8_t c = extract<char>(
data)) {
182 if (!fuzzByteToASCII(c, &v.
name)) {
183 break;
184 }
185 }
186 break;
187 }
188 case 2: {
189
190 while (uint8_t c = extract<char>(
data)) {
191 if (!fuzzByteToSkSL(c, &vs)) {
192 break;
193 }
194 }
195 break;
196 }
197 case 3: {
198
199 while (uint8_t c = extract<char>(
data)) {
200 if (!fuzzByteToSkSL(c, &fs)) {
201 break;
202 }
203 }
204 break;
205 }
206 }
207 }
208
210 if (
result.error.isEmpty()) {
211
213 }
214}
SkMeshSpecification::Attribute Attribute
SkMeshSpecification::Varying Varying
static constexpr size_t kMaxVaryings
static constexpr size_t kMaxAttributes
static constexpr size_t kMaxStride
static Result Make(SkSpan< const Attribute > attributes, size_t vertexStride, SkSpan< const Varying > varyings, const SkString &vs, const SkString &fs)
void append(const char text[])
const char * c_str() const
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
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