13 #include "display_list/dl_sampling_options.h"
14 #include "display_list/effects/dl_image_filter.h"
15 #include "flutter/fml/logging.h"
42 #define USE_DEPTH_WATCHER true
44 #define USE_DEPTH_WATCHER false
59 #define AUTO_DEPTH_WATCHER(d) \
60 DepthWatcher _watcher(__FILE__, __LINE__, GetCanvas(), \
61 paint_.mask_blur_descriptor.has_value(), d)
74 #define AUTO_DEPTH_CHECK() _watcher.check(__FILE__, __LINE__)
78 DepthWatcher(
const std::string& file,
86 allowed_(has_mask_blur ? allowed + 1 : allowed),
90 ~DepthWatcher() { check(file_, line_); }
92 void check(
const std::string& file,
int line) {
93 FML_CHECK(canvas_.GetOpDepth() <= (old_depth_ + allowed_) &&
94 canvas_.GetOpDepth() <= old_max_)
96 <<
"from " << file <<
":" << line << std::endl
97 <<
"old/allowed/current/max = " << old_depth_ <<
"/" << allowed_ <<
"/"
98 << canvas_.GetOpDepth() <<
"/" << old_max_;
102 const std::string file_;
106 const uint64_t allowed_;
107 const uint64_t old_depth_;
108 const uint64_t old_max_;
113 #define AUTO_DEPTH_WATCHER(d)
114 #define AUTO_DEPTH_CHECK()
118 #define UNIMPLEMENTED \
119 FML_DLOG(ERROR) << "Unimplemented detail in " << __FUNCTION__;
122 const flutter::DlFilterMode options) {
125 case flutter::DlFilterMode::kNearest:
127 desc.
label =
"Nearest Sampler";
129 case flutter::DlFilterMode::kLinear:
131 desc.
label =
"Linear Sampler";
148 case flutter::DlDrawStyle::kFill:
150 case flutter::DlDrawStyle::kStroke:
152 case flutter::DlDrawStyle::kStrokeAndFill:
192 case flutter::DlStrokeCap::kButt:
195 case flutter::DlStrokeCap::kRound:
198 case flutter::DlStrokeCap::kSquare:
209 case flutter::DlStrokeJoin::kMiter:
212 case flutter::DlStrokeJoin::kRound:
215 case flutter::DlStrokeJoin::kBevel:
250 switch (blur_style) {
251 case flutter::DlBlurStyle::kNormal:
253 case flutter::DlBlurStyle::kSolid:
255 case flutter::DlBlurStyle::kOuter:
257 case flutter::DlBlurStyle::kInner:
267 if (filter ==
nullptr) {
271 switch (filter->type()) {
272 case flutter::DlMaskFilterType::kBlur: {
273 auto blur = filter->asBlur();
277 .sigma =
Sigma(blur->sigma()),
278 .respect_ctm = blur->respectCTM(),
301 const flutter::SaveLayerOptions& options,
302 uint32_t total_content_depth,
303 flutter::DlBlendMode max_content_mode,
304 const flutter::DlImageFilter* backdrop,
305 std::optional<int64_t> backdrop_id) {
308 auto paint = options.renders_with_attributes() ?
paint_ :
Paint{};
309 auto promise = options.content_is_clipped()
312 std::optional<Rect> impeller_bounds;
315 if (!options.content_is_unbounded() || options.bounds_from_caller()) {
316 impeller_bounds = bounds;
320 paint, impeller_bounds, backdrop, promise, total_content_depth,
323 options.can_distribute_opacity() && !options.content_is_unbounded(),
421 flutter::DlCanvas::ClipOp clip_op) {
423 case flutter::DlCanvas::ClipOp::kDifference:
425 case flutter::DlCanvas::ClipOp::kIntersect:
457 if (rrect.IsRect()) {
460 }
else if (rrect.IsOval()) {
463 }
else if (rrect.GetRadii().AreAllCornersSame()) {
479 if (path.IsRect(&rect)) {
482 }
else if (path.IsOval(&rect)) {
487 if (path.IsSkRRect(&rrect) && rrect.isSimple()) {
500 flutter::DlBlendMode dl_mode) {
529 Scalar length = p0.GetDistance(p1);
536 if (length > 0.0f && on_length >= 0.0f && off_length > 0.0f) {
537 Point delta = (p1 - p0) / length;
541 while (consumed < length) {
542 builder.
MoveTo(p0 + delta * consumed);
544 Scalar dash_end = consumed + on_length;
545 if (dash_end < length) {
546 builder.
LineTo(p0 + delta * dash_end);
554 consumed = dash_end + off_length;
601 builder.
SetBounds(outer.GetBounds().Union(inner.GetBounds()));
614 const Paint& paint) {
619 if (path.IsRect(&rect, &closed) && closed) {
625 if (path.IsSkRRect(&rrect) && rrect.isSimple()) {
630 if (path.IsOval(&rect)) {
635 canvas.
DrawPath(path.GetPath(), paint);
646 std::max(oval_bounds.GetWidth(), oval_bounds.GetHeight())) {
676 case flutter::DlCanvas::PointMode::kPoints: {
687 case flutter::DlCanvas::PointMode::kLines:
688 for (uint32_t i = 1; i < count; i += 2) {
689 Point p0 = points[i - 1];
690 Point p1 = points[i];
694 case flutter::DlCanvas::PointMode::kPolygon:
696 Point p0 = points[0];
697 for (uint32_t i = 1; i < count; i++) {
698 Point p1 = points[i];
708 const std::shared_ptr<flutter::DlVertices>& vertices,
709 flutter::DlBlendMode dl_mode) {}
714 flutter::DlImageSampling sampling,
715 bool render_with_attributes) {
722 auto texture = image->impeller_texture();
727 const auto size = texture->GetSize();
728 const auto src = DlRect::MakeWH(size.width, size.height);
729 const auto dest = DlRect::MakeXYWH(point.x, point.y, size.width, size.height);
735 render_with_attributes,
736 SrcRectConstraint::kStrict
742 const sk_sp<flutter::DlImage> image,
745 flutter::DlImageSampling sampling,
746 bool render_with_attributes,
747 SrcRectConstraint constraint = SrcRectConstraint::kFast) {
751 image->impeller_texture(),
763 flutter::DlFilterMode filter,
764 bool render_with_attributes) {
770 center.GetRight(), center.GetBottom()),
779 const flutter::DlColor colors[],
781 flutter::DlBlendMode mode,
782 flutter::DlImageSampling sampling,
784 bool render_with_attributes) {
792 static_cast<size_t>(count),
797 auto atlas_contents = std::make_shared<AtlasContents>();
798 atlas_contents->SetGeometry(&geometry);
805 const sk_sp<flutter::DisplayList> display_list,
826 if (opacity < SK_Scalar1) {
832 display_list->can_apply_group_opacity());
848 if (global_culling_bounds.has_value()) {
850 GetCanvas().GetCurrentTransform().Invert());
851 display_list->Dispatch(
852 *
this, SkRect::MakeLTRB(cull_rect.
GetLeft(), cull_rect.
GetTop(),
859 display_list->Dispatch(*
this);
881 const std::shared_ptr<TextFrame>& text_frame,
894 const flutter::DlColor color,
896 bool transparent_occluder,
901 spot_color.
alpha *= 0.25;
906 std::max(std::max(spot_color.
red, spot_color.
green), spot_color.
blue);
908 std::min(std::min(spot_color.
red, spot_color.
green), spot_color.
blue);
909 Scalar luminance = (min + max) * 0.5;
912 (2.6f + (-2.66667f + 1.06667f * spot_color.
alpha) * spot_color.
alpha) *
915 (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
917 color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
920 std::clamp(spot_color.
alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
922 Scalar color_scale = color_alpha * (1 - greyscale_alpha);
923 Scalar tonal_alpha = color_scale + greyscale_alpha;
924 Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
925 spot_color =
Color(unpremul_scale * spot_color.
red,
926 unpremul_scale * spot_color.
green,
927 unpremul_scale * spot_color.
blue, tonal_alpha);
930 Vector3 light_position(0, -1, 1);
931 Scalar occluder_z = dpr * elevation;
933 constexpr
Scalar kLightRadius = 800 / 600;
937 paint.
color = spot_color;
940 .sigma =
Radius{kLightRadius * occluder_z /
958 flutter::DlBlendMode max_root_blend_mode) {
967 bool has_root_backdrop_filter,
968 flutter::DlBlendMode max_root_blend_mode,
973 has_root_backdrop_filter ||
976 renderer_(renderer) {}
978 Canvas& CanvasDlDispatcher::GetCanvas() {
983 const std::shared_ptr<flutter::DlVertices>& vertices,
984 flutter::DlBlendMode dl_mode) {
988 std::make_shared<DlVerticesGeometry>(vertices, renderer_),
993 std::unordered_map<int64_t, BackdropData> backdrop,
994 size_t backdrop_count) {
1001 const Matrix& initial_matrix,
1002 const Rect cull_rect)
1003 : renderer_(renderer), matrix_(initial_matrix) {
1004 cull_rect_state_.push_back(cull_rect);
1008 FML_DCHECK(cull_rect_state_.size() == 1);
1012 stack_.emplace_back(matrix_);
1013 cull_rect_state_.push_back(cull_rect_state_.back());
1017 const flutter::SaveLayerOptions options,
1018 const flutter::DlImageFilter* backdrop,
1019 std::optional<int64_t> backdrop_id) {
1022 backdrop_count_ += (backdrop ==
nullptr ? 0 : 1);
1023 if (backdrop !=
nullptr && backdrop_id.has_value()) {
1024 std::shared_ptr<flutter::DlImageFilter> shared_backdrop =
1026 std::unordered_map<int64_t, BackdropData>::iterator existing =
1027 backdrop_data_.find(backdrop_id.value());
1028 if (existing == backdrop_data_.end()) {
1029 backdrop_data_[backdrop_id.value()] =
1033 data.backdrop_count++;
1034 if (
data.all_filters_equal) {
1035 data.all_filters_equal = (*
data.last_backdrop == *shared_backdrop);
1036 data.last_backdrop = shared_backdrop;
1043 auto global_cull_rect = cull_rect_state_.back();
1044 if (has_image_filter_ || global_cull_rect.IsMaximum()) {
1047 auto global_save_bounds = bounds.TransformBounds(matrix_);
1048 auto new_cull_rect = global_cull_rect.Intersection(global_save_bounds);
1049 if (new_cull_rect.has_value()) {
1050 cull_rect_state_.back() = new_cull_rect.value();
1058 matrix_ = stack_.back();
1060 cull_rect_state_.pop_back();
1068 matrix_ = matrix_.
Scale({sx, sy, 1.0f});
1084 mxx, myx, 0.0f, 0.0f,
1085 mxy, myy, 0.0f, 0.0f,
1086 0.0f, 0.0f, 1.0f, 0.0f,
1087 mxt, myt, 0.0f, 1.0f
1111 const std::shared_ptr<impeller::TextFrame>& text_frame,
1116 properties.
stroke =
true;
1122 if (text_frame->HasColor()) {
1135 (properties.
stroke || text_frame->HasColor())
1136 ? std::optional<GlyphProperties>(properties)
1141 const Rect FirstPassDispatcher::GetCurrentLocalCullingBounds()
const {
1142 auto cull_rect = cull_rect_state_.back();
1143 if (!cull_rect.IsEmpty() && !cull_rect.IsMaximum()) {
1145 cull_rect = cull_rect.TransformBounds(inverse);
1151 const sk_sp<flutter::DisplayList> display_list,
1153 [[maybe_unused]]
size_t stack_depth = stack_.size();
1155 Paint old_paint = paint_;
1157 bool old_has_image_filter = has_image_filter_;
1158 has_image_filter_ =
false;
1161 display_list->Dispatch(*
this);
1163 Rect local_cull_bounds = GetCurrentLocalCullingBounds();
1165 display_list->Dispatch(*
this);
1166 }
else if (!local_cull_bounds.
IsEmpty()) {
1168 display_list->Dispatch(*
this,
1169 SkIRect::MakeLTRB(cull_rect.
GetLeft(),
1179 has_image_filter_ = old_has_image_filter;
1180 FML_DCHECK(stack_depth == stack_.size());
1206 case flutter::DlStrokeCap::kButt:
1209 case flutter::DlStrokeCap::kRound:
1212 case flutter::DlStrokeCap::kSquare:
1221 case flutter::DlStrokeJoin::kMiter:
1224 case flutter::DlStrokeJoin::kRound:
1227 case flutter::DlStrokeJoin::kBevel:
1235 if (filter ==
nullptr) {
1236 has_image_filter_ =
false;
1238 has_image_filter_ =
true;
1242 std::pair<std::unordered_map<int64_t, BackdropData>,
size_t>
1244 std::unordered_map<int64_t, BackdropData> temp;
1245 std::swap(temp, backdrop_data_);
1246 return std::make_pair(temp, backdrop_count_);
1250 const sk_sp<flutter::DisplayList>& display_list,
1253 bool reset_host_buffer,
1254 bool generate_mips) {
1256 if (generate_mips) {
1263 context.
GetContext()->GetResourceAllocator());
1265 if (context.
GetContext()->GetCapabilities()->SupportsOffscreenMSAA()) {
1270 "Picture Snapshot MSAA",
1272 kDefaultColorAttachmentConfigMSAA
1281 kDefaultColorAttachmentConfig
1288 SkIRect sk_cull_rect = SkIRect::MakeWH(size.
width, size.
height);
1291 display_list->Dispatch(collector, sk_cull_rect);
1296 display_list->root_has_backdrop_filter(),
1297 display_list->max_root_blend_mode(),
1302 display_list->Dispatch(impeller_dispatcher, sk_cull_rect);
1305 if (reset_host_buffer) {
1309 context.
GetContext()->DisposeThreadLocalCachedResources();
1316 const sk_sp<flutter::DisplayList>& display_list,
1318 bool reset_host_buffer,
1321 cull_rect.right(), cull_rect.bottom());
1323 display_list->Dispatch(collector, cull_rect);
1329 display_list->root_has_backdrop_filter(),
1330 display_list->max_root_blend_mode(),
1335 display_list->Dispatch(impeller_dispatcher, cull_rect);
1337 if (reset_host_buffer) {
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.
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
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 clipRoundRect(const DlRoundRect &rrect, ClipOp clip_op, bool is_aa) 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 clipRect(const DlRect &rect, ClipOp clip_op, bool is_aa) 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, ClipOp clip_op, bool is_aa) override
void skew(DlScalar sx, DlScalar sy) 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 drawPoints(PointMode mode, uint32_t count, const DlPoint points[]) override
void drawImageRect(const sk_sp< flutter::DlImage > image, const DlRect &src, const DlRect &dst, flutter::DlImageSampling sampling, bool render_with_attributes, SrcRectConstraint constraint) 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 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 clipPath(const DlPath &path, ClipOp clip_op, bool is_aa) 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 Reset()
Resets the contents of the HostBuffer to nothing so it can be reused.
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 Scalar RoundScaledFontSize(Scalar scale)
#define AUTO_DEPTH_WATCHER(d)
#define AUTO_DEPTH_CHECK()
BlendMode ToBlendMode(flutter::DlBlendMode mode)
Size ToSize(const SkPoint &point)
impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlImageSampling options)
Rect ToRect(const SkRect &rect)
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
@ kRound
Points are drawn as squares.
@ kSquare
Points are drawn as circles.
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.
static bool RequiresReadbackForBlends(const ContentContext &renderer, flutter::DlBlendMode max_root_blend_mode)
Subclasses.
static Entity::ClipOperation ToClipOperation(flutter::DlCanvas::ClipOp clip_op)
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
std::shared_ptr< const fml::Mapping > data