Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Attributes | List of all members
flutter::DlPaint Class Reference

#include <dl_paint.h>

Public Member Functions

 DlPaint ()
 
 DlPaint (DlColor color)
 
bool isAntiAlias () const
 
DlPaintsetAntiAlias (bool isAntiAlias)
 
bool isInvertColors () const
 
DlPaintsetInvertColors (bool isInvertColors)
 
DlColor getColor () const
 
DlPaintsetColor (DlColor color)
 
uint8_t getAlpha () const
 
DlPaintsetAlpha (uint8_t alpha)
 
SkScalar getOpacity () const
 
DlPaintsetOpacity (SkScalar opacity)
 
DlBlendMode getBlendMode () const
 
DlPaintsetBlendMode (DlBlendMode mode)
 
DlDrawStyle getDrawStyle () const
 
DlPaintsetDrawStyle (DlDrawStyle style)
 
DlStrokeCap getStrokeCap () const
 
DlPaintsetStrokeCap (DlStrokeCap cap)
 
DlStrokeJoin getStrokeJoin () const
 
DlPaintsetStrokeJoin (DlStrokeJoin join)
 
float getStrokeWidth () const
 
DlPaintsetStrokeWidth (float width)
 
float getStrokeMiter () const
 
DlPaintsetStrokeMiter (float miter)
 
std::shared_ptr< const DlColorSourcegetColorSource () const
 
const DlColorSourcegetColorSourcePtr () const
 
DlPaintsetColorSource (std::shared_ptr< const DlColorSource > source)
 
DlPaintsetColorSource (const DlColorSource *source)
 
std::shared_ptr< const DlColorFiltergetColorFilter () const
 
const DlColorFiltergetColorFilterPtr () const
 
DlPaintsetColorFilter (const std::shared_ptr< const DlColorFilter > &filter)
 
DlPaintsetColorFilter (const DlColorFilter *filter)
 
std::shared_ptr< const DlImageFiltergetImageFilter () const
 
const DlImageFiltergetImageFilterPtr () const
 
DlPaintsetImageFilter (const std::shared_ptr< const DlImageFilter > &filter)
 
DlPaintsetImageFilter (const DlImageFilter *filter)
 
std::shared_ptr< const DlMaskFiltergetMaskFilter () const
 
const DlMaskFiltergetMaskFilterPtr () const
 
DlPaintsetMaskFilter (const std::shared_ptr< DlMaskFilter > &filter)
 
DlPaintsetMaskFilter (const DlMaskFilter *filter)
 
bool isDefault () const
 
bool operator== (DlPaint const &other) const
 
bool operator!= (DlPaint const &other) const
 

Static Public Attributes

static constexpr DlColor kDefaultColor = DlColor::kBlack()
 
static constexpr float kDefaultWidth = 0.0
 
static constexpr float kDefaultMiter = 4.0
 
static const DlPaint kDefault
 

Detailed Description

Definition at line 46 of file dl_paint.h.

Constructor & Destructor Documentation

◆ DlPaint() [1/2]

flutter::DlPaint::DlPaint ( )
inline

Definition at line 54 of file dl_paint.h.

static constexpr DlColor kBlack()
Definition: dl_color.h:22

◆ DlPaint() [2/2]

flutter::DlPaint::DlPaint ( DlColor  color)
explicit

Definition at line 9 of file dl_paint.cc.

10 : blend_mode_(static_cast<unsigned>(DlBlendMode::kDefaultMode)),
11 draw_style_(static_cast<unsigned>(DlDrawStyle::kDefaultStyle)),
12 stroke_cap_(static_cast<unsigned>(DlStrokeCap::kDefaultCap)),
13 stroke_join_(static_cast<unsigned>(DlStrokeJoin::kDefaultJoin)),
14 is_anti_alias_(false),
15 is_invert_colors_(false),
16 color_(color),
17 stroke_width_(kDefaultWidth),
18 stroke_miter_(kDefaultMiter) {}
static constexpr float kDefaultWidth
Definition: dl_paint.h:49
unsigned is_anti_alias_
Definition: dl_paint.h:204
unsigned stroke_cap_
Definition: dl_paint.h:202
unsigned is_invert_colors_
Definition: dl_paint.h:205
unsigned draw_style_
Definition: dl_paint.h:201
unsigned blend_mode_
Definition: dl_paint.h:200
static constexpr float kDefaultMiter
Definition: dl_paint.h:50
unsigned stroke_join_
Definition: dl_paint.h:203
DlColor color

