Hal Canary | 6c8422c | 2020-01-10 15:22:09 -0500 | [diff] [blame] | 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. |
| 3 | #include "tools/fiddle/examples.h" |
| 4 | REG_FIDDLE(skpaint_line_2d_path_effect, 256, 256, false, 0) { |
| 5 | void draw(SkCanvas* canvas) { |
| 6 | SkPaint paint; |
| 7 | SkMatrix lattice; |
| 8 | lattice.setScale(8.0f, 8.0f); |
| 9 | lattice.preRotate(30.0f); |
| 10 | paint.setPathEffect(SkLine2DPathEffect::Make(0.0f, lattice)); |
| 11 | paint.setAntiAlias(true); |
| 12 | SkRect bounds = SkRect::MakeWH(256, 256); |
| 13 | bounds.outset(8.0f, 8.0f); |
| 14 | canvas->clear(SK_ColorWHITE); |
| 15 | canvas->drawRect(bounds, paint); |
| 16 | } |
| 17 | } // END FIDDLE |