Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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)
 
std::shared_ptr< const DlPathEffectgetPathEffect () const
 
const DlPathEffectgetPathEffectPtr () const
 
DlPaintsetPathEffect (const std::shared_ptr< DlPathEffect > &pathEffect)
 
DlPaintsetPathEffect (const DlPathEffect *effect)
 
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 47 of file dl_paint.h.

Constructor & Destructor Documentation

◆ DlPaint() [1/2]

flutter::DlPaint::DlPaint ( )
inline

Definition at line 55 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) {}
SkColor4f color
static constexpr float kDefaultWidth
Definition dl_paint.h:50
unsigned is_anti_alias_
Definition dl_paint.h:218
unsigned stroke_cap_
Definition dl_paint.h:216
unsigned is_invert_colors_
Definition dl_paint.h:219
unsigned draw_style_
Definition dl_paint.h:215
unsigned blend_mode_
Definition dl_paint.h:214
static constexpr float kDefaultMiter
Definition dl_paint.h:51
unsigned stroke_join_
Definition dl_paint.h:217

Member Function Documentation

◆ getAlpha()

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

Definition at line 76 of file dl_paint.h.

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

◆ getBlendMode()

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

Definition at line 84 of file dl_paint.h.

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

◆ getColor()

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

Definition at line 70 of file dl_paint.h.

70{ return color_; }

◆ getColorFilter()

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

Definition at line 141 of file dl_paint.h.

141 {
142 return color_filter_;
143 }

◆ getColorFilterPtr()

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

Definition at line 144 of file dl_paint.h.

144{ return color_filter_.get(); }

◆ getColorSource()

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

Definition at line 128 of file dl_paint.h.

128 {
129 return color_source_;
130 }

◆ getColorSourcePtr()

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

Definition at line 131 of file dl_paint.h.

131{ return color_source_.get(); }

◆ getDrawStyle()

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

Definition at line 92 of file dl_paint.h.

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

◆ getImageFilter()

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

Definition at line 154 of file dl_paint.h.

154 {
155 return image_filter_;
156 }

◆ getImageFilterPtr()

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

Definition at line 157 of file dl_paint.h.

157{ return image_filter_.get(); }

◆ getMaskFilter()

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

Definition at line 167 of file dl_paint.h.

167 {
168 return mask_filter_;
169 }

◆ getMaskFilterPtr()

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

Definition at line 170 of file dl_paint.h.

170{ return mask_filter_.get(); }

◆ getOpacity()

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

Definition at line 78 of file dl_paint.h.

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

◆ getPathEffect()

std::shared_ptr< const DlPathEffect > flutter::DlPaint::getPathEffect ( ) const
inline

Definition at line 180 of file dl_paint.h.

180 {
181 return path_effect_;
182 }

◆ getPathEffectPtr()

const DlPathEffect * flutter::DlPaint::getPathEffectPtr ( ) const
inline

Definition at line 183 of file dl_paint.h.

183{ return path_effect_.get(); }

◆ getStrokeCap()

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

Definition at line 100 of file dl_paint.h.

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

◆ getStrokeJoin()

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

Definition at line 108 of file dl_paint.h.

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

◆ getStrokeMiter()

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

Definition at line 122 of file dl_paint.h.

122{ return stroke_miter_; }

◆ getStrokeWidth()

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

Definition at line 116 of file dl_paint.h.

116{ return stroke_width_; }

◆ isAntiAlias()

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

Definition at line 58 of file dl_paint.h.

58{ return is_anti_alias_; }

◆ isDefault()

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

Definition at line 193 of file dl_paint.h.

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

◆ isInvertColors()

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

Definition at line 64 of file dl_paint.h.

64{ return is_invert_colors_; }

◆ operator!=()

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

Definition at line 196 of file dl_paint.h.

196{ 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 Equals(path_effect_, other.path_effect_);
35}
bool Equals(const T *a, const T *b)

◆ setAlpha()

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

Definition at line 77 of file dl_paint.h.