Member Function Documentation

◆ getAlpha()

uint8_t flutter::DlPaint::getAlpha ( ) const
inline

Definition at line 75 of file dl_paint.h.

75{ return color_.argb() >> 24; }
constexpr uint32_t argb() const
Definition: dl_color.h:82

◆ getBlendMode()

DlBlendMode flutter::DlPaint::getBlendMode ( ) const
inline

Definition at line 83 of file dl_paint.h.

83 {
84 return static_cast<DlBlendMode>(blend_mode_);
85 }

◆ getColor()

DlColor flutter::DlPaint::getColor ( ) const
inline

Definition at line 69 of file dl_paint.h.

69{ return color_; }

◆ getColorFilter()

std::shared_ptr< const DlColorFilter > flutter::DlPaint::getColorFilter ( ) const
inline

Definition at line 140 of file dl_paint.h.

140 {
141 return color_filter_;
142 }

◆ getColorFilterPtr()

const DlColorFilter * flutter::DlPaint::getColorFilterPtr ( ) const
inline

Definition at line 143 of file dl_paint.h.

143{ return color_filter_.get(); }

◆ getColorSource()

std::shared_ptr< const DlColorSource > flutter::DlPaint::getColorSource ( ) const
inline

Definition at line 127 of file dl_paint.h.

127 {
128 return color_source_;
129 }

◆ getColorSourcePtr()

const DlColorSource * flutter::DlPaint::getColorSourcePtr ( ) const
inline

Definition at line 130 of file dl_paint.h.

130{ return color_source_.get(); }

◆ getDrawStyle()

DlDrawStyle flutter::DlPaint::getDrawStyle ( ) const
inline

Definition at line 91 of file dl_paint.h.

91 {
92 return static_cast<DlDrawStyle>(draw_style_);
93 }
DlDrawStyle
Definition: dl_paint.h:19

◆ getImageFilter()

std::shared_ptr< const DlImageFilter > flutter::DlPaint::getImageFilter ( ) const
inline

Definition at line 153 of file dl_paint.h.

153 {
154 return image_filter_;
155 }

◆ getImageFilterPtr()

const DlImageFilter * flutter::DlPaint::getImageFilterPtr ( ) const
inline

Definition at line 156 of file dl_paint.h.

156{ return image_filter_.get(); }

◆ getMaskFilter()

std::shared_ptr< const DlMaskFilter > flutter::DlPaint::getMaskFilter ( ) const
inline

Definition at line 166 of file dl_paint.h.

166 {
167 return mask_filter_;
168 }

◆ getMaskFilterPtr()

const DlMaskFilter * flutter::DlPaint::getMaskFilterPtr ( ) const
inline

Definition at line 169 of file dl_paint.h.

169{ return mask_filter_.get(); }

◆ getOpacity()

SkScalar flutter::DlPaint::getOpacity ( ) const
inline

Definition at line 77 of file dl_paint.h.

77{ return color_.getAlphaF(); }
constexpr float getAlphaF() const
Definition: dl_color.h:47

◆ getStrokeCap()

DlStrokeCap flutter::DlPaint::getStrokeCap ( ) const
inline

Definition at line 99 of file dl_paint.h.

99 {
100 return static_cast<DlStrokeCap>(stroke_cap_);
101 }
DlStrokeCap
Definition: dl_paint.h:28

◆ getStrokeJoin()

DlStrokeJoin flutter::DlPaint::getStrokeJoin ( ) const
inline

Definition at line 107 of file dl_paint.h.

107 {
108 return static_cast<DlStrokeJoin>(stroke_join_);
109 }
DlStrokeJoin
Definition: dl_paint.h:37

◆ getStrokeMiter()

float flutter::DlPaint::getStrokeMiter ( ) const
inline

Definition at line 121 of file dl_paint.h.

121{ return stroke_miter_; }

◆ getStrokeWidth()

float flutter::DlPaint::getStrokeWidth ( ) const
inline

Definition at line 115 of file dl_paint.h.

115{ return stroke_width_; }

◆ isAntiAlias()

bool flutter::DlPaint::isAntiAlias ( ) const
inline

Definition at line 57 of file dl_paint.h.

