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

#include <dl_color_source.h>

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

Public Member Functions

 DlRuntimeEffectColorSource (sk_sp< DlRuntimeEffect > runtime_effect, std::vector< std::shared_ptr< DlColorSource > > samplers, std::shared_ptr< std::vector< uint8_t > > uniform_data)
 
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 DlRuntimeEffectColorSourceasRuntimeEffect () const override
 
std::shared_ptr< DlColorSourceshared () const override
 
DlColorSourceType type () const override
 
size_t size () const override
 
bool is_opaque () const override
 
const sk_sp< DlRuntimeEffectruntime_effect () const
 
const std::vector< std::shared_ptr< DlColorSource > > samplers () const
 
const std::shared_ptr< std::vector< uint8_t > > uniform_data () 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::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 636 of file dl_color_source.h.

Constructor & Destructor Documentation

◆ DlRuntimeEffectColorSource()

flutter::DlRuntimeEffectColorSource::DlRuntimeEffectColorSource ( sk_sp< DlRuntimeEffect runtime_effect,
std::vector< std::shared_ptr< DlColorSource > >  samplers,
std::shared_ptr< std::vector< uint8_t > >  uniform_data 
)
inline

Definition at line 638 of file dl_color_source.h.

642 : runtime_effect_(std::move(runtime_effect)),
643 samplers_(std::move(samplers)),
644 uniform_data_(std::move(uniform_data)) {}
const std::shared_ptr< std::vector< uint8_t > > uniform_data() const
const sk_sp< DlRuntimeEffect > runtime_effect() const
const std::vector< std::shared_ptr< DlColorSource > > samplers() const

Member Function Documentation

◆ asRuntimeEffect()

const DlRuntimeEffectColorSource * flutter::DlRuntimeEffectColorSource::asRuntimeEffect ( ) const
inlineoverridevirtual

Reimplemented from flutter::DlColorSource.

Definition at line 655 of file dl_color_source.h.

655 {
656 return this;
657 }

◆ equals_()

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

Implements flutter::DlAttribute< DlColorSource, DlColorSourceType >.

Definition at line 682 of file dl_color_source.h.

682 {
684 auto that = static_cast<DlRuntimeEffectColorSource const*>(&other);
685 if (runtime_effect_ != that->runtime_effect_) {
686 return false;
687 }
688 if (uniform_data_ != that->uniform_data_) {
689 return false;
690 }
691 if (samplers_.size() != that->samplers_.size()) {
692 return false;
693 }
694 for (size_t i = 0; i < samplers_.size(); i++) {
695 if (samplers_[i] != that->samplers_[i]) {
696 return false;
697 }
698 }
699 return true;
700 }
DlRuntimeEffectColorSource(sk_sp< DlRuntimeEffect > runtime_effect, std::vector< std::shared_ptr< DlColorSource > > samplers, std::shared_ptr< std::vector< uint8_t > > uniform_data)
#define FML_DCHECK(condition)
Definition: logging.h:103

◆ is_opaque()

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

Implements flutter::DlColorSource.

Definition at line 669 of file dl_color_source.h.

669{ return false; }

◆ isUIThreadSafe()

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

646 {
647 for (const auto& sampler : samplers_) {
648 if (!sampler->isUIThreadSafe()) {
649 return false;
650 }
651 }
652 return true;
653 }

◆ runtime_effect()

const sk_sp< DlRuntimeEffect > flutter::DlRuntimeEffectColorSource::runtime_effect ( ) const
inline

Definition at line 671 of file dl_color_source.h.

671 {
672 return runtime_effect_;
673 }

◆ samplers()

const std::vector< std::shared_ptr< DlColorSource > > flutter::DlRuntimeEffectColorSource::samplers ( ) const
inline

Definition at line 674 of file dl_color_source.h.

674 {
675 return samplers_;
676 }

◆ shared()

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

Implements flutter::DlAttribute< DlColorSource, DlColorSourceType >.

Definition at line 659 of file dl_color_source.h.

659 {
660 return std::make_shared<DlRuntimeEffectColorSource>(
661 runtime_effect_, samplers_, uniform_data_);
662 }

◆ size()

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

Implements flutter::DlAttribute< DlColorSource, DlColorSourceType >.

Definition at line 667 of file dl_color_source.h.

667{ return sizeof(*this); }

◆ type()

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

◆ uniform_data()

const std::shared_ptr< std::vector< uint8_t > > flutter::DlRuntimeEffectColorSource::uniform_data ( ) const
inline

Definition at line 677 of file dl_color_source.h.

677 {
678 return uniform_data_;
679 }

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