Flutter Engine
The Flutter Engine
Path_addRoundRect.cpp
Go to the documentation of this file.
1// Copyright 2019 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(Path_addRoundRect, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
7 paint.setAntiAlias(true);
8 for (auto xradius : { 0, 7, 13, 20 } ) {
9 for (auto yradius : { 0, 9, 18, 40 } ) {
11 path.addRoundRect({10, 10, 36, 46}, xradius, yradius);
12 paint.setColor(path.isRect(nullptr) ? SK_ColorRED : path.isOval(nullptr) ?
14 canvas->drawPath(path, paint);
15 canvas->translate(64, 0);
16 }
17 canvas->translate(-256, 64);
18 }
19}
20} // END FIDDLE
REG_FIDDLE(Path_addRoundRect, 256, 256, false, 0)
constexpr SkColor SK_ColorGRAY
Definition: SkColor.h:113
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
Definition: SkPath.h:59
const Paint & paint
Definition: color_source.cc:38
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57