77{ return setColor(color_.withAlpha(alpha)); }
DlPaint & setColor(DlColor color)
Definition dl_paint.h:71
constexpr DlColor withAlpha(uint8_t alpha) const
Definition dl_color.h:59

◆ setAntiAlias()

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

Definition at line 59 of file dl_paint.h.

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

◆ setBlendMode()

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

Definition at line 87 of file dl_paint.h.

87 {
88 blend_mode_ = static_cast<unsigned>(mode);
89 return *this;
90 }
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 71 of file dl_paint.h.

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

◆ setColorFilter() [1/2]

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

Definition at line 149 of file dl_paint.h.

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

◆ setColorFilter() [2/2]

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

Definition at line 145 of file dl_paint.h.

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

◆ setColorSource() [1/2]

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

Definition at line 136 of file dl_paint.h.

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

◆ setColorSource() [2/2]

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

Definition at line 132 of file dl_paint.h.

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

◆ setDrawStyle()

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

Definition at line 95 of file dl_paint.h.

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

◆ setImageFilter() [1/2]

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

Definition at line 162 of file dl_paint.h.

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

◆ setImageFilter() [2/2]

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

Definition at line 158 of file dl_paint.h.

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

◆ setInvertColors()

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

Definition at line 65 of file dl_paint.h.

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

◆ setMaskFilter() [1/2]

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

Definition at line 175 of file dl_paint.h.

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

◆ setMaskFilter() [2/2]

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

Definition at line 171 of file dl_paint.h.

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

◆ setOpacity()

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

Definition at line 79 of file dl_paint.h.

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

◆ setPathEffect() [1/2]

DlPaint & flutter::DlPaint::setPathEffect ( const DlPathEffect effect)
inline

Definition at line 188 of file dl_paint.h.

188 {
189 path_effect_ = effect ? effect->shared() : nullptr;
190 return *this;
191 }

◆ setPathEffect() [2/2]

DlPaint & flutter::DlPaint::setPathEffect ( const std::shared_ptr< DlPathEffect > &  pathEffect)
inline

Definition at line 184 of file dl_paint.h.

184 {
185 path_effect_ = pathEffect;
186 return *this;
187 }

◆ setStrokeCap()

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

Definition at line 103 of file dl_paint.h.

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

◆ setStrokeJoin()

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

Definition at line 111 of file dl_paint.h.

111 {
112 stroke_join_ = static_cast<unsigned>(join);
113 return *this;
114 }
SINT Vec< 2 *N, T > join(const Vec< N, T > &lo, const Vec< N, T > &hi)
Definition SkVx.h:242

◆ setStrokeMiter()

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

Definition at line 123 of file dl_paint.h.

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

◆ setStrokeWidth()

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

Definition at line 117 of file dl_paint.h.

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

Member Data Documentation

◆ blend_mode_

unsigned flutter::DlPaint::blend_mode_

Definition at line 214 of file dl_paint.h.

◆ draw_style_

unsigned flutter::DlPaint::draw_style_

Definition at line 215 of file dl_paint.h.

◆ is_anti_alias_

unsigned flutter::DlPaint::is_anti_alias_

Definition at line 218 of file dl_paint.h.

◆ is_invert_colors_

unsigned flutter::DlPaint::is_invert_colors_

Definition at line 219 of file dl_paint.h.

◆ kDefault

const DlPaint flutter::DlPaint::kDefault
static

Definition at line 53 of file dl_paint.h.

◆ kDefaultColor

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

Definition at line 49 of file dl_paint.h.

◆ kDefaultMiter

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

Definition at line 51 of file dl_paint.h.

◆ kDefaultWidth

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

Definition at line 50 of file dl_paint.h.

◆ stroke_cap_

unsigned flutter::DlPaint::stroke_cap_

Definition at line 216 of file dl_paint.h.

◆ stroke_join_

unsigned flutter::DlPaint::stroke_join_

Definition at line 217 of file dl_paint.h.


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