Flutter Engine
The Flutter Engine
Classes | Functions
DegenerateTwoPtRadialsSlide.cpp File Reference
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkString.h"
#include "include/effects/SkGradientShader.h"
#include "tools/fonts/FontToolUtils.h"
#include "tools/viewer/Slide.h"

Go to the source code of this file.

Classes

class  DegenerateTwoPtRadialsSlide
 

Functions

static void draw_gradient2 (SkCanvas *canvas, const SkRect &rect, SkScalar delta)
 

Function Documentation

◆ draw_gradient2()

static void draw_gradient2 ( SkCanvas canvas,
const SkRect rect,
SkScalar  delta 
)
static

Definition at line 15 of file DegenerateTwoPtRadialsSlide.cpp.

15 {
17 SkScalar pos[] = { 0, 0.25f, 0.75f, SK_Scalar1 };
18
19 SkScalar l = rect.fLeft;
20 SkScalar t = rect.fTop;
21 SkScalar w = rect.width();
22 SkScalar h = rect.height();
23
24 SkASSERT(0 == SkScalarMod(w, SK_Scalar1 * 5));
25
26 SkPoint c0 = { l + 2 * w / 5 + delta, t + h / 2 };
27 SkPoint c1 = { l + 3 * w / 5, t + h / 2 };
28 SkScalar r0 = w / 5;
29 SkScalar r1 = 2 * w / 5;
31 paint.setShader(SkGradientShader::MakeTwoPointConical(c0, r0, c1, r1, colors,
34 canvas->drawRect(rect, paint);
35}
SkPoint pos
#define SkASSERT(cond)
Definition: SkAssert.h:116
constexpr SkColor SK_ColorMAGENTA
Definition: SkColor.h:147
uint32_t SkColor
Definition: SkColor.h:37
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
#define SkScalarMod(x, y)
Definition: SkScalar.h:41
#define SK_Scalar1
Definition: SkScalar.h:18
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
static sk_sp< SkShader > MakeTwoPointConical(const SkPoint &start, SkScalar startRadius, const SkPoint &end, SkScalar endRadius, 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
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
PODArray< SkColor > colors
Definition: SkRecords.h:276
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
SkScalar w
SkScalar h