Flutter Engine
The Flutter Engine
Classes | Macros | Typedefs | Functions
shallowgradient.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkShader.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTileMode.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkGradientShader.h"

Go to the source code of this file.

Classes

class  ShallowGradientGM
 

Macros

#define M(PROC, DITHER)   DEF_GM( return new ShallowGradientGM(shader_ ## PROC, #PROC, DITHER); )
 

Typedefs

typedef sk_sp< SkShader >(* MakeShaderProc) (const SkColor[], int count, const SkSize &)
 

Functions

static sk_sp< SkShadershader_linear (const SkColor colors[], int count, const SkSize &size)
 
static sk_sp< SkShadershader_radial (const SkColor colors[], int count, const SkSize &size)
 
static sk_sp< SkShadershader_conical (const SkColor colors[], int count, const SkSize &size)
 
static sk_sp< SkShadershader_sweep (const SkColor colors[], int count, const SkSize &size)
 
 M (linear, true) M(radial
 
true M (conical, true) M(sweep
 
true true M (linear, false) M(radial
 
true true false M (conical, false) M(sweep
 

Macro Definition Documentation

◆ M

#define M (   PROC,
  DITHER 
)    DEF_GM( return new ShallowGradientGM(shader_ ## PROC, #PROC, DITHER); )

Definition at line 77 of file shallowgradient.cpp.

Typedef Documentation

◆ MakeShaderProc

typedef sk_sp< SkShader >(* MakeShaderProc) (const SkColor[], int count, const SkSize &)

Definition at line 22 of file shallowgradient.cpp.

Function Documentation

◆ M() [1/4]

true true false M ( conical  ,
false   
)

◆ M() [2/4]

true M ( conical  ,
true   
)

◆ M() [3/4]

true true M ( linear  ,
false   
)

◆ M() [4/4]

M ( linear  ,
true   
)

◆ shader_conical()

static sk_sp< SkShader > shader_conical ( const SkColor  colors[],
int  count,
const SkSize size 
)
static

Definition at line 35 of file shallowgradient.cpp.

35 {
36 SkPoint center = { size.width()/2, size.height()/2 };
37 return SkGradientShader::MakeTwoPointConical(center, size.width()/64, center, size.width()/2,
39}
int count
Definition: FontMgrTest.cpp:50
static SkScalar center(float pos0, float pos1)
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)
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

◆ shader_linear()

static sk_sp< SkShader > shader_linear ( const SkColor  colors[],
int  count,
const SkSize size 
)
static

Definition at line 24 of file shallowgradient.cpp.

24 {
25 SkPoint pts[] = { { 0, 0 }, { size.width(), size.height() } };
27}
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)

◆ shader_radial()

static sk_sp< SkShader > shader_radial ( const SkColor  colors[],
int  count,
const SkSize size 
)
static

Definition at line 29 of file shallowgradient.cpp.

29 {
30 SkPoint center = { size.width()/2, size.height()/2 };
31 return SkGradientShader::MakeRadial(center, size.width()/2, colors, nullptr, count,
33}
static sk_sp< SkShader > MakeRadial(const SkPoint &center, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)

◆ shader_sweep()

static sk_sp< SkShader > shader_sweep ( const SkColor  colors[],
int  count,
const SkSize size 
)
static

Definition at line 41 of file shallowgradient.cpp.

41 {
42 return SkGradientShader::MakeSweep(size.width()/2, size.height()/2, colors, nullptr, count);
43}
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)