14#include "flutter/fml/logging.h"
15#include "flutter/fml/trace_event.h"
36#define UNIMPLEMENTED \
37 FML_DLOG(ERROR) << "Unimplemented detail in " << __FUNCTION__;
122 desc.label =
"Nearest Sampler";
129 desc.label =
"Linear Sampler";
134 desc.label =
"Mipmap Linear Sampler";
146 desc.label =
"Nearest Sampler";
150 desc.label =
"Linear Sampler";
243 auto result = std::vector<Color>();
244 if (colors ==
nullptr) {
247 for (
int i = 0; i <
count; i++) {
270#ifdef IMPELLER_ENABLE_3D
271 case flutter::DlColorSourceType::kScene:
286 if (!
type.has_value()) {
287 FML_LOG(
ERROR) <<
"Requested ColorSourceType::kUnknown";
292 switch (
type.value()) {
303 source->asLinearGradient();
307 std::vector<Color> colors;
308 std::vector<float> stops;
315 start_point, end_point, std::move(colors), std::move(stops),
321 source->asConicalGradient();
328 std::vector<Color> colors;
329 std::vector<float> stops;
336 center, radius, std::move(colors), std::move(stops), focus_center,
337 focus_radius, tile_mode, matrix);
342 source->asRadialGradient();
345 auto radius = radialGradient->
radius();
346 std::vector<Color> colors;
347 std::vector<float> stops;
354 std::move(stops), tile_mode, matrix);
359 source->asSweepGradient();
364 auto end_angle =
Degrees(sweepGradient->
end());
365 std::vector<Color> colors;
366 std::vector<float> stops;
372 center, start_angle, end_angle, std::move(colors), std::move(stops),
379 image_color_source->
image()->impeller_texture());
380 auto texture = image_color_source->
image()->impeller_texture();
386 y_tile_mode, desc, matrix);
391 source->asRuntimeEffect();
394 auto uniform_data = runtime_effect_color_source->
uniform_data();
395 auto samplers = runtime_effect_color_source->
samplers();
397 std::vector<RuntimeEffectContents::TextureInput> texture_inputs;
399 for (
auto& sampler : samplers) {
400 if (sampler ==
nullptr) {
403 auto*
image = sampler->asImage();
404 if (!sampler->asImage()) {
409 texture_inputs.push_back({
411 .texture =
image->image()->impeller_texture(),
416 runtime_stage, uniform_data, texture_inputs);
420#ifdef IMPELLER_ENABLE_3D
421 const flutter::DlSceneColorSource* scene_color_source =
source->asScene();
422 std::shared_ptr<scene::Node> scene_node =
423 scene_color_source->scene_node();
424 Matrix camera_transform = scene_color_source->camera_matrix();
427 ColorSource::MakeScene(scene_node, camera_transform);
429 FML_LOG(
ERROR) <<
"ColorSourceType::kScene can only be used if Impeller "
439 if (filter ==
nullptr) {
442 switch (filter->
type()) {
444 auto dl_blend = filter->
asBlend();
485 switch (blur_style) {
500 if (filter ==
nullptr) {
504 switch (filter->
type()) {
506 auto blur = filter->
asBlur();
510 .sigma =
Sigma(blur->sigma()),
519 if (filter ==
nullptr) {
523 switch (filter->
type()) {
525 auto blur = filter->
asBlur();
526 auto sigma_x =
Sigma(blur->sigma_x());
527 auto sigma_y =
Sigma(blur->sigma_y());
528 auto tile_mode =
ToTileMode(blur->tile_mode());
535 if (dilate->radius_x() < 0 || dilate->radius_y() < 0) {
538 auto radius_x =
Radius(dilate->radius_x());
539 auto radius_y =
Radius(dilate->radius_y());
543 auto erode = filter->
asErode();
545 if (erode->radius_x() < 0 || erode->radius_y() < 0) {
548 auto radius_x =
Radius(erode->radius_x());
549 auto radius_y =
Radius(erode->radius_y());
553 auto matrix_filter = filter->
asMatrix();
555 auto matrix =
ToMatrix(matrix_filter->matrix());
562 auto outer_dl_filter = compose->outer();
563 auto inner_dl_filter = compose->inner();
580 ToColorFilter(color_filter_image_filter->color_filter().get());
593 auto internal_filter = local_matrix_filter->image_filter();
601 auto matrix =
ToMatrix(local_matrix_filter->matrix());
620 uint32_t total_content_depth,
623 auto promise =
options.content_is_clipped()
733 }
else if (rrect.
isOval()) {
749const Path& DlDispatcherBase::GetOrCachePath(
const CacheablePath& cache) {
750 if (cache.cached_impeller_path.IsEmpty() && !cache.sk_path.isEmpty()) {
753 return cache.cached_impeller_path;
763 if (cache.sk_path.isRect(&rect)) {
765 }
else if (cache.sk_path.isOval(&rect)) {
769 if (cache.sk_path.isRRect(&rrect) && rrect.
isSimple()) {
840 SimplifyOrDrawPath(
GetCanvas(), cache, paint_);
843void DlDispatcherBase::SimplifyOrDrawPath(
CanvasType& canvas,
844 const CacheablePath& cache,
850 if (cache.sk_path.isRect(&rect, &closed) && closed) {
856 if (cache.sk_path.isRRect(&rrect) && rrect.
isSimple()) {
863 if (
cache.sk_path.isOval(&oval)) {
878 Degrees(sweep_degrees), use_center);
893 auto radius =
paint.stroke_width;
901 for (uint32_t i = 1; i <
count; i += 2) {
910 for (uint32_t i = 1; i <
count; i++) {
931 bool render_with_attributes) {
941 const auto size =
texture->GetSize();
950 render_with_attributes,
951 SrcRectConstraint::kStrict
961 bool render_with_attributes,
964 std::make_shared<Image>(
image->impeller_texture()),
967 render_with_attributes ? paint_ :
Paint(),
977 bool render_with_attributes) {
979 converter.DrawNinePatch(
980 std::make_shared<Image>(
image->impeller_texture()),
995 bool render_with_attributes) {
1009 Paint saved_paint = paint_;
1010 Matrix saved_initial_matrix = initial_matrix_;
1039 if (display_list->has_rtree() && !initial_matrix_.
HasPerspective()) {
1046 if (cull_bounds.has_value()) {
1047 Rect cull_rect = cull_bounds.value();
1048 display_list->Dispatch(
1052 display_list->Dispatch(*
this);
1055 display_list->Dispatch(*
this);
1061 initial_matrix_ = saved_initial_matrix;
1062 paint_ = saved_paint;
1075 const std::shared_ptr<TextFrame>& text_frame,
1088 bool transparent_occluder,
1097 bool transparent_occluder,
1100 spot_color.
alpha *= 0.25;
1105 std::max(std::max(spot_color.
red, spot_color.
green), spot_color.
blue);
1107 std::min(std::min(spot_color.
red, spot_color.
green), spot_color.
blue);
1111 (2.6f + (-2.66667f + 1.06667f * spot_color.
alpha) * spot_color.
alpha) *
1114 (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
1116 color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
1119 std::clamp(spot_color.
alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
1121 Scalar color_scale = color_alpha * (1 - greyscale_alpha);
1122 Scalar tonal_alpha = color_scale + greyscale_alpha;
1123 Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
1124 spot_color =
Color(unpremul_scale * spot_color.
red,
1125 unpremul_scale * spot_color.
green,
1126 unpremul_scale * spot_color.
blue, tonal_alpha);
1129 Vector3 light_position(0, -1, 1);
1130 Scalar occluder_z = dpr * elevation;
1132 constexpr Scalar kLightRadius = 800 / 600;
1136 paint.color = spot_color;
1139 .sigma =
Radius{kLightRadius * occluder_z /
1153 TRACE_EVENT0(
"impeller",
"DisplayListDispatcher::EndRecordingAsPicture");
1172 : canvas_(renderer, render_target, cull_rect) {}
1181 const Matrix& initial_matrix)
1182 : renderer_(renderer), matrix_(initial_matrix) {}
1185 stack_.emplace_back(matrix_);
1195 matrix_ = stack_.back();
1204 matrix_ = matrix_.
Scale({sx, sy, 1.0f});
1220 mxx, myx, 0.0f, 0.0f,
1221 mxy, myy, 0.0f, 0.0f,
1222 0.0f, 0.0f, 1.0f, 0.0f,
1223 mxt, myt, 0.0f, 1.0f
1247 const std::shared_ptr<impeller::TextFrame>& text_frame,
1257 [[maybe_unused]]
size_t stack_depth = stack_.size();
1259 display_list->Dispatch(*
this);
static const int points[]
static sk_sp< SkImage > color_filter(const SkImage *image, SkColorFilter *colorFilter)
static SkScalar center(float pos0, float pos1)
sk_sp< SkImage > asImage() const
SkVector getSimpleRadii() const
const SkRect & rect() const
virtual T type() const =0
@ kLines
draw each separate pair of points as a line segment
@ kPolygon
draw each pair of overlapping points as a line segment
@ kPoints
draw each point separately
virtual const DlBlendColorFilter * asBlend() const
virtual const DlMatrixColorFilter * asMatrix() const
SkScalar end_radius() const
SkPoint end_center() const
SkPoint start_center() const
SkScalar start_radius() const
DlTileMode tile_mode() const
DlImageSampling sampling() const
DlTileMode vertical_tile_mode() const
DlTileMode horizontal_tile_mode() const
sk_sp< const DlImage > image() const
virtual const DlLocalMatrixImageFilter * asLocalMatrix() const
virtual const DlColorFilterImageFilter * asColorFilter() const
virtual const DlMatrixImageFilter * asMatrix() const
virtual const DlComposeImageFilter * asCompose() const
virtual const DlBlurImageFilter * asBlur() const
virtual const DlDilateImageFilter * asDilate() const
virtual const DlErodeImageFilter * asErode() const
virtual const DlBlurMaskFilter * asBlur() const
void get_matrix(float matrix[20]) const
const SkMatrix & matrix() const
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
Holds all of the data (both required and optional) for a DisplayList drawVertices call.
void DrawLine(const Point &p0, const Point &p1, const Paint &paint)
const Matrix & GetCurrentTransform() const
void DrawImageRect(const std::shared_ptr< Image > &image, Rect source, Rect dest, const Paint &paint, SamplerDescriptor sampler={}, SourceRectConstraint src_rect_constraint=SourceRectConstraint::kFast)
void DrawVertices(const std::shared_ptr< VerticesGeometry > &vertices, BlendMode blend_mode, const Paint &paint)
virtual void SaveLayer(const Paint &paint, std::optional< Rect > bounds=std::nullopt, const std::shared_ptr< ImageFilter > &backdrop_filter=nullptr, ContentBoundsPromise bounds_promise=ContentBoundsPromise::kUnknown, uint32_t total_content_depth=kMaxDepth)
void DrawOval(const Rect &rect, const Paint &paint)
void RestoreToCount(size_t count)
void ClipPath(const Path &path, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
void ClipRRect(const Rect &rect, const Size &corner_radii, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
size_t GetSaveCount() const
void Transform(const Matrix &transform)
void PreConcat(const Matrix &transform)
void Rotate(Radians radians)
virtual void DrawTextFrame(const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint)
void DrawPaint(const Paint &paint)
void ClipRect(const Rect &rect, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
void Skew(Scalar sx, Scalar sy)
void Scale(const Vector2 &scale)
const std::optional< Rect > GetCurrentLocalCullingBounds() const
Picture EndRecordingAsPicture()
void DrawPath(const Path &path, const Paint &paint)
virtual void Save(uint32_t total_content_depth=kMaxDepth)
void DrawPoints(std::vector< Point > points, Scalar radius, const Paint &paint, PointStyle point_style)
void ClipOval(const Rect &bounds, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
void DrawRect(const Rect &rect, const Paint &paint)
void DrawRRect(const Rect &rect, const Size &corner_radii, const Paint &paint)
void DrawAtlas(const std::shared_ptr< Image > &atlas, std::vector< Matrix > transforms, std::vector< Rect > texture_coordinates, std::vector< Color > colors, BlendMode blend_mode, SamplerDescriptor sampler, std::optional< Rect > cull_rect, const Paint &paint)
void Translate(const Vector3 &offset)
void DrawCircle(const Point ¢er, Scalar radius, const Paint &paint)
static std::shared_ptr< ColorFilter > MakeMatrix(ColorMatrix color_matrix)
static std::shared_ptr< ColorFilter > MakeBlend(BlendMode blend_mode, Color color)
static std::shared_ptr< ColorFilter > MakeLinearToSrgb()
static std::shared_ptr< ColorFilter > MakeSrgbToLinear()
static ColorSource MakeLinearGradient(Point start_point, Point end_point, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
static ColorSource MakeColor()
static ColorSource MakeRadialGradient(Point center, Scalar radius, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
static ColorSource MakeImage(std::shared_ptr< Texture > texture, Entity::TileMode x_tile_mode, Entity::TileMode y_tile_mode, SamplerDescriptor sampler_descriptor, Matrix effect_transform)
static ColorSource MakeSweepGradient(Point center, Degrees start_angle, Degrees end_angle, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
static ColorSource MakeConicalGradient(Point center, Scalar radius, std::vector< Color > colors, std::vector< Scalar > stops, Point focus_center, Scalar focus_radius, Entity::TileMode tile_mode, Matrix effect_transform)
static ColorSource MakeRuntimeEffect(std::shared_ptr< RuntimeStage > runtime_stage, std::shared_ptr< std::vector< uint8_t > > uniform_data, std::vector< RuntimeEffectContents::TextureInput > texture_inputs)
const std::shared_ptr< LazyGlyphAtlas > & GetLazyGlyphAtlas() const
void transformFullPerspective(SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt) override
void setImageFilter(const flutter::DlImageFilter *filter) override
void drawVertices(const flutter::DlVertices *vertices, flutter::DlBlendMode dl_mode) override
void drawTextFrame(const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y) override
void setStrokeCap(flutter::DlStrokeCap cap) override
void drawPath(const SkPath &path) override
void saveLayer(const SkRect &bounds, const flutter::SaveLayerOptions &options, uint32_t total_content_depth, const flutter::DlImageFilter *backdrop) override
void setAntiAlias(bool aa) override
void drawPoints(PointMode mode, uint32_t count, const SkPoint points[]) override
void drawLine(const SkPoint &p0, const SkPoint &p1) override
void clipRect(const SkRect &rect, ClipOp clip_op, bool is_aa) override
void drawOval(const SkRect &bounds) override
void drawCircle(const SkPoint ¢er, SkScalar radius) override
void drawPaint() override
Picture EndRecordingAsPicture()
void setStrokeJoin(flutter::DlStrokeJoin join) override
void setStrokeWidth(SkScalar width) override
void setColorFilter(const flutter::DlColorFilter *filter) override
void translate(SkScalar tx, SkScalar ty) override
void setDrawStyle(flutter::DlDrawStyle style) override
void clipRRect(const SkRRect &rrect, ClipOp clip_op, bool is_aa) override
void drawShadow(const SkPath &path, const flutter::DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr) override
void setStrokeMiter(SkScalar limit) override
void setPathEffect(const flutter::DlPathEffect *effect) override
void scale(SkScalar sx, SkScalar sy) override
void skew(SkScalar sx, SkScalar sy) override
void clipPath(const SkPath &path, ClipOp clip_op, bool is_aa) override
void setInvertColors(bool invert) override
void drawImage(const sk_sp< flutter::DlImage > image, const SkPoint point, flutter::DlImageSampling sampling, bool render_with_attributes) override
void drawImageNine(const sk_sp< flutter::DlImage > image, const SkIRect ¢er, const SkRect &dst, flutter::DlFilterMode filter, bool render_with_attributes) override
void drawAtlas(const sk_sp< flutter::DlImage > atlas, const SkRSXform xform[], const SkRect tex[], const flutter::DlColor colors[], int count, flutter::DlBlendMode mode, flutter::DlImageSampling sampling, const SkRect *cull_rect, bool render_with_attributes) override
void drawDRRect(const SkRRect &outer, const SkRRect &inner) override
void drawRect(const SkRect &rect) override
void drawDisplayList(const sk_sp< flutter::DisplayList > display_list, SkScalar opacity) override
void setColor(flutter::DlColor color) override
void drawImageRect(const sk_sp< flutter::DlImage > image, const SkRect &src, const SkRect &dst, flutter::DlImageSampling sampling, bool render_with_attributes, SrcRectConstraint constraint) override
void setMaskFilter(const flutter::DlMaskFilter *filter) override
virtual Canvas & GetCanvas()=0
void setColorSource(const flutter::DlColorSource *source) override
void transformReset() override
void setBlendMode(flutter::DlBlendMode mode) override
void drawArc(const SkRect &oval_bounds, SkScalar start_degrees, SkScalar sweep_degrees, bool use_center) override
void drawColor(flutter::DlColor color, flutter::DlBlendMode mode) override
void drawTextBlob(const sk_sp< SkTextBlob > blob, SkScalar x, SkScalar y) override
void transform2DAffine(SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt) override
void rotate(SkScalar degrees) override
void drawRRect(const SkRRect &rrect) override
DlDispatcher()
Subclasses.
Canvas & GetCanvas() override
Canvas & GetCanvas() override
ExperimentalDlDispatcher(ContentContext &renderer, RenderTarget &render_target, IRect cull_rect)
@ kNormal
Blurred inside and outside.
@ kOuter
Nothing inside, blurred outside.
@ kInner
Blurred inside, nothing outside.
@ kSolid
Solid inside, blurred outside.
static std::shared_ptr< ImageFilter > MakeMatrix(const Matrix &matrix, SamplerDescriptor sampler_descriptor)
static std::shared_ptr< ImageFilter > MakeLocalMatrix(const Matrix &matrix, const ImageFilter &internal_filter)
static std::shared_ptr< ImageFilter > MakeErode(Radius radius_x, Radius radius_y)
static std::shared_ptr< ImageFilter > MakeBlur(Sigma sigma_x, Sigma sigma_y, FilterContents::BlurStyle blur_style, Entity::TileMode tile_mode)
static std::shared_ptr< ImageFilter > MakeDilate(Radius radius_x, Radius radius_y)
static std::shared_ptr< ImageFilter > MakeFromColorFilter(const ColorFilter &color_filter)
static std::shared_ptr< ImageFilter > MakeCompose(const ImageFilter &inner, const ImageFilter &outer)
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
void drawDisplayList(const sk_sp< flutter::DisplayList > display_list, SkScalar opacity) override
void transformReset() override
void rotate(SkScalar degrees) override
TextFrameDispatcher(const ContentContext &renderer, const Matrix &initial_matrix)
void skew(SkScalar sx, SkScalar sy) override
void saveLayer(const SkRect &bounds, const flutter::SaveLayerOptions options, const flutter::DlImageFilter *backdrop) override
void transform2DAffine(SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt) override
void transformFullPerspective(SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt) override
void scale(SkScalar sx, SkScalar sy) override
void translate(SkScalar tx, SkScalar ty) override
void drawTextFrame(const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y) override
#define FML_LOG(severity)
#define FML_UNREACHABLE()
#define FML_DCHECK(condition)
static float max(float r, float g, float b)
static float min(float r, float g, float b)
@ kMiter
extends to miter limit
@ kBevel
connects outside edges
@ kButt
no stroke extension
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
@ kStrokeAndFill
both strokes and fills shapes
@ kStroke
strokes boundary of shapes
@ kFill
fills interior of shapes
@ kNormal
fuzzy inside and outside
@ kOuter
nothing inside, fuzzy outside
@ kInner
fuzzy inside, nothing outside
@ kSolid
solid inside, fuzzy outside
@ kExclusion
rc = s + d - two(s*d), ra = kSrcOver
@ kSaturation
saturation of source with hue and luminosity of destination
@ kColorBurn
darken destination to reflect source
@ kLighten
rc = s + d - min(s*da, d*sa), ra = kSrcOver
@ kHue
hue of source with saturation and luminosity of destination
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kColorDodge
brighten destination to reflect source
@ kSrcOver
r = s + (1-sa)*d
@ kXor
r = s*(1-da) + d*(1-sa)
@ kLuminosity
luminosity of source with hue and saturation of destination
@ kSoftLight
lighten or darken, depending on source
@ kDifference
rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
@ kOverlay
multiply or screen, depending on destination
@ kSrcATop
r = s*da + d*(1-sa)
@ kDstATop
r = d*sa + s*(1-da)
@ kDstOver
r = d + (1-da)*s
@ kColor
hue and saturation of source with luminosity of destination
@ kHardLight
multiply or screen, depending on source
@ kDarken
rc = s + d - max(s*da, d*sa), ra = kSrcOver
std::vector< Point > ToPoints(const SkPoint points[], int count)
Path ToPath(const SkPath &path, Point shift)
void ConvertStops(const flutter::DlGradientColorSourceBase *gradient, std::vector< Color > &colors, std::vector< float > &stops)
Convert display list colors + stops into impeller colors and stops, taking care to ensure that the st...
Point ToPoint(const SkPoint &point)
Size ToSize(const SkPoint &point)
std::vector< Rect > ToRects(const SkRect tex[], int count)
std::vector< Matrix > ToRSXForms(const SkRSXform xform[], int count)
Rect ToRect(const SkRect &rect)
Color ToColor(const flutter::DlColor &color)
static BlendMode ToBlendMode(flutter::DlBlendMode mode)
static Paint::Style ToStyle(flutter::DlDrawStyle style)
static std::shared_ptr< ImageFilter > ToImageFilter(const flutter::DlImageFilter *filter)
@ kRound
Points are drawn as squares.
@ kSquare
Points are drawn as circles.
static std::optional< ColorSource::Type > ToColorSourceType(flutter::DlColorSourceType type)
static Entity::ClipOperation ToClipOperation(flutter::DlCanvas::ClipOp clip_op)
static Matrix ToMatrix(const SkMatrix &m)
@ kMayClipContents
The caller claims the bounds are a subset of an estimate of the reasonably tight bounds but likely cl...
@ kContainsContents
The caller claims the bounds are a reasonably tight estimate of the coverage of the contents and shou...
static std::shared_ptr< ColorFilter > ToColorFilter(const flutter::DlColorFilter *filter)
static impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlImageSampling options)
static Entity::TileMode ToTileMode(flutter::DlTileMode tile_mode)
@ kNearest
Select nearest to the sample point. Most widely supported.
static std::vector< Color > ToColors(const flutter::DlColor colors[], int count)
static FilterContents::BlurStyle ToBlurStyle(flutter::DlBlurStyle blur_style)
std::shared_ptr< impeller::VerticesGeometry > MakeVertices(const flutter::DlVertices *vertices)
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
A 4x4 matrix using column-major storage.
static constexpr Matrix MakeTranslation(const Vector3 &t)
constexpr Scalar GetMaxBasisLengthXY() const
constexpr Matrix Translate(const Vector3 &t) const
constexpr Vector3 GetScale() const
static constexpr Matrix MakeColumn(Scalar m0, Scalar m1, Scalar m2, Scalar m3, Scalar m4, Scalar m5, Scalar m6, Scalar m7, Scalar m8, Scalar m9, Scalar m10, Scalar m11, Scalar m12, Scalar m13, Scalar m14, Scalar m15)
static constexpr Matrix MakeSkew(Scalar sx, Scalar sy)
constexpr Matrix Scale(const Vector3 &s) const
static Matrix MakeRotationZ(Radians r)
constexpr bool HasPerspective() const
FilterContents::BlurStyle style
std::shared_ptr< ImageFilter > image_filter
std::optional< MaskBlurDescriptor > mask_blur_descriptor
std::shared_ptr< ColorFilter > color_filter
For convolution filters, the "radius" is the size of the convolution kernel to use on the local space...
In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of t...
constexpr auto GetBottom() const
constexpr auto GetTop() const
constexpr auto GetLeft() const
constexpr auto GetRight() const
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
#define TRACE_EVENT0(category_group, name)
static sk_sp< SkShader > linear(sk_sp< SkShader > shader)