32 half4 main(float2 coord) {
33 coord.x += sin(coord.y / 3) * 4;
34 return child.eval(coord);
51 canvas->translate(tx, ty);
52 canvas->clipRect(
clip);
54 canvas->saveLayer(
nullptr, &filterPaint);
55 const char* str =
"The quick brown fox jumped over the lazy dog.";
58 for (
int i = 0;
i < 25; ++
i) {
77 p.setPerspY(-0.0015f);
78 draw_layer(250, 500,
p);
85 uniform shader content;
86 uniform shader blurred;
87 vec4 main(vec2 coord) {
88 vec4 c = content.eval(coord);
89 vec4 b = blurred.eval(coord);
90 return c + (c - b) * 4;
98 std::string_view childNames[] = {
"content",
"blurred" };
103 canvas->drawImage(
image, 0, 0);
104 canvas->translate(256, 0);
107 paint.setImageFilter(sharpened);
108 canvas->saveLayer({ 0, 0, 256, 256 }, &
paint);
109 canvas->drawImage(
image, 0, 0);
constexpr SkColor SK_ColorBLACK
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > RuntimeShader(const SkRuntimeShaderBuilder &builder, std::string_view childShaderName, sk_sp< SkImageFilter > input)
static SkMatrix Scale(SkScalar sx, SkScalar sy)
static SkMatrix RotateDeg(SkScalar deg)
static const SkMatrix & I()
static SkMatrix Skew(SkScalar kx, SkScalar ky)
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
SkScalar nextRangeScalar(SkScalar min, SkScalar max)
uint32_t nextULessThan(uint32_t count)
uint32_t nextBits(unsigned bitCount)
static Result MakeForShader(SkString sksl, const Options &)
sk_sp< const SkImage > image
font
Font Metadata and Metrics.
DEF_SIMPLE_GM_BG(rtif_distort, canvas, 500, 750, SK_ColorBLACK)
DEF_SIMPLE_GM(rtif_unsharp, canvas, 512, 256)
static sk_sp< SkImageFilter > make_filter()
static constexpr SkRect MakeWH(float w, float h)
sk_sp< SkRuntimeEffect > effect