Flutter Engine
The Flutter Engine
Functions
Canvas_drawOval.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_drawOval, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_drawOval  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Canvas_drawOval.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 canvas->clear(0xFF3f5f9f);
7 SkColor kColor1 = SkColorSetARGB(0xff, 0xff, 0x7f, 0);
8 SkColor g1Colors[] = { kColor1, SkColorSetA(kColor1, 0x20) };
9 SkPoint g1Points[] = { { 0, 0 }, { 0, 100 } };
10 SkScalar pos[] = { 0.2f, 1.0f };
13 paint.setAntiAlias(true);
14 paint.setShader(SkGradientShader::MakeLinear(g1Points, g1Colors, pos, std::size(g1Colors),
16 canvas->drawOval(bounds , paint);
17}
18} // END FIDDLE
SkPoint pos
uint32_t SkColor
Definition: SkColor.h:37
static constexpr SkColor SkColorSetA(SkColor c, U8CPU a)
Definition: SkColor.h:82
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkColor.h:49
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawOval(const SkRect &oval, const SkPaint &paint)
Definition: SkCanvas.cpp:1698
void clear(SkColor color)
Definition: SkCanvas.h:1199
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
static SkColor kColor1
Optional< SkRect > bounds
Definition: SkRecords.h:189
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
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609