Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
flutter::DlColorColorSource Class Referencefinal

#include <dl_color_source.h>

Inheritance diagram for flutter::DlColorColorSource:
flutter::DlColorSource flutter::DlAttribute< DlColorSource, DlColorSourceType >

Public Member Functions

 DlColorColorSource (DlColor color)
 
bool isUIThreadSafe () const override
 If the underlying platform data held by this object is held in a way that it can be stored and potentially released from the UI thread, this method returns true.
 
std::shared_ptr< DlColorSourceshared () const override
 
const DlColorColorSourceasColor () const override
 
DlColorSourceType type () const override
 
size_t size () const override
 
bool is_opaque () const override
 
DlColor color () const
 
- Public Member Functions inherited from flutter::DlColorSource
virtual bool isGradient () const
 If the underlying platform data represents a gradient.
 
virtual const DlImageColorSourceasImage () const
 
virtual const DlLinearGradientColorSourceasLinearGradient () const
 
virtual const DlRadialGradientColorSourceasRadialGradient () const
 
virtual const DlConicalGradientColorSourceasConicalGradient () const
 
virtual const DlSweepGradientColorSourceasSweepGradient () const
 
virtual const DlRuntimeEffectColorSourceasRuntimeEffect () const
 
- Public Member Functions inherited from flutter::DlAttribute< DlColorSource, DlColorSourceType >
bool operator== (DlColorSource const &other) const
 
bool operator!= (DlColorSource const &other) const
 
virtual ~DlAttribute ()=default
 

Protected Member Functions

bool equals_ (DlColorSource const &other) const override
 
- Protected Member Functions inherited from flutter::DlColorSource
 DlColorSource ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from flutter::DlColorSource
static std::shared_ptr< DlLinearGradientColorSourceMakeLinear (const SkPoint start_point, const SkPoint end_point, uint32_t stop_count, const DlColor *colors, const float *stops, DlTileMode tile_mode, const SkMatrix *matrix=nullptr)
 
static std::shared_ptr< DlRadialGradientColorSourceMakeRadial (SkPoint center, SkScalar radius, uint32_t stop_count, const DlColor *colors, const float *stops, DlTileMode tile_mode, const SkMatrix *matrix=nullptr)
 
static std::shared_ptr< DlConicalGradientColorSourceMakeConical (SkPoint start_center, SkScalar start_radius, SkPoint end_center, SkScalar end_radius, uint32_t stop_count, const DlColor *colors, const float *stops, DlTileMode tile_mode, const SkMatrix *matrix=nullptr)
 
static std::shared_ptr< DlSweepGradientColorSourceMakeSweep (SkPoint center, SkScalar start, SkScalar end, uint32_t stop_count, const DlColor *colors, const float *stops, DlTileMode tile_mode, const SkMatrix *matrix=nullptr)
 
static std::shared_ptr< DlRuntimeEffectColorSourceMakeRuntimeEffect (sk_sp< DlRuntimeEffect > runtime_effect, std::vector< std::shared_ptr< DlColorSource > > samplers, std::shared_ptr< std::vector< uint8_t > > uniform_data)
 

Detailed Description

Definition at line 179 of file dl_color_source.h.

Constructor & Destructor Documentation

◆ DlColorColorSource()

flutter::DlColorColorSource::DlColorColorSource ( DlColor  color)
inlineexplicit

Definition at line 181 of file dl_color_source.h.

181: color_(color) {}

Member Function Documentation

◆ asColor()

const DlColorColorSource * flutter::DlColorColorSource::asColor ( ) const
inlineoverridevirtual

Reimplemented from flutter::DlColorSource.

Definition at line 189 of file dl_color_source.h.

189{ return this; }

◆ color()

DlColor flutter::DlColorColorSource::color ( ) const
inline

Definition at line 196 of file dl_color_source.h.

196{ return color_; }

◆ equals_()

bool flutter::DlColorColorSource::equals_ ( DlColorSource const &  other) const
inlineoverrideprotectedvirtual

Implements flutter::DlAttribute< DlColorSource, DlColorSourceType >.

Definition at line 199 of file dl_color_source.h.

199 {
200 FML_DCHECK(other.type() == DlColorSourceType::kColor);
201 auto that = static_cast<DlColorColorSource const*>(&other);
202 return color_ == that->color_;
203 }
#define FML_DCHECK(condition)
Definition logging.h:103

◆ is_opaque()

bool flutter::DlColorColorSource::is_opaque ( ) const
inlineoverridevirtual

Implements flutter::DlColorSource.

Definition at line 194 of file dl_color_source.h.

194{ return color_.getAlpha() == 255; }
constexpr int getAlpha() const
Definition dl_color.h:38

◆ isUIThreadSafe()

bool flutter::DlColorColorSource::isUIThreadSafe ( ) const
inlineoverridevirtual

If the underlying platform data held by this object is held in a way that it can be stored and potentially released from the UI thread, this method returns true.

Returns
True if the class has no GPU related resources or if any that it holds are held in a thread-safe manner.

Implements flutter::DlColorSource.

Definition at line 183 of file dl_color_source.h.

183{ return true; }

◆ shared()

std::shared_ptr< DlColorSource > flutter::DlColorColorSource::shared ( ) const
inlineoverridevirtual

Implements flutter::DlAttribute< DlColorSource, DlColorSourceType >.

Definition at line 185 of file dl_color_source.h.

185 {
186 return std::make_shared<DlColorColorSource>(color_);
187 }

◆ size()

size_t flutter::DlColorColorSource::size ( ) const
inlineoverridevirtual

Implements flutter::DlAttribute< DlColorSource, DlColorSourceType >.

Definition at line 192 of file dl_color_source.h.

192{ return sizeof(*this); }

◆ type()

DlColorSourceType flutter::DlColorColorSource::type ( ) const
inlineoverridevirtual

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