4 {
5
7 const char* sksl =
8 "half4 main(float2 coord) {"
9 " float t = coord.x / 128;"
10 " half4 white = half4(1);"
11 " half4 black = half4(0,0,0,1);"
12 " return mix(white, black, t);"
13 "}";
15 return effect->makeShader( nullptr, {});
16}
17
19
21
22 const char* sksl =
23 "uniform shader input_1;"
24 "uniform shader input_2;"
25 "half4 main(float2 coord) {"
26 " return input_1.eval(coord) * input_2.eval(coord);"
27 "}";
29 makeGradientShader() };
30
31
32
33
36 children);
37
38
40 p.setShader(myShader);
42
43}}
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void drawPaint(const SkPaint &paint)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
static Result MakeForShader(SkString sksl, const Options &)
sk_sp< const SkImage > image
SkSamplingOptions(SkFilterMode::kLinear))