57{ return is_anti_alias_; }

◆ isDefault()

bool flutter::DlPaint::isDefault ( ) const
inline

Definition at line 179 of file dl_paint.h.

179{ return *this == kDefault; }
static const DlPaint kDefault
Definition: dl_paint.h:52

◆ isInvertColors()

bool flutter::DlPaint::isInvertColors ( ) const
inline

Definition at line 63 of file dl_paint.h.

63{ return is_invert_colors_; }

◆ operator!=()

bool flutter::DlPaint::operator!= ( DlPaint const &  other) const
inline

Definition at line 182 of file dl_paint.h.

182{ return !(*this == other); }

◆ operator==()

bool flutter::DlPaint::operator== ( DlPaint const &  other) const

Definition at line 20 of file dl_paint.cc.

20 {
21 return blend_mode_ == other.blend_mode_ && //
22 draw_style_ == other.draw_style_ && //
23 stroke_cap_ == other.stroke_cap_ && //
24 stroke_join_ == other.stroke_join_ && //
25 is_anti_alias_ == other.is_anti_alias_ && //
26 is_invert_colors_ == other.is_invert_colors_ && //
27 color_ == other.color_ && //
28 stroke_width_ == other.stroke_width_ && //
29 stroke_miter_ == other.stroke_miter_ && //
30 Equals(color_source_, other.color_source_) && //
31 Equals(color_filter_, other.color_filter_) && //
32 Equals(image_filter_, other.image_filter_) && //
33 Equals(mask_filter_, other.mask_filter_);
34}
bool Equals(const T *a, const T *b)
Definition: dl_comparable.h:19

◆ setAlpha()

DlPaint & flutter::DlPaint::setAlpha ( uint8_t  alpha)
inline

Definition at line 76 of file dl_paint.h.

76{ return setColor(color_.withAlpha(alpha)); }
DlPaint & setColor(DlColor color)
Definition: dl_paint.h:70
constexpr DlColor withAlpha(uint8_t alpha) const
Definition: dl_color.h:63

◆ setAntiAlias()

DlPaint & flutter::DlPaint::setAntiAlias ( bool  isAntiAlias)
inline

Definition at line 58 of file dl_paint.h.

58 {
60 return *this;
61 }
bool isAntiAlias() const
Definition: dl_paint.h:57

◆ setBlendMode()

DlPaint & flutter::DlPaint::setBlendMode ( DlBlendMode  mode)
inline

Definition at line 86 of file dl_paint.h.

86 {
87 blend_mode_ = static_cast<unsigned>(mode);
88 return *this;
89 }
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228

◆ setColor()

DlPaint & flutter::DlPaint::setColor ( DlColor  color)
inline

Definition at line 70 of file dl_paint.h.

70 {
71 color_ = color;
72 return *this;
73 }

◆ setColorFilter() [1/2]

DlPaint & flutter::DlPaint::setColorFilter ( const DlColorFilter filter)
inline

Definition at line 148 of file dl_paint.h.

148 {
149 color_filter_ = filter ? filter->shared() : nullptr;
150 return *this;
151 }

◆ setColorFilter() [2/2]

DlPaint & flutter::DlPaint::setColorFilter ( const std::shared_ptr< const DlColorFilter > &  filter)
inline

Definition at line 144 of file dl_paint.h.

144 {
145 color_filter_ = filter;
146 return *this;
147 }

◆ setColorSource() [1/2]

DlPaint & flutter::DlPaint::setColorSource ( const DlColorSource source)
inline

Definition at line 135 of file dl_paint.h.

135 {
136 color_source_ = source ? source->shared() : nullptr;
137 return *this;
138 }
SkBitmap source
Definition: examples.cpp:28

◆ setColorSource() [2/2]

DlPaint & flutter::DlPaint::setColorSource ( std::shared_ptr< const DlColorSource source)
inline

Definition at line 131 of file dl_paint.h.

131 {
132 color_source_ = std::move(source);
133 return *this;
134 }

◆ setDrawStyle()

DlPaint & flutter::DlPaint::setDrawStyle ( DlDrawStyle  style)
inline

Definition at line 94 of file dl_paint.h.

94 {
95 draw_style_ = static_cast<unsigned>(style);
96 return *this;
97 }

◆ setImageFilter() [1/2]

DlPaint & flutter::DlPaint::setImageFilter ( const DlImageFilter filter)
inline

