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

#include <color_filter.h>

Inheritance diagram for flutter::ColorFilter:
flutter::RefCountedDartWrappable< ColorFilter > fml::RefCountedThreadSafe< T > tonic::DartWrappable fml::internal::RefCountedThreadSafeBase

Public Member Functions

void initMode (int color, int blend_mode)
 
void initMatrix (const tonic::Float32List &color_matrix)
 
void initSrgbToLinearGamma ()
 
void initLinearToSrgbGamma ()
 
 ~ColorFilter () override
 
const std::shared_ptr< const DlColorFilterfilter () const
 
- Public Member Functions inherited from flutter::RefCountedDartWrappable< ColorFilter >
virtual void RetainDartWrappableReference () const override
 
virtual void ReleaseDartWrappableReference () const override
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< T >
void Release () const
 
- Public Member Functions inherited from fml::internal::RefCountedThreadSafeBase
void AddRef () const
 
bool HasOneRef () const
 
void AssertHasOneRef () const
 
- Public Member Functions inherited from tonic::DartWrappable
 DartWrappable ()
 
virtual const DartWrapperInfoGetDartWrapperInfo () const =0
 
Dart_Handle CreateDartWrapper (DartState *dart_state)
 
void AssociateWithDartWrapper (Dart_Handle wrappable)
 
void ClearDartWrapper ()
 
Dart_WeakPersistentHandle dart_wrapper () const
 

Static Public Member Functions

static void Create (Dart_Handle wrapper)
 

Additional Inherited Members

- Public Types inherited from tonic::DartWrappable
enum  DartNativeFields { kPeerIndex , kNumberOfNativeFields }
 
- Protected Member Functions inherited from fml::RefCountedThreadSafe< T >
 RefCountedThreadSafe ()
 
 ~RefCountedThreadSafe ()
 
- Protected Member Functions inherited from fml::internal::RefCountedThreadSafeBase
 RefCountedThreadSafeBase ()
 
 ~RefCountedThreadSafeBase ()
 
bool Release () const
 
void Adopt ()
 
- Protected Member Functions inherited from tonic::DartWrappable
virtual ~DartWrappable ()
 
- Static Protected Member Functions inherited from tonic::DartWrappable
static Dart_PersistentHandle GetTypeForWrapper (tonic::DartState *dart_state, const tonic::DartWrapperInfo &wrapper_info)
 

Detailed Description

Definition at line 17 of file color_filter.h.

Constructor & Destructor Documentation

◆ ~ColorFilter()

flutter::ColorFilter::~ColorFilter ( )
overridedefault

Member Function Documentation

◆ Create()

void flutter::ColorFilter::Create ( Dart_Handle  wrapper)
static

Definition at line 19 of file color_filter.cc.

19 {
21 auto res = fml::MakeRefCounted<ColorFilter>();
22 res->AssociateWithDartWrapper(wrapper);
23}
static void ThrowIfUIOperationsProhibited()

◆ filter()

const std::shared_ptr< const DlColorFilter > flutter::ColorFilter::filter ( ) const
inline

Definition at line 31 of file color_filter.h.

31{ return filter_; }

◆ initLinearToSrgbGamma()

void flutter::ColorFilter::initLinearToSrgbGamma ( )

Definition at line 45 of file color_filter.cc.

45 {
47}
static const std::shared_ptr< DlLinearToSrgbGammaColorFilter > kInstance

◆ initMatrix()

void flutter::ColorFilter::initMatrix ( const tonic::Float32List &  color_matrix)

Definition at line 30 of file color_filter.cc.

30 {
31 FML_CHECK(color_matrix.num_elements() == 20);
32
33 // Flutter still defines the matrix to be biased by 255 in the last column
34 // (translate). skia is normalized, treating the last column as 0...1, so we
35 // post-scale here before calling the skia factory.
36 float matrix[20];
37 memcpy(matrix, color_matrix.data(), sizeof(matrix));
38 matrix[4] *= 1.0f / 255;
39 matrix[9] *= 1.0f / 255;
40 matrix[14] *= 1.0f / 255;
41 matrix[19] *= 1.0f / 255;
42 filter_ = DlMatrixColorFilter::Make(matrix);
43}
static std::shared_ptr< DlColorFilter > Make(const float matrix[20])
#define FML_CHECK(condition)
Definition logging.h:85
unsigned useCenter Optional< SkMatrix > matrix
Definition SkRecords.h:258

◆ initMode()

void flutter::ColorFilter::initMode ( int  color,
int  blend_mode 
)

Definition at line 25 of file color_filter.cc.

25 {
26 filter_ = DlBlendColorFilter::Make(static_cast<DlColor>(color),
27 static_cast<DlBlendMode>(blend_mode));
28}
SkColor4f color
static std::shared_ptr< DlColorFilter > Make(DlColor color, DlBlendMode mode)

◆ initSrgbToLinearGamma()

void flutter::ColorFilter::initSrgbToLinearGamma ( )

Definition at line 49 of file color_filter.cc.

49 {
51}
static const std::shared_ptr< DlSrgbToLinearGammaColorFilter > kInstance

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