5#ifndef FLUTTER_DISPLAY_LIST_DL_PAINT_H_
6#define FLUTTER_DISPLAY_LIST_DL_PAINT_H_
10#include "flutter/display_list/dl_blend_mode.h"
11#include "flutter/display_list/dl_color.h"
12#include "flutter/display_list/effects/dl_color_filter.h"
13#include "flutter/display_list/effects/dl_color_source.h"
14#include "flutter/display_list/effects/dl_image_filter.h"
15#include "flutter/display_list/effects/dl_mask_filter.h"
117 stroke_width_ =
width;
123 stroke_miter_ = miter;
128 return color_source_;
132 color_source_ = std::move(
source);
141 return color_filter_;
145 color_filter_ = filter;
149 color_filter_ = filter ? filter->
shared() :
nullptr;
154 return image_filter_;
158 image_filter_ = filter;
162 image_filter_ = filter ? filter->
shared() :
nullptr;
171 mask_filter_ = filter;
175 mask_filter_ = filter ? filter->
shared() :
nullptr;
185#define ASSERT_ENUM_FITS(last_enum, num_bits) \
186 static_assert(static_cast<int>(last_enum) < (1 << num_bits) && \
187 static_cast<int>(last_enum) * 2 >= (1 << num_bits))
189 static constexpr int kBlendModeBits = 5;
190 static constexpr int kDrawStyleBits = 2;
191 static constexpr int kStrokeCapBits = 2;
192 static constexpr int kStrokeJoinBits = 2;
213 std::shared_ptr<const DlColorSource> color_source_;
214 std::shared_ptr<const DlColorFilter> color_filter_;
215 std::shared_ptr<const DlImageFilter> image_filter_;
216 std::shared_ptr<const DlMaskFilter> mask_filter_;
#define SkScalarRoundToInt(x)
virtual std::shared_ptr< D > shared() const =0
bool operator==(DlPaint const &other) const
DlStrokeCap getStrokeCap() const
DlPaint & setColor(DlColor color)
DlPaint & setAntiAlias(bool isAntiAlias)
static const DlPaint kDefault
DlPaint & setInvertColors(bool isInvertColors)
DlBlendMode getBlendMode() const
DlPaint & setColorFilter(const std::shared_ptr< const DlColorFilter > &filter)
static constexpr float kDefaultWidth
DlPaint & setMaskFilter(const std::shared_ptr< DlMaskFilter > &filter)
float getStrokeMiter() const
DlPaint & setImageFilter(const DlImageFilter *filter)
std::shared_ptr< const DlColorSource > getColorSource() const
DlStrokeJoin getStrokeJoin() const
SkScalar getOpacity() const
DlPaint & setMaskFilter(const DlMaskFilter *filter)
unsigned is_invert_colors_
const DlColorSource * getColorSourcePtr() const
DlPaint & setStrokeCap(DlStrokeCap cap)
const DlMaskFilter * getMaskFilterPtr() const
DlPaint & setStrokeWidth(float width)
DlPaint & setAlpha(uint8_t alpha)
const DlColorFilter * getColorFilterPtr() const
DlPaint & setStrokeMiter(float miter)
bool operator!=(DlPaint const &other) const
DlPaint & setBlendMode(DlBlendMode mode)
static constexpr float kDefaultMiter
const DlImageFilter * getImageFilterPtr() const
DlDrawStyle getDrawStyle() const
std::shared_ptr< const DlMaskFilter > getMaskFilter() const
std::shared_ptr< const DlColorFilter > getColorFilter() const
DlPaint & setImageFilter(const std::shared_ptr< const DlImageFilter > &filter)
DlPaint & setColorFilter(const DlColorFilter *filter)
float getStrokeWidth() const
DlPaint & setOpacity(SkScalar opacity)
std::shared_ptr< const DlImageFilter > getImageFilter() const
DlPaint & setDrawStyle(DlDrawStyle style)
static constexpr DlColor kDefaultColor
DlPaint & setStrokeJoin(DlStrokeJoin join)
DlPaint & setColorSource(std::shared_ptr< const DlColorSource > source)
DlPaint & setColorSource(const DlColorSource *source)
bool isInvertColors() const
constexpr SkColor4f kBlack
@ kMiter
extends to miter limit
@ kBevel
connects outside edges
@ kButt
no stroke extension
@ kStrokeAndFill
both strokes and fills shapes
@ kStroke
strokes boundary of shapes
@ kFill
fills interior of shapes
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
@ kLastMode
last valid value
static SkString join(const CommandLineFlags::StringArray &)
constexpr float getAlphaF() const
static constexpr DlColor kBlack()
constexpr DlColor withAlpha(uint8_t alpha) const
constexpr uint32_t argb() const