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"
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";
140 if (rect ==
nullptr) {
155 case flutter::DlDrawStyle::kFill:
157 case flutter::DlDrawStyle::kStroke:
159 case flutter::DlDrawStyle::kStrokeAndFill:
199 case flutter::DlStrokeCap::kButt:
202 case flutter::DlStrokeCap::kRound:
205 case flutter::DlStrokeCap::kSquare:
216 case flutter::DlStrokeJoin::kMiter:
219 case flutter::DlStrokeJoin::kRound:
222 case flutter::DlStrokeJoin::kBevel:
257 switch (blur_style) {
258 case flutter::DlBlurStyle::kNormal:
260 case flutter::DlBlurStyle::kSolid:
262 case flutter::DlBlurStyle::kOuter:
264 case flutter::DlBlurStyle::kInner:
274 if (filter ==
nullptr) {
278 switch (filter->type()) {
279 case flutter::DlMaskFilterType::kBlur: {
280 auto blur = filter->asBlur();
284 .sigma =
Sigma(blur->sigma()),
285 .respect_ctm = blur->respectCTM(),
308 const flutter::SaveLayerOptions& options,
309 uint32_t total_content_depth,
310 flutter::DlBlendMode max_content_mode,
311 const flutter::DlImageFilter* backdrop,
312 std::optional<int64_t> backdrop_id) {
315 auto paint = options.renders_with_attributes() ?
paint_ :
Paint{};
316 auto promise = options.content_is_clipped()
319 std::optional<Rect> impeller_bounds;
322 if (!options.content_is_unbounded() || options.bounds_from_caller()) {
323 impeller_bounds = bounds;
327 paint, impeller_bounds, backdrop, promise, total_content_depth,
330 options.can_distribute_opacity() && !options.content_is_unbounded(),
429 case flutter::DlClipOp::kDifference:
431 case flutter::DlClipOp::kIntersect:
438 flutter::DlClipOp clip_op,
448 flutter::DlClipOp clip_op,
458 flutter::DlClipOp sk_op,
463 if (rrect.IsRect()) {
466 }
else if (rrect.IsOval()) {
469 }
else if (rrect.GetRadii().AreAllCornersSame()) {
480 flutter::DlClipOp sk_op,
488 }
else if (rse.IsOval()) {
499 flutter::DlClipOp sk_op,
506 if (path.IsRect(&rect)) {
509 }
else if (path.IsOval(&rect)) {
514 if (path.IsRoundRect(&rrect) && rrect.GetRadii().AreAllCornersSame()) {
526 flutter::DlBlendMode dl_mode) {
611 const Paint& paint) {
616 if (path.IsRect(&rect, &closed) && closed) {
622 if (path.IsRoundRect(&rrect) && rrect.GetRadii().AreAllCornersSame()) {
627 if (path.IsOval(&rect)) {
663 case flutter::DlPointMode::kPoints: {
674 case flutter::DlPointMode::kLines:
675 for (uint32_t i = 1; i < count; i += 2) {
681 case flutter::DlPointMode::kPolygon:
684 for (uint32_t i = 1; i < count; i++) {
695 const std::shared_ptr<flutter::DlVertices>& vertices,
696 flutter::DlBlendMode dl_mode) {}
701 flutter::DlImageSampling sampling,
702 bool render_with_attributes) {
709 auto texture = image->impeller_texture();
714 const auto size = texture->GetSize();
715 const auto src = DlRect::MakeWH(size.width, size.height);
716 const auto dest = DlRect::MakeXYWH(point.x, point.y, size.width, size.height);
722 render_with_attributes,
723 flutter::DlSrcRectConstraint::kStrict
731 flutter::DlImageSampling sampling,
732 bool render_with_attributes,
733 flutter::DlSrcRectConstraint constraint =
734 flutter::DlSrcRectConstraint::kFast) {
738 image->impeller_texture(),
750 flutter::DlFilterMode filter,
751 bool render_with_attributes) {
757 center.GetRight(), center.GetBottom()),
766 const flutter::DlColor colors[],
768 flutter::DlBlendMode mode,
769 flutter::DlImageSampling sampling,
771 bool render_with_attributes) {
779 static_cast<size_t>(count),
784 auto atlas_contents = std::make_shared<AtlasContents>();
785 atlas_contents->SetGeometry(&geometry);
792 const sk_sp<flutter::DisplayList> display_list,
813 if (opacity < SK_Scalar1) {
818 display_list->total_depth(),
819 display_list->can_apply_group_opacity());
835 if (global_culling_bounds.has_value()) {
837 GetCanvas().GetCurrentTransform().Invert());
838 display_list->Dispatch(*
this, cull_rect);
844 display_list->Dispatch(*
this);
866 const std::shared_ptr<TextFrame>& text_frame,
879 const flutter::DlColor color,
881 bool transparent_occluder,
886 spot_color.
alpha *= 0.25;
891 std::max(std::max(spot_color.
red, spot_color.
green), spot_color.
blue);
893 std::min(std::min(spot_color.
red, spot_color.
green), spot_color.
blue);
894 Scalar luminance = (min + max) * 0.5;
897 (2.6f + (-2.66667f + 1.06667f * spot_color.
alpha) * spot_color.
alpha) *
900 (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
902 color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
905 std::clamp(spot_color.
alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
907 Scalar color_scale = color_alpha * (1 - greyscale_alpha);
908 Scalar tonal_alpha = color_scale + greyscale_alpha;
909 Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
910 spot_color =
Color(unpremul_scale * spot_color.
red,
911 unpremul_scale * spot_color.
green,
912 unpremul_scale * spot_color.
blue, tonal_alpha);
915 Vector3 light_position(0, -1, 1);
916 Scalar occluder_z = dpr * elevation;
918 constexpr
Scalar kLightRadius = 800 / 600;
922 paint.
color = spot_color;
925 .sigma =
Radius{kLightRadius * occluder_z /
943 flutter::DlBlendMode max_root_blend_mode) {
951 bool has_root_backdrop_filter,
952 flutter::DlBlendMode max_root_blend_mode,
957 has_root_backdrop_filter ||
960 renderer_(renderer) {}
962 Canvas& CanvasDlDispatcher::GetCanvas() {
967 const std::shared_ptr<flutter::DlVertices>& vertices,
968 flutter::DlBlendMode dl_mode) {
972 std::make_shared<DlVerticesGeometry>(vertices, renderer_), dl_mode,
977 std::unordered_map<int64_t, BackdropData> backdrop,
978 size_t backdrop_count) {
985 const Matrix& initial_matrix,
986 const Rect cull_rect)
987 : renderer_(renderer), matrix_(initial_matrix) {
988 cull_rect_state_.push_back(cull_rect);
992 FML_DCHECK(cull_rect_state_.size() == 1);
996 stack_.emplace_back(matrix_);
997 cull_rect_state_.push_back(cull_rect_state_.back());
1001 const flutter::SaveLayerOptions options,
1002 const flutter::DlImageFilter* backdrop,
1003 std::optional<int64_t> backdrop_id) {
1006 backdrop_count_ += (backdrop ==
nullptr ? 0 : 1);
1007 if (backdrop !=
nullptr && backdrop_id.has_value()) {
1008 std::shared_ptr<flutter::DlImageFilter> shared_backdrop =
1010 std::unordered_map<int64_t, BackdropData>::iterator existing =
1011 backdrop_data_.find(backdrop_id.value());
1012 if (existing == backdrop_data_.end()) {
1013 backdrop_data_[backdrop_id.value()] =
1017 data.backdrop_count++;
1018 if (
data.all_filters_equal) {
1019 data.all_filters_equal = (*
data.last_backdrop == *shared_backdrop);
1020 data.last_backdrop = shared_backdrop;
1027 auto global_cull_rect = cull_rect_state_.back();
1028 if (has_image_filter_ || global_cull_rect.IsMaximum()) {
1031 auto global_save_bounds = bounds.TransformBounds(matrix_);
1032 auto new_cull_rect = global_cull_rect.Intersection(global_save_bounds);
1033 if (new_cull_rect.has_value()) {
1034 cull_rect_state_.back() = new_cull_rect.value();
1042 matrix_ = stack_.back();
1044 cull_rect_state_.pop_back();
1052 matrix_ = matrix_.
Scale({sx, sy, 1.0f});
1068 mxx, myx, 0.0f, 0.0f,
1069 mxy, myy, 0.0f, 0.0f,
1070 0.0f, 0.0f, 1.0f, 0.0f,
1071 mxt, myt, 0.0f, 1.0f
1095 const std::shared_ptr<impeller::TextFrame>& text_frame,
1102 if (text_frame->HasColor()) {
1115 (properties.
stroke.has_value() || text_frame->HasColor())
1116 ? std::optional<GlyphProperties>(properties)
1121 const Rect FirstPassDispatcher::GetCurrentLocalCullingBounds()
const {
1122 auto cull_rect = cull_rect_state_.back();
1123 if (!cull_rect.IsEmpty() && !cull_rect.IsMaximum()) {
1125 cull_rect = cull_rect.TransformBounds(inverse);
1131 const sk_sp<flutter::DisplayList> display_list,
1133 [[maybe_unused]]
size_t stack_depth = stack_.size();
1135 Paint old_paint = paint_;
1137 bool old_has_image_filter = has_image_filter_;
1138 has_image_filter_ =
false;
1141 display_list->Dispatch(*
this);
1143 Rect local_cull_bounds = GetCurrentLocalCullingBounds();
1145 display_list->Dispatch(*
this);
1146 }
else if (!local_cull_bounds.
IsEmpty()) {
1147 DlIRect cull_rect = DlIRect::RoundOut(local_cull_bounds);
1148 display_list->Dispatch(*
this, cull_rect);
1154 has_image_filter_ = old_has_image_filter;
1155 FML_DCHECK(stack_depth == stack_.size());
1181 case flutter::DlStrokeCap::kButt:
1184 case flutter::DlStrokeCap::kRound:
1187 case flutter::DlStrokeCap::kSquare:
1196 case flutter::DlStrokeJoin::kMiter:
1199 case flutter::DlStrokeJoin::kRound:
1202 case flutter::DlStrokeJoin::kBevel:
1210 if (filter ==
nullptr) {
1211 has_image_filter_ =
false;
1213 has_image_filter_ =
true;
1217 std::pair<std::unordered_map<int64_t, BackdropData>,
size_t>
1219 std::unordered_map<int64_t, BackdropData> temp;
1220 std::swap(temp, backdrop_data_);
1221 return std::make_pair(temp, backdrop_count_);
1225 const sk_sp<flutter::DisplayList>& display_list,
1228 bool reset_host_buffer,
1229 bool generate_mips) {
1231 if (generate_mips) {
1238 context.
GetContext()->GetResourceAllocator());
1240 if (context.
GetContext()->GetCapabilities()->SupportsOffscreenMSAA()) {
1245 "Picture Snapshot MSAA",
1247 kDefaultColorAttachmentConfigMSAA
1256 kDefaultColorAttachmentConfig
1266 display_list->Dispatch(collector, cull_rect);
1271 display_list->root_has_backdrop_filter(),
1272 display_list->max_root_blend_mode(),
1278 fml::ScopedCleanupClosure cleanup([&] {
1279 if (reset_host_buffer) {
1284 context.
GetContext()->DisposeThreadLocalCachedResources();
1287 display_list->Dispatch(impeller_dispatcher, cull_rect);
1295 const sk_sp<flutter::DisplayList>& display_list,
1297 bool reset_host_buffer,
1300 display_list->Dispatch(collector, cull_rect);
1306 display_list->root_has_backdrop_filter(),
1307 display_list->max_root_blend_mode(),
1313 fml::ScopedCleanupClosure cleanup([&] {
1314 if (reset_host_buffer) {
1320 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 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 ...
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)
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 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)
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