Flutter Engine
The Flutter Engine
Canvas_drawRoundRect.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(Canvas_drawRoundRect, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
6 SkVector radii[] = { {0, 20}, {10, 10}, {10, 20}, {10, 40} };
8 paint.setStrokeWidth(15);
9 paint.setStrokeJoin(SkPaint::kRound_Join);
10 paint.setAntiAlias(true);
11 for (auto style : { SkPaint::kStroke_Style, SkPaint::kFill_Style } ) {
12 paint.setStyle(style );
13 for (size_t i = 0; i < std::size(radii); ++i) {
14 canvas->drawRoundRect({10, 10, 60, 40}, radii[i].fX, radii[i].fY, paint);
15 canvas->translate(0, 60);
16 }
17 canvas->translate(80, -240);
18 }
19}
20} // END FIDDLE
REG_FIDDLE(Canvas_drawRoundRect, 256, 256, false, 0)
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 drawRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, const SkPaint &paint)
Definition: SkCanvas.cpp:2717
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
@ kFill_Style
set to fill geometry
Definition: SkPaint.h:193
@ kRound_Join
adds circle
Definition: SkPaint.h:360
const Paint & paint
Definition: color_source.cc:38
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
float fX
x-axis value
Definition: SkPoint_impl.h:164
float fY
y-axis value
Definition: SkPoint_impl.h:165