36 auto fuzzByteToASCII = [&](uint8_t c,
SkString* str) ->
bool {
38 if ((c >= 32 && c <= 127) || c ==
'\r' || c ==
'\n' || c ==
'\t') {
46 auto fuzzByteToSkSL = [&](uint8_t c,
SkString* str) ->
bool {
49 return fuzzByteToASCII(c, str);
55 if (!attributes.
empty()) {
56 str->append(attributes[c % attributes.
size()].name);
63 if (!varyings.
empty()) {
64 str->append(varyings[c % varyings.
size()].name);
73 static constexpr std::string_view kSkSLData[] = {
149 c %= std::size(kSkSLData);
150 str->append(kSkSLData[c]);
157 while (!data.empty()) {
158 uint8_t control = extract<uint8_t>(data) % 4;
170 while (uint8_t c = extract<char>(data)) {
171 if (!fuzzByteToASCII(c, &
a.name)) {
181 while (uint8_t c = extract<char>(data)) {
182 if (!fuzzByteToASCII(c, &v.
name)) {
190 while (uint8_t c = extract<char>(data)) {
191 if (!fuzzByteToSkSL(c, &vs)) {
199 while (uint8_t c = extract<char>(data)) {
200 if (!fuzzByteToSkSL(c, &fs)) {
210 if (
result.error.isEmpty()) {
212 printf(
"----\n%s\n----\n\n----\n%s\n----\n\n\n", vs.
c_str(), fs.
c_str());
static Result Make(SkSpan< const Attribute > attributes, size_t vertexStride, SkSpan< const Varying > varyings, const SkString &vs, const SkString &fs)