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"
43 #define USE_DEPTH_WATCHER true
45 #define USE_DEPTH_WATCHER false
60 #define AUTO_DEPTH_WATCHER(d) \
61 DepthWatcher _watcher(__FILE__, __LINE__, GetCanvas(), \
62 paint_.mask_blur_descriptor.has_value(), d)
75 #define AUTO_DEPTH_CHECK() _watcher.check(__FILE__, __LINE__)
79 DepthWatcher(
const std::string& file,
87 allowed_(has_mask_blur ? allowed + 1 : allowed),
91 ~DepthWatcher() { check(file_, line_); }
93 void check(
const std::string& file,
int line) {
94 FML_CHECK(canvas_.GetOpDepth() <= (old_depth_ + allowed_) &&
95 canvas_.GetOpDepth() <= old_max_)
97 <<
"from " << file <<
":" << line << std::endl
98 <<
"old/allowed/current/max = " << old_depth_ <<
"/" << allowed_ <<
"/"
99 << canvas_.GetOpDepth() <<
"/" << old_max_;
103 const std::string file_;
107 const uint64_t allowed_;
108 const uint64_t old_depth_;
109 const uint64_t old_max_;
114 #define AUTO_DEPTH_WATCHER(d)
115 #define AUTO_DEPTH_CHECK()
119 #define UNIMPLEMENTED \
120 FML_DLOG(ERROR) << "Unimplemented detail in " << __FUNCTION__;
123 const flutter::DlFilterMode options) {
126 case flutter::DlFilterMode::kNearest:
128 desc.
label =
"Nearest Sampler";
130 case flutter::DlFilterMode::kLinear:
132 desc.
label =
"Linear Sampler";
141 if (rect ==
nullptr) {
156 case flutter::DlDrawStyle::kFill:
158 case flutter::DlDrawStyle::kStroke:
160 case flutter::DlDrawStyle::kStrokeAndFill:
200 case flutter::DlStrokeCap::kButt:
203 case flutter::DlStrokeCap::kRound:
206 case flutter::DlStrokeCap::kSquare:
217 case flutter::DlStrokeJoin::kMiter:
220 case flutter::DlStrokeJoin::kRound:
223 case flutter::DlStrokeJoin::kBevel:
258 switch (blur_style) {
259 case flutter::DlBlurStyle::kNormal:
261 case flutter::DlBlurStyle::kSolid:
263 case flutter::DlBlurStyle::kOuter:
265 case flutter::DlBlurStyle::kInner:
275 if (filter ==
nullptr) {
279 switch (filter->type()) {
280 case flutter::DlMaskFilterType::kBlur: {
281 auto blur = filter->asBlur();
285 .sigma =
Sigma(blur->sigma()),
286 .respect_ctm = blur->respectCTM(),
309 const flutter::SaveLayerOptions& options,
310 uint32_t total_content_depth,
311 flutter::DlBlendMode max_content_mode,
312 const flutter::DlImageFilter* backdrop,
313 std::optional<int64_t> backdrop_id) {
316 auto paint = options.renders_with_attributes() ?
paint_ :
Paint{};
317 auto promise = options.content_is_clipped()
320 std::optional<Rect> impeller_bounds;
323 if (!options.content_is_unbounded() || options.bounds_from_caller()) {
324 impeller_bounds = bounds;
328 paint, impeller_bounds, backdrop, promise, total_content_depth,
331 options.can_distribute_opacity() && !options.content_is_unbounded(),
416 case flutter::DlClipOp::kDifference:
418 case flutter::DlClipOp::kIntersect:
425 flutter::DlClipOp clip_op,
435 flutter::DlClipOp clip_op,
445 flutter::DlClipOp sk_op,
450 if (rrect.IsRect()) {
453 }
else if (rrect.IsOval()) {
456 }
else if (rrect.GetRadii().AreAllCornersSame()) {
467 flutter::DlClipOp sk_op,
475 }
else if (rse.IsOval()) {
486 flutter::DlClipOp sk_op,
493 if (path.IsRect(&rect)) {
496 }
else if (path.IsOval(&rect)) {
501 if (path.IsRoundRect(&rrect) && rrect.GetRadii().AreAllCornersSame()) {
513 flutter::DlBlendMode dl_mode) {
598 const Paint& paint) {
603 if (path.IsRect(&rect, &closed) && closed) {
609 if (path.IsRoundRect(&rrect) && rrect.GetRadii().AreAllCornersSame()) {
614 if (path.IsOval(&rect)) {
650 case flutter::DlPointMode::kPoints: {
661 case flutter::DlPointMode::kLines:
662 for (uint32_t i = 1; i < count; i += 2) {
668 case flutter::DlPointMode::kPolygon:
671 for (uint32_t i = 1; i < count; i++) {
682 const std::shared_ptr<flutter::DlVertices>& vertices,
683 flutter::DlBlendMode dl_mode) {}
688 flutter::DlImageSampling sampling,
689 bool render_with_attributes) {
696 auto texture = image->impeller_texture();
701 const auto size = texture->GetSize();
702 const auto src = DlRect::MakeWH(size.width, size.height);
703 const auto dest = DlRect::MakeXYWH(point.x, point.y, size.width, size.height);
709 render_with_attributes,
710 flutter::DlSrcRectConstraint::kStrict
718 flutter::DlImageSampling sampling,
719 bool render_with_attributes,
720 flutter::DlSrcRectConstraint constraint =
721 flutter::DlSrcRectConstraint::kFast) {
725 image->impeller_texture(),
737 flutter::DlFilterMode filter,
738 bool render_with_attributes) {
744 center.GetRight(), center.GetBottom()),
753 const flutter::DlColor colors[],
755 flutter::DlBlendMode mode,
756 flutter::DlImageSampling sampling,
758 bool render_with_attributes) {
766 static_cast<size_t>(count),
771 auto atlas_contents = std::make_shared<AtlasContents>();
772 atlas_contents->SetGeometry(&geometry);
779 const sk_sp<flutter::DisplayList> display_list,
800 if (opacity < SK_Scalar1) {
805 display_list->total_depth(),
806 display_list->can_apply_group_opacity());
822 if (global_culling_bounds.has_value()) {
824 GetCanvas().GetCurrentTransform().Invert());
825 display_list->Dispatch(*
this, cull_rect);
831 display_list->Dispatch(*
this);
848 auto text_frame = text->GetTextFrame();
852 FML_CHECK(text_frame !=
nullptr);
861 const flutter::DlColor color,
863 bool transparent_occluder,
868 spot_color.
alpha *= 0.25;
873 std::max(std::max(spot_color.
red, spot_color.
green), spot_color.
blue);
875 std::min(std::min(spot_color.
red, spot_color.
green), spot_color.
blue);
876 Scalar luminance = (min + max) * 0.5;
879 (2.6f + (-2.66667f + 1.06667f * spot_color.
alpha) * spot_color.
alpha) *
882 (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
884 color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
887 std::clamp(spot_color.
alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
889 Scalar color_scale = color_alpha * (1 - greyscale_alpha);
890 Scalar tonal_alpha = color_scale + greyscale_alpha;
891 Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
892 spot_color =
Color(unpremul_scale * spot_color.
red,
893 unpremul_scale * spot_color.
green,
894 unpremul_scale * spot_color.
blue, tonal_alpha);
897 Vector3 light_position(0, -1, 1);
898 Scalar occluder_z = dpr * elevation;
900 constexpr
Scalar kLightRadius = 800 / 600;
904 paint.
color = spot_color;
907 .sigma =
Radius{kLightRadius * occluder_z /
925 flutter::DlBlendMode max_root_blend_mode) {
933 bool has_root_backdrop_filter,
934 flutter::DlBlendMode max_root_blend_mode,
939 has_root_backdrop_filter ||
942 renderer_(renderer) {}
944 Canvas& CanvasDlDispatcher::GetCanvas() {
949 const std::shared_ptr<flutter::DlVertices>& vertices,
950 flutter::DlBlendMode dl_mode) {
954 std::make_shared<DlVerticesGeometry>(vertices, renderer_), dl_mode,
959 std::unordered_map<int64_t, BackdropData> backdrop,
960 size_t backdrop_count) {
967 const Matrix& initial_matrix,
968 const Rect cull_rect)
969 : renderer_(renderer), matrix_(initial_matrix) {
970 cull_rect_state_.push_back(cull_rect);
974 FML_DCHECK(cull_rect_state_.size() == 1);
978 stack_.emplace_back(matrix_);
979 cull_rect_state_.push_back(cull_rect_state_.back());
983 const flutter::SaveLayerOptions options,
984 const flutter::DlImageFilter* backdrop,
985 std::optional<int64_t> backdrop_id) {
988 backdrop_count_ += (backdrop ==
nullptr ? 0 : 1);
989 if (backdrop !=
nullptr && backdrop_id.has_value()) {
990 std::shared_ptr<flutter::DlImageFilter> shared_backdrop =
992 std::unordered_map<int64_t, BackdropData>::iterator existing =
993 backdrop_data_.find(backdrop_id.value());
994 if (existing == backdrop_data_.end()) {
995 backdrop_data_[backdrop_id.value()] =
999 data.backdrop_count++;
1000 if (
data.all_filters_equal) {
1001 data.all_filters_equal = (*
data.last_backdrop == *shared_backdrop);
1002 data.last_backdrop = shared_backdrop;
1009 auto global_cull_rect = cull_rect_state_.back();
1010 if (has_image_filter_ || global_cull_rect.IsMaximum()) {
1013 auto global_save_bounds = bounds.TransformBounds(matrix_);
1014 auto new_cull_rect = global_cull_rect.Intersection(global_save_bounds);
1015 if (new_cull_rect.has_value()) {
1016 cull_rect_state_.back() = new_cull_rect.value();
1024 matrix_ = stack_.back();
1026 cull_rect_state_.pop_back();
1034 matrix_ = matrix_.
Scale({sx, sy, 1.0f});
1051 mxx, myx, 0.0f, 0.0f,
1052 mxy, myy, 0.0f, 0.0f,
1053 0.0f, 0.0f, 1.0f, 0.0f,
1054 mxt, myt, 0.0f, 1.0f
1083 auto text_frame = text->GetTextFrame();
1084 if (text_frame ==
nullptr) {
1092 if (text_frame->HasColor()) {
1105 (properties.
stroke.has_value() || text_frame->HasColor())
1106 ? std::optional<GlyphProperties>(properties)
1111 const Rect FirstPassDispatcher::GetCurrentLocalCullingBounds()
const {
1112 auto cull_rect = cull_rect_state_.back();
1113 if (!cull_rect.IsEmpty() && !cull_rect.IsMaximum()) {
1115 cull_rect = cull_rect.TransformBounds(inverse);
1121 const sk_sp<flutter::DisplayList> display_list,
1123 [[maybe_unused]]
size_t stack_depth = stack_.size();
1125 Paint old_paint = paint_;
1127 bool old_has_image_filter = has_image_filter_;
1128 has_image_filter_ =
false;
1131 display_list->Dispatch(*
this);
1133 Rect local_cull_bounds = GetCurrentLocalCullingBounds();
1135 display_list->Dispatch(*
this);
1136 }
else if (!local_cull_bounds.
IsEmpty()) {
1137 DlIRect cull_rect = DlIRect::RoundOut(local_cull_bounds);
1138 display_list->Dispatch(*
this, cull_rect);
1144 has_image_filter_ = old_has_image_filter;
1145 FML_DCHECK(stack_depth == stack_.size());
1171 case flutter::DlStrokeCap::kButt:
1174 case flutter::DlStrokeCap::kRound:
1177 case flutter::DlStrokeCap::kSquare:
1186 case flutter::DlStrokeJoin::kMiter:
1189 case flutter::DlStrokeJoin::kRound:
1192 case flutter::DlStrokeJoin::kBevel:
1200 if (filter ==
nullptr) {
1201 has_image_filter_ =
false;
1203 has_image_filter_ =
true;
1207 std::pair<std::unordered_map<int64_t, BackdropData>,
size_t>
1209 std::unordered_map<int64_t, BackdropData> temp;
1210 std::swap(temp, backdrop_data_);
1211 return std::make_pair(temp, backdrop_count_);
1215 const sk_sp<flutter::DisplayList>& display_list,
1218 bool reset_host_buffer,
1219 bool generate_mips) {
1221 if (generate_mips) {
1228 context.
GetContext()->GetResourceAllocator());
1230 if (context.
GetContext()->GetCapabilities()->SupportsOffscreenMSAA()) {
1235 "Picture Snapshot MSAA",
1237 kDefaultColorAttachmentConfigMSAA
1246 kDefaultColorAttachmentConfig
1256 display_list->Dispatch(collector, cull_rect);
1261 display_list->root_has_backdrop_filter(),
1262 display_list->max_root_blend_mode(),
1268 fml::ScopedCleanupClosure cleanup([&] {
1269 if (reset_host_buffer) {
1275 context.
GetContext()->DisposeThreadLocalCachedResources();
1278 display_list->Dispatch(impeller_dispatcher, cull_rect);
1286 const sk_sp<flutter::DisplayList>& display_list,
1288 bool reset_host_buffer,
1291 display_list->Dispatch(collector, cull_rect);
1297 display_list->root_has_backdrop_filter(),
1298 display_list->max_root_blend_mode(),
1304 fml::ScopedCleanupClosure cleanup([&] {
1305 if (reset_host_buffer) {
1311 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, IRect32 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 DrawDashedLine(const Point &p0, const Point &p1, Scalar on_length, Scalar off_length, const Paint &paint)
void DrawDiffRoundRect(const RoundRect &outer, const RoundRect &inner, const Paint &paint)
void DrawPath(const flutter::DlPath &path, const Paint &paint)
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 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)
void DrawArc(const Arc &arc, const Paint &paint)
virtual bool SupportsFramebufferFetch() const =0
Whether the context backend is able to support pipelines with shaders that read from the framebuffer ...
const std::shared_ptr< LazyGlyphAtlas > & GetLazyGlyphAtlas() const
void ResetTransientsBuffers()
Resets the transients buffers held onto by the content context.
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 drawText(const std::shared_ptr< flutter::DlText > &text, DlScalar x, DlScalar y) 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 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 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)
A Geometry class that can directly generate vertices (with or without texture coordinates) for filled...
static constexpr BlendMode kLastPipelineBlendMode
A Geometry that produces fillable vertices from a |DlPath| object using the |FillPathSourceGeometry| ...
A Geometry class that produces fillable vertices from any |RoundRect| object regardless of radii unif...
@ 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 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 drawText(const std::shared_ptr< flutter::DlText > &text, DlScalar x, DlScalar y) 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)
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
A Geometry class that generates fillable vertices (with or without texture coordinates) directly from...
A Geometry class that generates fillable vertices (with or without texture coordinates) directly from...
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)
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...
bool RenderToTarget(ContentContext &context, RenderTarget render_target, const sk_sp< flutter::DisplayList > &display_list, Rect cull_rect, bool reset_host_buffer, bool is_onscreen)
Render the provided display list to the render target.
@ 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
std::optional< StrokeParameters > stroke
A 4x4 matrix using column-major storage.
static constexpr Matrix MakeTranslation(const Vector3 &t)
constexpr Matrix Translate(const Vector3 &t) 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 TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
constexpr bool IsMaximum() const
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
RoundOut(const TRect< U > &r)
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::vector< Point > points
std::shared_ptr< const fml::Mapping > data