Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
impeller::ColorSource Class Reference

#include <color_source.h>

Public Types

enum class  Type {
  kColor , kImage , kLinearGradient , kRadialGradient ,
  kConicalGradient , kSweepGradient , kRuntimeEffect , kScene
}
 

Public Member Functions

 ColorSource () noexcept
 
 ~ColorSource ()
 
Type GetType () const
 
std::shared_ptr< ColorSourceContentsGetContents (const Paint &paint) const
 
const ColorSourceDataGetData () const
 

Static Public Member Functions

static ColorSource MakeColor ()
 
static ColorSource MakeLinearGradient (Point start_point, Point end_point, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
 
static ColorSource MakeConicalGradient (Point center, Scalar radius, std::vector< Color > colors, std::vector< Scalar > stops, Point focus_center, Scalar focus_radius, Entity::TileMode tile_mode, Matrix effect_transform)
 
static ColorSource MakeRadialGradient (Point center, Scalar radius, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
 
static ColorSource MakeSweepGradient (Point center, Degrees start_angle, Degrees end_angle, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
 
static ColorSource MakeImage (std::shared_ptr< Texture > texture, Entity::TileMode x_tile_mode, Entity::TileMode y_tile_mode, SamplerDescriptor sampler_descriptor, Matrix effect_transform)
 
static ColorSource MakeRuntimeEffect (std::shared_ptr< RuntimeStage > runtime_stage, std::shared_ptr< std::vector< uint8_t > > uniform_data, std::vector< RuntimeEffectContents::TextureInput > texture_inputs)
 

Detailed Description

Definition at line 99 of file color_source.h.

Member Enumeration Documentation

◆ Type

enum class impeller::ColorSource::Type
strong
Enumerator
kColor 
kImage 
kLinearGradient 
kRadialGradient 
kConicalGradient 
kSweepGradient 
kRuntimeEffect 
kScene 

Definition at line 101 of file color_source.h.

Constructor & Destructor Documentation

◆ ColorSource()

impeller::ColorSource::ColorSource ( )
noexcept

Definition at line 158 of file color_source.cc.

158: color_source_data_(std::monostate()) {}

◆ ~ColorSource()

impeller::ColorSource::~ColorSource ( )
default

Member Function Documentation

◆ GetContents()

std::shared_ptr< ColorSourceContents > impeller::ColorSource::GetContents ( const Paint paint) const

Definition at line 264 of file color_source.cc.

265 {
266 return std::visit(CreateContentsVisitor{paint}, color_source_data_);
267}
const Paint & paint

◆ GetData()

const ColorSourceData & impeller::ColorSource::GetData ( ) const

Definition at line 269 of file color_source.cc.

269 {
270 return color_source_data_;
271}

◆ GetType()

ColorSource::Type impeller::ColorSource::GetType ( ) const

Definition at line 260 of file color_source.cc.

260 {
261 return type_;
262}

◆ MakeColor()

ColorSource impeller::ColorSource::MakeColor ( )
static

Definition at line 162 of file color_source.cc.

162 {
163 return {};
164}

◆ MakeConicalGradient()

ColorSource impeller::ColorSource::MakeConicalGradient ( Point  center,
Scalar  radius,
std::vector< Color colors,
std::vector< Scalar stops,
Point  focus_center,
Scalar  focus_radius,
Entity::TileMode  tile_mode,
Matrix  effect_transform 
)
static

Definition at line 180 of file color_source.cc.

187 {
190 result.color_source_data_ = ConicalGradientData{
191 center, radius, std::move(colors), std::move(stops),
192 focus_center, focus_radius, tile_mode, effect_transform};
193 return result;
194}
static SkScalar center(float pos0, float pos1)
GAsyncResult * result

◆ MakeImage()

ColorSource impeller::ColorSource::MakeImage ( std::shared_ptr< Texture texture,
Entity::TileMode  x_tile_mode,
Entity::TileMode  y_tile_mode,
SamplerDescriptor  sampler_descriptor,
Matrix  effect_transform 
)
static

Definition at line 225 of file color_source.cc.

229 {
231 result.type_ = Type::kImage;
232 result.color_source_data_ =
233 ImageData{std::move(texture), x_tile_mode, y_tile_mode,
234 std::move(sampler_descriptor), effect_transform};
235 return result;
236}
FlTexture * texture

◆ MakeLinearGradient()

ColorSource impeller::ColorSource::MakeLinearGradient ( Point  start_point,
Point  end_point,
std::vector< Color colors,
std::vector< Scalar stops,
Entity::TileMode  tile_mode,
Matrix  effect_transform 
)
static

Definition at line 166 of file color_source.cc.

171 {
174 result.color_source_data_ =
175 LinearGradientData{start_point, end_point, std::move(colors),
176 std::move(stops), tile_mode, effect_transform};
177 return result;
178}

◆ MakeRadialGradient()

ColorSource impeller::ColorSource::MakeRadialGradient ( Point  center,
Scalar  radius,
std::vector< Color colors,
std::vector< Scalar stops,
Entity::TileMode  tile_mode,
Matrix  effect_transform 
)
static

Definition at line 196 of file color_source.cc.

201 {
204 result.color_source_data_ =
205 RadialGradientData{center, radius, std::move(colors),
206 std::move(stops), tile_mode, effect_transform};
207 return result;
208}

◆ MakeRuntimeEffect()

ColorSource impeller::ColorSource::MakeRuntimeEffect ( std::shared_ptr< RuntimeStage runtime_stage,
std::shared_ptr< std::vector< uint8_t > >  uniform_data,
std::vector< RuntimeEffectContents::TextureInput texture_inputs 
)
static

Definition at line 238 of file color_source.cc.

241 {
244 result.color_source_data_ =
245 RuntimeEffectData{std::move(runtime_stage), std::move(uniform_data),
246 std::move(texture_inputs)};
247 return result;
248}

◆ MakeSweepGradient()

ColorSource impeller::ColorSource::MakeSweepGradient ( Point  center,
Degrees  start_angle,
Degrees  end_angle,
std::vector< Color colors,
std::vector< Scalar stops,
Entity::TileMode  tile_mode,
Matrix  effect_transform 
)
static

Definition at line 210 of file color_source.cc.

216 {
219 result.color_source_data_ = SweepGradientData{
220 center, start_angle, end_angle, std::move(colors),
221 std::move(stops), tile_mode, effect_transform};
222 return result;
223}

The documentation for this class was generated from the following files: