523 {
527 };
528 static const Varying kVaryings[]{
530 };
531
532
533 static constexpr char kVS[] = R"(
534 uniform float t[2];
535 uniform half3x3 m;
536 Varyings main(in const Attributes attributes) {
537 Varyings varyings;
538 varyings.coords = (m*float3(attributes.coords + float2(t[0], t[1]), 1)).xy;
539 varyings.position = attributes.pos;
540 return varyings;
541 }
542 )";
543 static constexpr char kFS[] = R"(
544 uniform half3x3 m;
545 layout(color) uniform half4 color;
546 float2 main(const Varyings varyings, out half4 c) {
547 c = color;
548 return (m*float3(varyings.coords, 1)).xy;
549 }
550 )";
554 kVaryings,
559 if (!spec) {
561 }
562 fSpec = std::move(spec);
563
566 .4f,
568 nullptr,
569 2,
571
573 }
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static Result Make(SkSpan< const Attribute > attributes, size_t vertexStride, SkSpan< const Varying > varyings, const SkString &vs, const SkString &fs)
const uint8_t uint32_t uint32_t GError ** error
SK_API sk_sp< SkMesh::VertexBuffer > MakeVertexBuffer(const void *, size_t size)
PODArray< SkColor > colors
static const std::map< std::string, VerticesBuilder::AttributeType > kAttributes