31 {
33 uniform shader src;
34 uniform float in_inverseScale;
35 uniform float2 in_blurOffset;
36
37 half4 main(float2 xy) {
38 float2 scaled_xy = float2(xy.x * in_inverseScale, xy.y * in_inverseScale);
39
40 half4 c = src.eval(scaled_xy);
41 c += src.eval(scaled_xy + float2( in_blurOffset.x, in_blurOffset.y));
42 c += src.eval(scaled_xy + float2( in_blurOffset.x, -in_blurOffset.y));
43 c += src.eval(scaled_xy + float2(-in_blurOffset.x, in_blurOffset.y));
44 c += src.eval(scaled_xy + float2(-in_blurOffset.x, -in_blurOffset.y));
45
46 return half4(c.rgb * 0.2, 1.0);
47 }
48 )");
49
51 uniform shader in_blur;
52 uniform shader in_original;
53 uniform float in_inverseScale;
54 uniform float in_mix;
55
56 half4 main(float2 xy) {
57 float2 scaled_xy = float2(xy.x * in_inverseScale, xy.y * in_inverseScale);
58
59 half4 blurred = in_blur.eval(scaled_xy);
60 half4 composition = in_original.eval(xy);
61 return mix(composition, blurred, in_mix);
62 }
63 )");
64
66 if (!blurEffect) {
68 }
69 fBlurEffect = std::move(blurEffect);
70
72 if (!mixEffect) {
73 SkDEBUGFAILF(
"RuntimeShader error: %s\n", error2.c_str());
74 }
75 fMixEffect = std::move(mixEffect);
76 }
#define SkDEBUGFAILF(fmt,...)
static Result MakeForShader(SkString sksl, const Options &)
const uint8_t uint32_t uint32_t GError ** error