Definition at line 161 of file dl_paint.h.

161 {
162 image_filter_ = filter ? filter->shared() : nullptr;
163 return *this;
164 }

◆ setImageFilter() [2/2]

DlPaint & flutter::DlPaint::setImageFilter ( const std::shared_ptr< const DlImageFilter > &  filter)
inline

Definition at line 157 of file dl_paint.h.

157 {
158 image_filter_ = filter;
159 return *this;
160 }

◆ setInvertColors()

DlPaint & flutter::DlPaint::setInvertColors ( bool  isInvertColors)
inline

Definition at line 64 of file dl_paint.h.

64 {
66 return *this;
67 }
bool isInvertColors() const
Definition: dl_paint.h:63

◆ setMaskFilter() [1/2]

DlPaint & flutter::DlPaint::setMaskFilter ( const DlMaskFilter filter)
inline

Definition at line 174 of file dl_paint.h.

174 {
175 mask_filter_ = filter ? filter->shared() : nullptr;
176 return *this;
177 }

◆ setMaskFilter() [2/2]

DlPaint & flutter::DlPaint::setMaskFilter ( const std::shared_ptr< DlMaskFilter > &  filter)
inline

Definition at line 170 of file dl_paint.h.

170 {
171 mask_filter_ = filter;
172 return *this;
173 }

◆ setOpacity()

DlPaint & flutter::DlPaint::setOpacity ( SkScalar  opacity)
inline

Definition at line 78 of file dl_paint.h.

78 {
79 setAlpha(SkScalarRoundToInt(opacity * 0xff));
80 return *this;
81 }
#define SkScalarRoundToInt(x)
Definition: SkScalar.h:37
DlPaint & setAlpha(uint8_t alpha)
Definition: dl_paint.h:76

◆ setStrokeCap()

DlPaint & flutter::DlPaint::setStrokeCap ( DlStrokeCap  cap)
inline

Definition at line 102 of file dl_paint.h.

102 {
103 stroke_cap_ = static_cast<unsigned>(cap);
104 return *this;
105 }

◆ setStrokeJoin()

DlPaint & flutter::DlPaint::setStrokeJoin ( DlStrokeJoin  join)
inline

Definition at line 110 of file dl_paint.h.

110 {
111 stroke_join_ = static_cast<unsigned>(join);
112 return *this;
113 }
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741

◆ setStrokeMiter()

DlPaint & flutter::DlPaint::setStrokeMiter ( float  miter)
inline

Definition at line 122 of file dl_paint.h.

122 {
123 stroke_miter_ = miter;
124 return *this;
125 }

◆ setStrokeWidth()

DlPaint & flutter::DlPaint::setStrokeWidth ( float  width)
inline

Definition at line 116 of file dl_paint.h.

116 {
117 stroke_width_ = width;
118 return *this;
119 }
int32_t width

Member Data Documentation

◆ blend_mode_

unsigned flutter::DlPaint::blend_mode_

Definition at line 200 of file dl_paint.h.

◆ draw_style_

unsigned flutter::DlPaint::draw_style_

Definition at line 201 of file dl_paint.h.

◆ is_anti_alias_

unsigned flutter::DlPaint::is_anti_alias_

Definition at line 204 of file dl_paint.h.

◆ is_invert_colors_

unsigned flutter::DlPaint::is_invert_colors_

Definition at line 205 of file dl_paint.h.

◆ kDefault

const DlPaint flutter::DlPaint::kDefault
static

Definition at line 52 of file dl_paint.h.

◆ kDefaultColor

constexpr DlColor flutter::DlPaint::kDefaultColor = DlColor::kBlack()
staticconstexpr

Definition at line 48 of file dl_paint.h.

◆ kDefaultMiter

constexpr float flutter::DlPaint::kDefaultMiter = 4.0
staticconstexpr

Definition at line 50 of file dl_paint.h.

◆ kDefaultWidth

constexpr float flutter::DlPaint::kDefaultWidth = 0.0
staticconstexpr

Definition at line 49 of file dl_paint.h.

◆ stroke_cap_

unsigned flutter::DlPaint::stroke_cap_

Definition at line 202 of file dl_paint.h.

◆ stroke_join_

unsigned flutter::DlPaint::stroke_join_

Definition at line 203 of file dl_paint.h.


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