13 #include "display_list/dl_sampling_options.h"
14 #include "display_list/effects/dl_image_filter.h"
15 #include "flutter/fml/logging.h"
16 #include "fml/closure.h"
44 #define USE_DEPTH_WATCHER true
46 #define USE_DEPTH_WATCHER false
61 #define AUTO_DEPTH_WATCHER(d) \
62 DepthWatcher _watcher(__FILE__, __LINE__, GetCanvas(), \
63 paint_.mask_blur_descriptor.has_value(), d)
76 #define AUTO_DEPTH_CHECK() _watcher.check(__FILE__, __LINE__)
80 DepthWatcher(
const std::string& file,
88 allowed_(has_mask_blur ? allowed + 1 : allowed),
92 ~DepthWatcher() { check(file_, line_); }
94 void check(
const std::string& file,
int line) {
95 FML_CHECK(canvas_.GetOpDepth() <= (old_depth_ + allowed_) &&
96 canvas_.GetOpDepth() <= old_max_)
98 <<
"from " << file <<
":" << line << std::endl
99 <<
"old/allowed/current/max = " << old_depth_ <<
"/" << allowed_ <<
"/"
100 << canvas_.GetOpDepth() <<
"/" << old_max_;
104 const std::string file_;
108 const uint64_t allowed_;
109 const uint64_t old_depth_;
110 const uint64_t old_max_;
115 #define AUTO_DEPTH_WATCHER(d)
116 #define AUTO_DEPTH_CHECK()
120 #define UNIMPLEMENTED \
121 FML_DLOG(ERROR) << "Unimplemented detail in " << __FUNCTION__;
124 const flutter::DlFilterMode options) {
127 case flutter::DlFilterMode::kNearest:
129 desc.
label =
"Nearest Sampler";
131 case flutter::DlFilterMode::kLinear:
133 desc.
label =
"Linear Sampler";
142 if (rect ==
nullptr) {
157 case flutter::DlDrawStyle::kFill:
159 case flutter::DlDrawStyle::kStroke:
161 case flutter::DlDrawStyle::kStrokeAndFill:
201 case flutter::DlStrokeCap::kButt:
204 case flutter::DlStrokeCap::kRound:
207 case flutter::DlStrokeCap::kSquare:
218 case flutter::DlStrokeJoin::kMiter:
221 case flutter::DlStrokeJoin::kRound:
224 case flutter::DlStrokeJoin::kBevel:
259 switch (blur_style) {
260 case flutter::DlBlurStyle::kNormal:
262 case flutter::DlBlurStyle::kSolid:
264 case flutter::DlBlurStyle::kOuter:
266 case flutter::DlBlurStyle::kInner:
276 if (filter ==
nullptr) {
280 switch (filter->type()) {
281 case flutter::DlMaskFilterType::kBlur: {
282 auto blur = filter->asBlur();
286 .sigma =
Sigma(blur->sigma()),
287 .respect_ctm = blur->respectCTM(),
310 const flutter::SaveLayerOptions& options,
311 uint32_t total_content_depth,
312 flutter::DlBlendMode max_content_mode,
313 const flutter::DlImageFilter* backdrop,
314 std::optional<int64_t> backdrop_id) {
317 auto paint = options.renders_with_attributes() ?
paint_ :
Paint{};
318 auto promise = options.content_is_clipped()
321 std::optional<Rect> impeller_bounds;
324 if (!options.content_is_unbounded() || options.bounds_from_caller()) {
325 impeller_bounds = bounds;
329 paint, impeller_bounds, backdrop, promise, total_content_depth,
332 options.can_distribute_opacity() && !options.content_is_unbounded(),
431 case flutter::DlClipOp::kDifference:
433 case flutter::DlClipOp::kIntersect:
440 flutter::DlClipOp clip_op,
450 flutter::DlClipOp clip_op,
460 flutter::DlClipOp sk_op,
465 if (rrect.IsRect()) {
468 }
else if (rrect.IsOval()) {
471 }
else if (rrect.GetRadii().AreAllCornersSame()) {
482 flutter::DlClipOp sk_op,
490 }
else if (rse.IsOval()) {
501 flutter::DlClipOp sk_op,
508 if (path.IsRect(&rect)) {
511 }
else if (path.IsOval(&rect)) {
516 if (path.IsSkRRect(&rrect) && rrect.isSimple()) {
518 flutter::ToDlSize(rrect.getSimpleRadii()));
529 flutter::DlBlendMode dl_mode) {
558 Scalar length = p0.GetDistance(p1);
565 if (length > 0.0f && on_length >= 0.0f && off_length > 0.0f) {
566 Point delta = (p1 - p0) / length;
570 while (consumed < length) {
571 builder.
MoveTo(p0 + delta * consumed);
573 Scalar dash_end = consumed + on_length;
574 if (dash_end < length) {
575 builder.
LineTo(p0 + delta * dash_end);
583 consumed = dash_end + off_length;
630 builder.
SetBounds(outer.GetBounds().Union(inner.GetBounds()));
650 const Paint& paint) {
655 if (path.IsRect(&rect, &closed) && closed) {
661 if (path.IsSkRRect(&rrect) && rrect.isSimple()) {
666 if (path.IsOval(&rect)) {
673 if (path.IsLine(&start, &end)) {
678 canvas.
DrawPath(path.GetPath(), paint);
689 std::max(oval_bounds.GetWidth(), oval_bounds.GetHeight())) {
719 case flutter::DlPointMode::kPoints: {
730 case flutter::DlPointMode::kLines:
731 for (uint32_t i = 1; i < count; i += 2) {
732 Point p0 = points[i - 1];
733 Point p1 = points[i];
737 case flutter::DlPointMode::kPolygon:
739 Point p0 = points[0];
740 for (uint32_t i = 1; i < count; i++) {
741 Point p1 = points[i];
751 const std::shared_ptr<flutter::DlVertices>& vertices,
752 flutter::DlBlendMode dl_mode) {}
757 flutter::DlImageSampling sampling,
758 bool render_with_attributes) {
765 auto texture = image->impeller_texture();
770 const auto size = texture->GetSize();
771 const auto src = DlRect::MakeWH(size.width, size.height);
772 const auto dest = DlRect::MakeXYWH(point.x, point.y, size.width, size.height);
778 render_with_attributes,
779 flutter::DlSrcRectConstraint::kStrict
787 flutter::DlImageSampling sampling,
788 bool render_with_attributes,
789 flutter::DlSrcRectConstraint constraint =
790 flutter::DlSrcRectConstraint::kFast) {
794 image->impeller_texture(),
806 flutter::DlFilterMode filter,
807 bool render_with_attributes) {
813 center.GetRight(), center.GetBottom()),
822 const flutter::DlColor colors[],
824 flutter::DlBlendMode mode,
825 flutter::DlImageSampling sampling,
827 bool render_with_attributes) {
835 static_cast<size_t>(count),
840 auto atlas_contents = std::make_shared<AtlasContents>();
841 atlas_contents->SetGeometry(&geometry);
848 const sk_sp<flutter::DisplayList> display_list,
869 if (opacity < SK_Scalar1) {
874 display_list->total_depth(),
875 display_list->can_apply_group_opacity());
891 if (global_culling_bounds.has_value()) {
893 GetCanvas().GetCurrentTransform().Invert());
894 display_list->Dispatch(
895 *
this, SkRect::MakeLTRB(cull_rect.
GetLeft(), cull_rect.
GetTop(),
902 display_list->Dispatch(*
this);
924 const std::shared_ptr<TextFrame>& text_frame,
937 const flutter::DlColor color,
939 bool transparent_occluder,
944 spot_color.
alpha *= 0.25;
949 std::max(std::max(spot_color.
red, spot_color.
green), spot_color.
blue);
951 std::min(std::min(spot_color.
red, spot_color.
green), spot_color.
blue);
952 Scalar luminance = (min + max) * 0.5;
955 (2.6f + (-2.66667f + 1.06667f * spot_color.
alpha) * spot_color.
alpha) *
958 (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
960 color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
963 std::clamp(spot_color.
alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
965 Scalar color_scale = color_alpha * (1 - greyscale_alpha);
966 Scalar tonal_alpha = color_scale + greyscale_alpha;
967 Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
968 spot_color =
Color(unpremul_scale * spot_color.
red,
969 unpremul_scale * spot_color.
green,
970 unpremul_scale * spot_color.
blue, tonal_alpha);
973 Vector3 light_position(0, -1, 1);
974 Scalar occluder_z = dpr * elevation;
976 constexpr
Scalar kLightRadius = 800 / 600;
980 paint.
color = spot_color;
983 .sigma =
Radius{kLightRadius * occluder_z /
1001 flutter::DlBlendMode max_root_blend_mode) {
1009 bool has_root_backdrop_filter,
1010 flutter::DlBlendMode max_root_blend_mode,
1015 has_root_backdrop_filter ||
1018 renderer_(renderer) {}
1020 Canvas& CanvasDlDispatcher::GetCanvas() {
1025 const std::shared_ptr<flutter::DlVertices>& vertices,
1026 flutter::DlBlendMode dl_mode) {
1030 std::make_shared<DlVerticesGeometry>(vertices, renderer_), dl_mode,
1035 std::unordered_map<int64_t, BackdropData> backdrop,
1036 size_t backdrop_count) {
1043 const Matrix& initial_matrix,
1044 const Rect cull_rect)
1045 : renderer_(renderer), matrix_(initial_matrix) {
1046 cull_rect_state_.push_back(cull_rect);
1050 FML_DCHECK(cull_rect_state_.size() == 1);
1054 stack_.emplace_back(matrix_);
1055 cull_rect_state_.push_back(cull_rect_state_.back());
1059 const flutter::SaveLayerOptions options,
1060 const flutter::DlImageFilter* backdrop,
1061 std::optional<int64_t> backdrop_id) {
1064 backdrop_count_ += (backdrop ==
nullptr ? 0 : 1);
1065 if (backdrop !=
nullptr && backdrop_id.has_value()) {
1066 std::shared_ptr<flutter::DlImageFilter> shared_backdrop =
1068 std::unordered_map<int64_t, BackdropData>::iterator existing =
1069 backdrop_data_.find(backdrop_id.value());
1070 if (existing == backdrop_data_.end()) {
1071 backdrop_data_[backdrop_id.value()] =
1075 data.backdrop_count++;
1076 if (
data.all_filters_equal) {
1077 data.all_filters_equal = (*
data.last_backdrop == *shared_backdrop);
1078 data.last_backdrop = shared_backdrop;
1085 auto global_cull_rect = cull_rect_state_.back();
1086 if (has_image_filter_ || global_cull_rect.IsMaximum()) {
1089 auto global_save_bounds = bounds.TransformBounds(matrix_);
1090 auto new_cull_rect = global_cull_rect.Intersection(global_save_bounds);
1091 if (new_cull_rect.has_value()) {
1092 cull_rect_state_.back() = new_cull_rect.value();
1100 matrix_ = stack_.back();
1102 cull_rect_state_.pop_back();
1110 matrix_ = matrix_.
Scale({sx, sy, 1.0f});
1126 mxx, myx, 0.0f, 0.0f,
1127 mxy, myy, 0.0f, 0.0f,
1128 0.0f, 0.0f, 1.0f, 0.0f,
1129 mxt, myt, 0.0f, 1.0f
1153 const std::shared_ptr<impeller::TextFrame>& text_frame,
1158 properties.
stroke =
true;
1164 if (text_frame->HasColor()) {
1177 (properties.
stroke || text_frame->HasColor())
1178 ? std::optional<GlyphProperties>(properties)
1183 const Rect FirstPassDispatcher::GetCurrentLocalCullingBounds()
const {
1184 auto cull_rect = cull_rect_state_.back();
1185 if (!cull_rect.IsEmpty() && !cull_rect.IsMaximum()) {
1187 cull_rect = cull_rect.TransformBounds(inverse);
1193 const sk_sp<flutter::DisplayList> display_list,
1195 [[maybe_unused]]
size_t stack_depth = stack_.size();
1197 Paint old_paint = paint_;
1199 bool old_has_image_filter = has_image_filter_;
1200 has_image_filter_ =
false;
1203 display_list->Dispatch(*
this);
1205 Rect local_cull_bounds = GetCurrentLocalCullingBounds();
1207 display_list->Dispatch(*
this);
1208 }
else if (!local_cull_bounds.
IsEmpty()) {
1210 display_list->Dispatch(*
this,
1211 SkIRect::MakeLTRB(cull_rect.
GetLeft(),
1221 has_image_filter_ = old_has_image_filter;
1222 FML_DCHECK(stack_depth == stack_.size());
1248 case flutter::DlStrokeCap::kButt:
1251 case flutter::DlStrokeCap::kRound:
1254 case flutter::DlStrokeCap::kSquare:
1263 case flutter::DlStrokeJoin::kMiter:
1266 case flutter::DlStrokeJoin::kRound:
1269 case flutter::DlStrokeJoin::kBevel:
1277 if (filter ==
nullptr) {
1278 has_image_filter_ =
false;
1280 has_image_filter_ =
true;
1284 std::pair<std::unordered_map<int64_t, BackdropData>,
size_t>
1286 std::unordered_map<int64_t, BackdropData> temp;
1287 std::swap(temp, backdrop_data_);
1288 return std::make_pair(temp, backdrop_count_);
1292 const sk_sp<flutter::DisplayList>& display_list,
1295 bool reset_host_buffer,
1296 bool generate_mips) {
1298 if (generate_mips) {
1305 context.
GetContext()->GetResourceAllocator());
1307 if (context.
GetContext()->GetCapabilities()->SupportsOffscreenMSAA()) {
1312 "Picture Snapshot MSAA",
1314 kDefaultColorAttachmentConfigMSAA
1323 kDefaultColorAttachmentConfig
1330 SkIRect sk_cull_rect = SkIRect::MakeWH(size.
width, size.
height);
1333 display_list->Dispatch(collector, sk_cull_rect);
1338 display_list->root_has_backdrop_filter(),
1339 display_list->max_root_blend_mode(),
1345 fml::ScopedCleanupClosure cleanup([&] {
1346 if (reset_host_buffer) {
1351 context.
GetContext()->DisposeThreadLocalCachedResources();
1354 display_list->Dispatch(impeller_dispatcher, sk_cull_rect);
1362 const sk_sp<flutter::DisplayList>& display_list,
1364 bool reset_host_buffer,
1367 cull_rect.right(), cull_rect.bottom());
1369 display_list->Dispatch(collector, cull_rect);
1375 display_list->root_has_backdrop_filter(),
1376 display_list->max_root_blend_mode(),
1382 fml::ScopedCleanupClosure cleanup([&] {
1383 if (reset_host_buffer) {
1389 display_list->Dispatch(impeller_dispatcher, cull_rect);
ContentContext & GetContentContext() const
std::shared_ptr< Context > GetContext() const
CanvasDlDispatcher(ContentContext &renderer, RenderTarget &render_target, bool is_onscreen, bool has_root_backdrop_filter, flutter::DlBlendMode max_root_blend_mode, IRect cull_rect)
void drawVertices(const std::shared_ptr< flutter::DlVertices > &vertices, flutter::DlBlendMode dl_mode) override
void SetBackdropData(std::unordered_map< int64_t, BackdropData > backdrop, size_t backdrop_count)
void ClipGeometry(const Geometry &geometry, Entity::ClipOperation clip_op, bool is_aa=true)
void SetBackdropData(std::unordered_map< int64_t, BackdropData > backdrop_data, size_t backdrop_count)
Update the backdrop data used to group together backdrop filters within the same layer.
void DrawRoundSuperellipse(const RoundSuperellipse &rse, const Paint &paint)
std::optional< Rect > GetLocalCoverageLimit() const
Return the culling bounds of the current render target, or nullopt if there is no coverage.
void SaveLayer(const Paint &paint, std::optional< Rect > bounds=std::nullopt, const flutter::DlImageFilter *backdrop_filter=nullptr, ContentBoundsPromise bounds_promise=ContentBoundsPromise::kUnknown, uint32_t total_content_depth=kMaxDepth, bool can_distribute_opacity=false, std::optional< int64_t > backdrop_id=std::nullopt)
const Matrix & GetCurrentTransform() const
void DrawVertices(const std::shared_ptr< VerticesGeometry > &vertices, BlendMode blend_mode, const Paint &paint)
void DrawOval(const Rect &rect, const Paint &paint)
void DrawImageRect(const std::shared_ptr< Texture > &image, Rect source, Rect dest, const Paint &paint, const SamplerDescriptor &sampler={}, SourceRectConstraint src_rect_constraint=SourceRectConstraint::kFast)
void RestoreToCount(size_t count)
size_t GetSaveCount() const
void Transform(const Matrix &transform)
uint64_t GetMaxOpDepth() const
void PreConcat(const Matrix &transform)
void Rotate(Radians radians)
void DrawPoints(const Point points[], uint32_t count, Scalar radius, const Paint &paint, PointStyle point_style)
void DrawTextFrame(const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint)
void DrawPaint(const Paint &paint)
void DrawRoundRect(const RoundRect &rect, const Paint &paint)
void Skew(Scalar sx, Scalar sy)
void Scale(const Vector2 &scale)
uint64_t GetOpDepth() const
void DrawPath(const Path &path, const Paint &paint)
void Save(uint32_t total_content_depth=kMaxDepth)
void DrawRect(const Rect &rect, const Paint &paint)
void DrawAtlas(const std::shared_ptr< AtlasContents > &atlas_contents, const Paint &paint)
void DrawLine(const Point &p0, const Point &p1, const Paint &paint, bool reuse_depth=false)
void Translate(const Vector3 &offset)
void DrawCircle(const Point ¢er, Scalar radius, const Paint &paint)
virtual bool SupportsFramebufferFetch() const =0
Whether the context backend is able to support pipelines with shaders that read from the framebuffer ...
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
const std::shared_ptr< LazyGlyphAtlas > & GetLazyGlyphAtlas() const
const Capabilities & GetDeviceCapabilities() const
TextShadowCache & GetTextShadowCache() const
A wrapper around data provided by a drawAtlas call.
void drawLine(const DlPoint &p0, const DlPoint &p1) override
void drawAtlas(const sk_sp< flutter::DlImage > atlas, const RSTransform xform[], const DlRect tex[], const flutter::DlColor colors[], int count, flutter::DlBlendMode mode, flutter::DlImageSampling sampling, const DlRect *cull_rect, bool render_with_attributes) override
void drawPoints(flutter::DlPointMode mode, uint32_t count, const DlPoint points[]) override
virtual Canvas & GetCanvas()=0
void drawDashedLine(const DlPoint &p0, const DlPoint &p1, DlScalar on_length, DlScalar off_length) override
void drawOval(const DlRect &bounds) override
void setImageFilter(const flutter::DlImageFilter *filter) override
void drawPath(const DlPath &path) override
void setStrokeCap(flutter::DlStrokeCap cap) override
void clipOval(const DlRect &bounds, flutter::DlClipOp clip_op, bool is_aa) override
void drawRoundSuperellipse(const DlRoundSuperellipse &rse) override
void clipRoundRect(const DlRoundRect &rrect, flutter::DlClipOp clip_op, bool is_aa) override
void skew(DlScalar sx, DlScalar sy) override
void clipRect(const DlRect &rect, flutter::DlClipOp clip_op, bool is_aa) override
void setAntiAlias(bool aa) override
void transformFullPerspective(DlScalar mxx, DlScalar mxy, DlScalar mxz, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myz, DlScalar myt, DlScalar mzx, DlScalar mzy, DlScalar mzz, DlScalar mzt, DlScalar mwx, DlScalar mwy, DlScalar mwz, DlScalar mwt) override
void setStrokeWidth(DlScalar width) override
void drawDiffRoundRect(const DlRoundRect &outer, const DlRoundRect &inner) override
void drawRoundRect(const DlRoundRect &rrect) override
void drawPaint() override
void setStrokeJoin(flutter::DlStrokeJoin join) override
void drawTextBlob(const sk_sp< SkTextBlob > blob, DlScalar x, DlScalar y) override
void rotate(DlScalar degrees) override
void setColorFilter(const flutter::DlColorFilter *filter) override
void scale(DlScalar sx, DlScalar sy) override
void setDrawStyle(flutter::DlDrawStyle style) override
void drawShadow(const DlPath &path, const flutter::DlColor color, const DlScalar elevation, bool transparent_occluder, DlScalar dpr) override
void drawImage(const sk_sp< flutter::DlImage > image, const DlPoint &point, flutter::DlImageSampling sampling, bool render_with_attributes) override
void clipPath(const DlPath &path, flutter::DlClipOp clip_op, bool is_aa) override
void drawImageRect(const sk_sp< flutter::DlImage > image, const DlRect &src, const DlRect &dst, flutter::DlImageSampling sampling, bool render_with_attributes, flutter::DlSrcRectConstraint constraint) override
void clipRoundSuperellipse(const DlRoundSuperellipse &rse, flutter::DlClipOp clip_op, bool is_aa) override
void drawArc(const DlRect &oval_bounds, DlScalar start_degrees, DlScalar sweep_degrees, bool use_center) override
void saveLayer(const DlRect &bounds, const flutter::SaveLayerOptions &options, uint32_t total_content_depth, flutter::DlBlendMode max_content_mode, const flutter::DlImageFilter *backdrop, std::optional< int64_t > backdrop_id) override
void drawDisplayList(const sk_sp< flutter::DisplayList > display_list, DlScalar opacity) override
void transform2DAffine(DlScalar mxx, DlScalar mxy, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myt) override
void setInvertColors(bool invert) override
void setColor(flutter::DlColor color) override
void save(uint32_t total_content_depth) override
void setStrokeMiter(DlScalar limit) override
void translate(DlScalar tx, DlScalar ty) override
void drawVertices(const std::shared_ptr< flutter::DlVertices > &vertices, flutter::DlBlendMode dl_mode) override
void drawCircle(const DlPoint ¢er, DlScalar radius) override
void drawTextFrame(const std::shared_ptr< impeller::TextFrame > &text_frame, DlScalar x, DlScalar y) override
void setMaskFilter(const flutter::DlMaskFilter *filter) override
void setColorSource(const flutter::DlColorSource *source) override
void drawImageNine(const sk_sp< flutter::DlImage > image, const DlIRect ¢er, const DlRect &dst, flutter::DlFilterMode filter, bool render_with_attributes) override
void transformReset() override
void setBlendMode(flutter::DlBlendMode mode) override
void drawColor(flutter::DlColor color, flutter::DlBlendMode mode) override
void drawRect(const DlRect &rect) override
static void SimplifyOrDrawPath(Canvas &canvas, const DlPath &cache, const Paint &paint)
static constexpr BlendMode kLastPipelineBlendMode
A geometry that is created from a filled path object.
@ kNormal
Blurred inside and outside.
@ kOuter
Nothing inside, blurred outside.
@ kInner
Blurred inside, nothing outside.
@ kSolid
Solid inside, blurred outside.
void setColor(flutter::DlColor color) override
void setStrokeCap(flutter::DlStrokeCap cap) override
void saveLayer(const DlRect &bounds, const flutter::SaveLayerOptions options, const flutter::DlImageFilter *backdrop, std::optional< int64_t > backdrop_id) override
void setDrawStyle(flutter::DlDrawStyle style) override
std::pair< std::unordered_map< int64_t, BackdropData >, size_t > TakeBackdropData()
void rotate(DlScalar degrees) override
void drawTextFrame(const std::shared_ptr< impeller::TextFrame > &text_frame, DlScalar x, DlScalar y) override
void setImageFilter(const flutter::DlImageFilter *filter) override
void setStrokeMiter(DlScalar limit) override
void transformFullPerspective(DlScalar mxx, DlScalar mxy, DlScalar mxz, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myz, DlScalar myt, DlScalar mzx, DlScalar mzy, DlScalar mzz, DlScalar mzt, DlScalar mwx, DlScalar mwy, DlScalar mwz, DlScalar mwt) override
void scale(DlScalar sx, DlScalar sy) override
void translate(DlScalar tx, DlScalar ty) override
void skew(DlScalar sx, DlScalar sy) override
FirstPassDispatcher(const ContentContext &renderer, const Matrix &initial_matrix, const Rect cull_rect)
void drawDisplayList(const sk_sp< flutter::DisplayList > display_list, DlScalar opacity) override
void setStrokeWidth(DlScalar width) override
void setStrokeJoin(flutter::DlStrokeJoin join) override
void transformReset() override
void transform2DAffine(DlScalar mxx, DlScalar mxy, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myt) override
void DrawNinePatch(const std::shared_ptr< Texture > &image, Rect center, Rect dst, const SamplerDescriptor &sampler, Canvas *canvas, Paint *paint)
Path TakePath(FillType fill=FillType::kNonZero)
PathBuilder & AddArc(const Rect &oval_bounds, Radians start, Radians sweep, bool use_center=false)
PathBuilder & AddRoundRect(RoundRect rect)
PathBuilder & LineTo(Point point, bool relative=false)
Insert a line from the current position to point.
PathBuilder & MoveTo(Point point, bool relative=false)
PathBuilder & SetBounds(Rect bounds)
Set the bounding box that will be used by Path.GetBoundingBox in place of performing the computation.
a wrapper around the impeller [Allocator] instance that can be used to provide caching of allocated r...
virtual RenderTarget CreateOffscreenMSAA(const Context &context, ISize size, int mip_count, std::string_view label="Offscreen MSAA", RenderTarget::AttachmentConfigMSAA color_attachment_config=RenderTarget::kDefaultColorAttachmentConfigMSAA, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_msaa_texture=nullptr, const std::shared_ptr< Texture > &existing_color_resolve_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr)
virtual RenderTarget CreateOffscreen(const Context &context, ISize size, int mip_count, std::string_view label="Offscreen", RenderTarget::AttachmentConfig color_attachment_config=RenderTarget::kDefaultColorAttachmentConfig, std::optional< RenderTarget::AttachmentConfig > stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &existing_color_texture=nullptr, const std::shared_ptr< Texture > &existing_depth_stencil_texture=nullptr)
std::shared_ptr< Texture > GetRenderTargetTexture() const
static Rational RoundScaledFontSize(Scalar scale)
void MarkFrameStart()
Mark all glyph textures as unused this frame.
#define AUTO_DEPTH_WATCHER(d)
#define AUTO_DEPTH_CHECK()
impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlImageSampling options)
Color ToColor(const flutter::DlColor &color)
std::shared_ptr< Texture > DisplayListToTexture(const sk_sp< flutter::DisplayList > &display_list, ISize size, AiksContext &context, bool reset_host_buffer, bool generate_mips)
Render the provided display list to a texture with the given size.
static Paint::Style ToStyle(flutter::DlDrawStyle style)
flutter::DlRoundRect DlRoundRect
static std::optional< const Rect > ToOptRect(const flutter::DlRect *rect)
@ kRound
Points are drawn as squares.
@ kSquare
Points are drawn as circles.
static Entity::ClipOperation ToClipOperation(flutter::DlClipOp clip_op)
bool RenderToTarget(ContentContext &context, RenderTarget render_target, const sk_sp< flutter::DisplayList > &display_list, SkIRect cull_rect, bool reset_host_buffer, bool is_onscreen)
Render the provided display list to the render target.
flutter::DlRoundSuperellipse DlRoundSuperellipse
static bool RequiresReadbackForBlends(const ContentContext &renderer, flutter::DlBlendMode max_root_blend_mode)
Subclasses.
static impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlFilterMode options)
@ 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...
@ kNearest
Select nearest to the sample point. Most widely supported.
flutter::DlScalar DlScalar
static FilterContents::BlurStyle ToBlurStyle(flutter::DlBlurStyle blur_style)
constexpr Color WithAlpha(Scalar new_alpha) const
A 4x4 matrix using column-major storage.
static constexpr Matrix MakeTranslation(const Vector3 &t)
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
const flutter::DlColorFilter * color_filter
const flutter::DlColorSource * color_source
const flutter::DlImageFilter * image_filter
std::optional< MaskBlurDescriptor > mask_blur_descriptor
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 TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
constexpr auto GetTop() const
constexpr bool IsMaximum() const
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
constexpr auto GetLeft() const
RoundOut(const TRect< U > &r)
constexpr auto GetRight() const
constexpr static TRect MakeSize(const TSize< U > &size)
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
constexpr static TRect MakeMaximum()
constexpr size_t MipCount() const
Return the mip count of the texture.
std::shared_ptr< const fml::Mapping > data