Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
flutter::DlImageColorSource Class Referencefinal

#include <dl_color_source.h>

Inheritance diagram for flutter::DlImageColorSource:
SkRefCnt flutter::DlMatrixColorSourceBase SkRefCntBase flutter::DlColorSource flutter::DlAttribute< DlColorSource, DlColorSourceType >

Public Member Functions

 DlImageColorSource (sk_sp< const DlImage > image, DlTileMode horizontal_tile_mode, DlTileMode vertical_tile_mode, DlImageSampling sampling=DlImageSampling::kLinear, const SkMatrix *matrix=nullptr)
 
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. More...
 
const DlImageColorSourceasImage () const override
 
std::shared_ptr< DlColorSourceshared () const override
 
std::shared_ptr< DlColorSourcewith_sampling (DlImageSampling sampling) const
 
DlColorSourceType type () const override
 
size_t size () const override
 
bool is_opaque () const override
 
sk_sp< const DlImageimage () const
 
DlTileMode horizontal_tile_mode () const
 
DlTileMode vertical_tile_mode () const
 
DlImageSampling sampling () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
- Public Member Functions inherited from flutter::DlMatrixColorSourceBase
const SkMatrixmatrix () const
 
const SkMatrixmatrix_ptr () const
 
- Public Member Functions inherited from flutter::DlColorSource
virtual bool is_opaque () const =0
 
virtual bool isUIThreadSafe () const =0
 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. More...
 
virtual bool isGradient () const
 If the underlying platform data represents a gradient. More...
 
virtual const DlColorColorSourceasColor () const
 
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 >
virtual DlColorSourceType type () const=0
 
virtual size_t size () const=0
 
virtual std::shared_ptr< DlColorSourceshared () const=0
 
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::DlMatrixColorSourceBase
 DlMatrixColorSourceBase (const SkMatrix *matrix)
 
- Protected Member Functions inherited from flutter::DlColorSource
 DlColorSource ()=default
 
virtual bool equals_ (DlColorSource const &other) const=0
 

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 226 of file dl_color_source.h.

Constructor & Destructor Documentation

◆ DlImageColorSource()

flutter::DlImageColorSource::DlImageColorSource ( sk_sp< const DlImage image,
DlTileMode  horizontal_tile_mode,
DlTileMode  vertical_tile_mode,
DlImageSampling  sampling = DlImageSampling::kLinear,
const SkMatrix matrix = nullptr 
)
inline

Definition at line 229 of file dl_color_source.h.

235 image_(std::move(image)),
236 horizontal_tile_mode_(horizontal_tile_mode),
237 vertical_tile_mode_(vertical_tile_mode),
238 sampling_(sampling) {}
DlImageSampling sampling() const
DlTileMode vertical_tile_mode() const
DlTileMode horizontal_tile_mode() const
sk_sp< const DlImage > image() const
const SkMatrix & matrix() const
DlMatrixColorSourceBase(const SkMatrix *matrix)

Member Function Documentation

◆ asImage()

const DlImageColorSource * flutter::DlImageColorSource::asImage ( ) const
inlineoverridevirtual

Reimplemented from flutter::DlColorSource.

Definition at line 244 of file dl_color_source.h.

244{ return this; }

◆ equals_()

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

Implements flutter::DlAttribute< DlColorSource, DlColorSourceType >.

Definition at line 267 of file dl_color_source.h.

267 {
268 FML_DCHECK(other.type() == DlColorSourceType::kImage);
269 auto that = static_cast<DlImageColorSource const*>(&other);
270 return (image_->Equals(that->image_) && matrix() == that->matrix() &&
271 horizontal_tile_mode_ == that->horizontal_tile_mode_ &&
272 vertical_tile_mode_ == that->vertical_tile_mode_ &&
273 sampling_ == that->sampling_);
274 }
DlImageColorSource(sk_sp< const DlImage > image, DlTileMode horizontal_tile_mode, DlTileMode vertical_tile_mode, DlImageSampling sampling=DlImageSampling::kLinear, const SkMatrix *matrix=nullptr)
#define FML_DCHECK(condition)
Definition: logging.h:103

◆ horizontal_tile_mode()

DlTileMode flutter::DlImageColorSource::horizontal_tile_mode ( ) const
inline

Definition at line 262 of file dl_color_source.h.

262{ return horizontal_tile_mode_; }

◆ image()

sk_sp< const DlImage > flutter::DlImageColorSource::image ( ) const
inline

Definition at line 261 of file dl_color_source.h.

261{ return image_; }

◆ is_opaque()

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

Implements flutter::DlColorSource.

Definition at line 259 of file dl_color_source.h.

259{ return image_->isOpaque(); }

◆ isUIThreadSafe()

bool flutter::DlImageColorSource::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 240 of file dl_color_source.h.

240 {
241 return image_ ? image_->isUIThreadSafe() : true;
242 }

◆ sampling()

DlImageSampling flutter::DlImageColorSource::sampling ( ) const
inline

Definition at line 264 of file dl_color_source.h.

264{ return sampling_; }

◆ shared()

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

Implements flutter::DlAttribute< DlColorSource, DlColorSourceType >.

Definition at line 246 of file dl_color_source.h.

246 {
247 return with_sampling(sampling_);
248 }
std::shared_ptr< DlColorSource > with_sampling(DlImageSampling sampling) const

◆ size()

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

Implements flutter::DlAttribute< DlColorSource, DlColorSourceType >.

Definition at line 257 of file dl_color_source.h.

257{ return sizeof(*this); }

◆ type()

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

◆ vertical_tile_mode()

DlTileMode flutter::DlImageColorSource::vertical_tile_mode ( ) const
inline

Definition at line 263 of file dl_color_source.h.

263{ return vertical_tile_mode_; }

◆ with_sampling()

std::shared_ptr< DlColorSource > flutter::DlImageColorSource::with_sampling ( DlImageSampling  sampling) const
inline

Definition at line 250 of file dl_color_source.h.

250 {
251 return std::make_shared<DlImageColorSource>(image_, horizontal_tile_mode_,
252 vertical_tile_mode_, sampling,
253 matrix_ptr());
254 }
const SkMatrix * matrix_ptr() const

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