Flutter Engine
The Flutter Engine
Classes | Typedefs | Functions | Variables
gradient_dirty_laundry.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/SkScalar.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

struct  GradData
 
class  GradientsGM
 

Typedefs

typedef sk_sp< SkShader >(* GradMaker) (const SkPoint pts[2], const GradData &, SkTileMode)
 

Functions

static sk_sp< SkShaderMakeLinear (const SkPoint pts[2], const GradData &data, SkTileMode tm)
 
static sk_sp< SkShaderMakeRadial (const SkPoint pts[2], const GradData &data, SkTileMode tm)
 
static sk_sp< SkShaderMakeSweep (const SkPoint pts[2], const GradData &data, SkTileMode)
 

Variables

constexpr SkColor gColors []
 
constexpr GradData gGradData []
 
constexpr GradMaker gGradMakers []
 

Typedef Documentation

◆ GradMaker

typedef sk_sp< SkShader >(* GradMaker) (const SkPoint pts[2], const GradData &, SkTileMode)

Definition at line 65 of file gradient_dirty_laundry.cpp.

Function Documentation

◆ MakeLinear()

static sk_sp< SkShader > MakeLinear ( const SkPoint  pts[2],
const GradData data,
SkTileMode  tm 
)
static

Definition at line 50 of file gradient_dirty_laundry.cpp.

50 {
51 return SkGradientShader::MakeLinear(pts, data.fColors, data.fPos, data.fCount, tm);
52}
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)
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ MakeRadial()

static sk_sp< SkShader > MakeRadial ( const SkPoint  pts[2],
const GradData data,
SkTileMode  tm 
)
static

Definition at line 54 of file gradient_dirty_laundry.cpp.

54 {
55 const SkPoint pt{ SkScalarAve(pts[0].fX, pts[1].fX), SkScalarAve(pts[0].fY, pts[1].fY) };
56 return SkGradientShader::MakeRadial(pt, pt.fX, data.fColors, data.fPos, data.fCount, tm);
57}
#define SkScalarAve(a, b)
Definition: SkScalar.h:74
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)

◆ MakeSweep()

static sk_sp< SkShader > MakeSweep ( const SkPoint  pts[2],
const GradData data,
SkTileMode   
)
static

Definition at line 59 of file gradient_dirty_laundry.cpp.

59 {
60 const SkPoint pt{ SkScalarAve(pts[0].fX, pts[1].fX), SkScalarAve(pts[0].fY, pts[1].fY) };
61 return SkGradientShader::MakeSweep(pt.fX, pt.fY, data.fColors, data.fPos, data.fCount);
62}
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)

Variable Documentation

◆ gColors

constexpr SkColor gColors[]
constexpr

◆ gGradData

constexpr GradData gGradData[]
constexpr
Initial value:
= {
{ 40, gColors, nullptr },
}
constexpr SkColor gColors[]

Definition at line 44 of file gradient_dirty_laundry.cpp.

◆ gGradMakers

constexpr GradMaker gGradMakers[]
constexpr
Initial value:
= {
}
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const GradData &data, SkTileMode tm)
static sk_sp< SkShader > MakeRadial(const SkPoint pts[2], const GradData &data, SkTileMode tm)
static sk_sp< SkShader > MakeSweep(const SkPoint pts[2], const GradData &data, SkTileMode)

Definition at line 67 of file gradient_dirty_laundry.cpp.