1047 {
1050 };
1051 static const Varying kVaryings[]{
1053 };
1054 static constexpr char kVS[] = R"(
1055 Varyings main(in const Attributes attributes) {
1056 Varyings varyings;
1057 varyings.position = attributes.pos;
1058 return varyings;
1059 }
1060 )";
1062 uniform float2 offset;
1063 float2 main(const Varyings varyings, out float4 color) {
1064 float2 tl = float2(%f, %f);
1065 float2 wh = float2(%f, %f);
1066 float2 c = tl + wh/2;
1067 float r = length(wh)/4;
1068 color.rba = float3(1);
1069 color.g = min(1, length(varyings.position - c + offset) / r);
1070 return varyings.position;
1071 }
1072 )", kRect.x(), kRect.y(), kRect.width(), kRect.height());
1073 auto [spec,
error] =
1076 kVaryings,
1078 kFS,
1081 if (!spec) {
1083 }
1084 fSpec = std::move(spec);
1085
1088
1093 }
1101 nullptr,
1104 0,
1105 360.f,
1106 interpolation,
1107 nullptr);
1108 }
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
static Result Make(SkSpan< const Attribute > attributes, size_t vertexStride, SkSpan< const Varying > varyings, const SkString &vs, const SkString &fs)
SK_API sk_sp< SkMesh::IndexBuffer > MakeIndexBuffer(const void *data, size_t size)
SK_API sk_sp< SkMesh::VertexBuffer > MakeVertexBuffer(const void *, size_t size)
PODArray< SkColor > colors
static const std::map< std::string, VerticesBuilder::AttributeType > kAttributes