1*c8dee2aaSAndroid Build Coastguard Worker // Copyright 2020 Google LLC.
2*c8dee2aaSAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3*c8dee2aaSAndroid Build Coastguard Worker #include "tools/fiddle/examples.h"
4*c8dee2aaSAndroid Build Coastguard Worker REG_FIDDLE(fluttershadow, 256, 256, false, 0) {
draw(SkCanvas * canvas)5*c8dee2aaSAndroid Build Coastguard Worker void draw(SkCanvas* canvas) {
6*c8dee2aaSAndroid Build Coastguard Worker SkPaint p;
7*c8dee2aaSAndroid Build Coastguard Worker p.setAntiAlias(true);
8*c8dee2aaSAndroid Build Coastguard Worker SkPath path;
9*c8dee2aaSAndroid Build Coastguard Worker path.moveTo(50.0, 50.0);
10*c8dee2aaSAndroid Build Coastguard Worker
11*c8dee2aaSAndroid Build Coastguard Worker // Comment the next 4 lines, and the shadow will draw.
12*c8dee2aaSAndroid Build Coastguard Worker path.lineTo(60.0, 50.0);
13*c8dee2aaSAndroid Build Coastguard Worker path.lineTo(60.0, 60.0);
14*c8dee2aaSAndroid Build Coastguard Worker path.lineTo(70.0, 60.0);
15*c8dee2aaSAndroid Build Coastguard Worker path.lineTo(70.0, 50.0);
16*c8dee2aaSAndroid Build Coastguard Worker
17*c8dee2aaSAndroid Build Coastguard Worker path.lineTo(150.0, 50.0);
18*c8dee2aaSAndroid Build Coastguard Worker path.lineTo(150.0, 150.0);
19*c8dee2aaSAndroid Build Coastguard Worker path.lineTo(50.0, 150.0);
20*c8dee2aaSAndroid Build Coastguard Worker path.close();
21*c8dee2aaSAndroid Build Coastguard Worker p.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, 3));
22*c8dee2aaSAndroid Build Coastguard Worker canvas->drawPath(path, p);
23*c8dee2aaSAndroid Build Coastguard Worker }
24*c8dee2aaSAndroid Build Coastguard Worker } // END FIDDLE
25