Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
fluttershadow.cpp
Go to the documentation of this file.
1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(fluttershadow, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
6 SkPaint p;
7 p.setAntiAlias(true);
8 SkPath path;
9 path.moveTo(50.0, 50.0);
10
11 // Comment the next 4 lines, and the shadow will draw.
12 path.lineTo(60.0, 50.0);
13 path.lineTo(60.0, 60.0);
14 path.lineTo(70.0, 60.0);
15 path.lineTo(70.0, 50.0);
16
17 path.lineTo(150.0, 50.0);
18 path.lineTo(150.0, 150.0);
19 path.lineTo(50.0, 150.0);
20 path.close();
22 canvas->drawPath(path, p);
23}
24} // END FIDDLE
@ kNormal_SkBlurStyle
fuzzy inside and outside
Definition SkBlurTypes.h:12
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawPath(const SkPath &path, const SkPaint &paint)
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60