 |
Flutter Impeller
|
|
Go to the documentation of this file.
14 #include "display_list/effects/dl_color_source.h"
15 #include "flutter/fml/logging.h"
39 #define USE_DEPTH_WATCHER true
41 #define USE_DEPTH_WATCHER false
42 #endif // !defined(NDEBUG)
56 #define AUTO_DEPTH_WATCHER(d) \
57 DepthWatcher _watcher(__FILE__, __LINE__, GetCanvas(), \
58 paint_.mask_blur_descriptor.has_value(), d)
71 #define AUTO_DEPTH_CHECK() _watcher.check(__FILE__, __LINE__)
75 DepthWatcher(
const std::string& file,
83 allowed_(has_mask_blur ? allowed + 1 : allowed),
87 ~DepthWatcher() { check(file_, line_); }
89 void check(
const std::string& file,
int line) {
90 FML_CHECK(canvas_.GetOpDepth() <= (old_depth_ + allowed_) &&
91 canvas_.GetOpDepth() <= old_max_)
93 <<
"from " << file <<
":" << line << std::endl
94 <<
"old/allowed/current/max = " << old_depth_ <<
"/" << allowed_ <<
"/"
95 << canvas_.GetOpDepth() <<
"/" << old_max_;
99 const std::string file_;
103 const uint64_t allowed_;
104 const uint64_t old_depth_;
105 const uint64_t old_max_;
108 #else // USE_DEPTH_WATCHER
110 #define AUTO_DEPTH_WATCHER(d)
111 #define AUTO_DEPTH_CHECK()
113 #endif // USE_DEPTH_WATCHER
115 #define UNIMPLEMENTED \
116 FML_DLOG(ERROR) << "Unimplemented detail in " << __FUNCTION__;
119 const flutter::DlFilterMode options) {
122 case flutter::DlFilterMode::kNearest:
124 desc.
label =
"Nearest Sampler";
126 case flutter::DlFilterMode::kLinear:
128 desc.
label =
"Linear Sampler";
145 case flutter::DlDrawStyle::kFill:
147 case flutter::DlDrawStyle::kStroke:
149 case flutter::DlDrawStyle::kStrokeAndFill:
189 case flutter::DlStrokeCap::kButt:
192 case flutter::DlStrokeCap::kRound:
195 case flutter::DlStrokeCap::kSquare:
206 case flutter::DlStrokeJoin::kMiter:
209 case flutter::DlStrokeJoin::kRound:
212 case flutter::DlStrokeJoin::kBevel:
222 if (!source || source->type() == flutter::DlColorSourceType::kColor) {
251 switch (blur_style) {
252 case flutter::DlBlurStyle::kNormal:
254 case flutter::DlBlurStyle::kSolid:
256 case flutter::DlBlurStyle::kOuter:
258 case flutter::DlBlurStyle::kInner:
268 if (filter ==
nullptr) {
272 switch (filter->type()) {
273 case flutter::DlMaskFilterType::kBlur: {
274 auto blur = filter->asBlur();
278 .sigma =
Sigma(blur->sigma()),
279 .respect_ctm = blur->respectCTM(),
302 const flutter::SaveLayerOptions& options,
303 uint32_t total_content_depth,
304 flutter::DlBlendMode max_content_mode,
305 const flutter::DlImageFilter* backdrop) {
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());
419 flutter::DlCanvas::ClipOp clip_op) {
421 case flutter::DlCanvas::ClipOp::kDifference:
423 case flutter::DlCanvas::ClipOp::kIntersect:
454 if (rrect.isRect()) {
457 }
else if (rrect.isOval()) {
460 }
else if (rrect.isSimple()) {
479 if (path.IsRect(&rect)) {
481 }
else if (path.IsOval(&rect)) {
485 if (path.IsSkRRect(&rrect) && rrect.isSimple()) {
499 flutter::DlBlendMode dl_mode) {
528 Scalar length = p0.GetDistance(p1);
534 if (length > 0.0f && on_length >= 0.0f && off_length > 0.0f) {
535 Point delta = (p1 - p0) / length;
539 while (consumed < length) {
540 builder.
MoveTo(p0 + delta * consumed);
542 Scalar dash_end = consumed + on_length;
543 if (dash_end < length) {
544 builder.
LineTo(p0 + delta * dash_end);
552 consumed = dash_end + off_length;
616 const Paint& paint) {
621 if (path.IsRect(&rect, &closed) && closed) {
627 if (path.IsSkRRect(&rrect) && rrect.isSimple()) {
633 if (path.IsOval(&rect)) {
638 canvas.
DrawPath(path.GetPath(), paint);
663 case flutter::DlCanvas::PointMode::kPoints: {
674 case flutter::DlCanvas::PointMode::kLines:
675 for (uint32_t i = 1; i < count; i += 2) {
676 Point p0 = points[i - 1];
677 Point p1 = points[i];
681 case flutter::DlCanvas::PointMode::kPolygon:
683 Point p0 = points[0];
684 for (uint32_t i = 1; i < count; i++) {
685 Point p1 = points[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 SrcRectConstraint::kStrict
729 const sk_sp<flutter::DlImage> image,
732 flutter::DlImageSampling sampling,
733 bool render_with_attributes,
734 SrcRectConstraint constraint = SrcRectConstraint::kFast) {
738 image->impeller_texture(),
750 flutter::DlFilterMode filter,
751 bool render_with_attributes) {
757 center.GetRight(), center.GetBottom()),
764 const SkRSXform xform[],
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) {
819 display_list->can_apply_group_opacity());
835 if (global_culling_bounds.has_value()) {
837 GetCanvas().GetCurrentTransform().Invert());
838 display_list->Dispatch(
839 *
this, SkRect::MakeLTRB(cull_rect.
GetLeft(), cull_rect.
GetTop(),
846 display_list->Dispatch(*
this);
868 const std::shared_ptr<TextFrame>& text_frame,
881 const flutter::DlColor
color,
883 bool transparent_occluder,
888 spot_color.
alpha *= 0.25;
893 std::max(std::max(spot_color.
red, spot_color.
green), spot_color.
blue);
895 std::min(std::min(spot_color.
red, spot_color.
green), spot_color.
blue);
896 Scalar luminance = (min + max) * 0.5;
899 (2.6f + (-2.66667f + 1.06667f * spot_color.
alpha) * spot_color.
alpha) *
902 (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
904 color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
907 std::clamp(spot_color.
alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
909 Scalar color_scale = color_alpha * (1 - greyscale_alpha);
910 Scalar tonal_alpha = color_scale + greyscale_alpha;
911 Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
912 spot_color =
Color(unpremul_scale * spot_color.
red,
913 unpremul_scale * spot_color.
green,
914 unpremul_scale * spot_color.
blue, tonal_alpha);
917 Vector3 light_position(0, -1, 1);
918 Scalar occluder_z = dpr * elevation;
920 constexpr
Scalar kLightRadius = 800 / 600;
924 paint.
color = spot_color;
927 .sigma =
Radius{kLightRadius * occluder_z /
945 flutter::DlBlendMode max_root_blend_mode) {
953 bool has_root_backdrop_filter,
954 flutter::DlBlendMode max_root_blend_mode,
958 has_root_backdrop_filter ||
961 renderer_(renderer) {}
963 Canvas& CanvasDlDispatcher::GetCanvas() {
968 const std::shared_ptr<flutter::DlVertices>& vertices,
969 flutter::DlBlendMode dl_mode) {
973 std::make_shared<DlVerticesGeometry>(vertices, renderer_),
980 const Matrix& initial_matrix,
981 const Rect cull_rect)
982 : renderer_(renderer), matrix_(initial_matrix) {
983 cull_rect_state_.push_back(cull_rect);
987 FML_DCHECK(cull_rect_state_.size() == 1);
991 stack_.emplace_back(matrix_);
992 cull_rect_state_.push_back(cull_rect_state_.back());
996 const flutter::SaveLayerOptions options,
997 const flutter::DlImageFilter* backdrop) {
1002 auto global_cull_rect = cull_rect_state_.back();
1003 if (has_image_filter_ || global_cull_rect.IsMaximum()) {
1006 auto global_save_bounds = bounds.TransformBounds(matrix_);
1007 auto new_cull_rect = global_cull_rect.Intersection(global_save_bounds);
1008 if (new_cull_rect.has_value()) {
1009 cull_rect_state_.back() = new_cull_rect.value();
1017 matrix_ = stack_.back();
1019 cull_rect_state_.pop_back();
1027 matrix_ = matrix_.
Scale({sx, sy, 1.0f});
1043 mxx, myx, 0.0f, 0.0f,
1044 mxy, myy, 0.0f, 0.0f,
1045 0.0f, 0.0f, 1.0f, 0.0f,
1046 mxt, myt, 0.0f, 1.0f
1070 const std::shared_ptr<impeller::TextFrame>& text_frame,
1075 properties.
stroke =
true;
1081 if (text_frame->HasColor()) {
1095 const Rect TextFrameDispatcher::GetCurrentLocalCullingBounds()
const {
1096 auto cull_rect = cull_rect_state_.back();
1097 if (!cull_rect.IsEmpty() && !cull_rect.IsMaximum()) {
1099 cull_rect = cull_rect.TransformBounds(inverse);
1105 const sk_sp<flutter::DisplayList> display_list,
1107 [[maybe_unused]]
size_t stack_depth = stack_.size();
1109 Paint old_paint = paint_;
1111 bool old_has_image_filter = has_image_filter_;
1112 has_image_filter_ =
false;
1115 display_list->Dispatch(*
this);
1117 Rect local_cull_bounds = GetCurrentLocalCullingBounds();
1119 display_list->Dispatch(*
this);
1120 }
else if (!local_cull_bounds.
IsEmpty()) {
1122 display_list->Dispatch(*
this, SkIRect::MakeLTRB(cull_rect.
GetLeft(),
1132 has_image_filter_ = old_has_image_filter;
1133 FML_DCHECK(stack_depth == stack_.size());
1159 case flutter::DlStrokeCap::kButt:
1162 case flutter::DlStrokeCap::kRound:
1165 case flutter::DlStrokeCap::kSquare:
1174 case flutter::DlStrokeJoin::kMiter:
1177 case flutter::DlStrokeJoin::kRound:
1180 case flutter::DlStrokeJoin::kBevel:
1188 if (filter ==
nullptr) {
1189 has_image_filter_ =
false;
1191 has_image_filter_ =
true;
1196 const sk_sp<flutter::DisplayList>& display_list,
1199 bool reset_host_buffer,
1200 bool generate_mips) {
1202 if (generate_mips) {
1209 context.
GetContext()->GetResourceAllocator());
1211 if (context.
GetContext()->GetCapabilities()->SupportsOffscreenMSAA()) {
1216 "Picture Snapshot MSAA",
1218 kDefaultColorAttachmentConfigMSAA
1227 kDefaultColorAttachmentConfig
1231 SkIRect sk_cull_rect = SkIRect::MakeWH(size.
width, size.
height);
1234 display_list->Dispatch(collector, sk_cull_rect);
1238 display_list->root_has_backdrop_filter(),
1239 display_list->max_root_blend_mode(),
1242 display_list->Dispatch(impeller_dispatcher, sk_cull_rect);
1245 if (reset_host_buffer) {
1255 const sk_sp<flutter::DisplayList>& display_list,
1257 bool reset_host_buffer) {
1259 cull_rect.right(), cull_rect.bottom());
1261 display_list->Dispatch(collector, cull_rect);
1266 display_list->root_has_backdrop_filter(),
1267 display_list->max_root_blend_mode(),
1270 display_list->Dispatch(impeller_dispatcher, cull_rect);
1272 if (reset_host_buffer) {
void drawDRRect(const SkRRect &outer, const SkRRect &inner) override
#define AUTO_DEPTH_WATCHER(d)
static constexpr Matrix MakeSkew(Scalar sx, Scalar sy)
void transformReset() override
constexpr bool HasPerspective() const
void DrawPoints(std::vector< Point > points, Scalar radius, const Paint &paint, PointStyle point_style)
void setStrokeWidth(DlScalar width) override
void drawRect(const DlRect &rect) override
static Entity::ClipOperation ToClipOperation(flutter::DlCanvas::ClipOp clip_op)
static constexpr BlendMode kLastPipelineBlendMode
void scale(DlScalar sx, DlScalar sy) override
virtual RenderTarget CreateOffscreen(const Context &context, ISize size, int mip_count, const std::string &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)
void DrawRRect(const Rect &rect, const Size &corner_radii, const Paint &paint)
std::vector< Point > ToPoints(const SkPoint points[], int count)
void RestoreToCount(size_t count)
void save(uint32_t total_content_depth) override
void drawColor(flutter::DlColor color, flutter::DlBlendMode mode) override
@ kMayClipContents
The caller claims the bounds are a subset of an estimate of the reasonably tight bounds but likely cl...
const std::shared_ptr< LazyGlyphAtlas > & GetLazyGlyphAtlas() const
bool IsNearlySimpleRRect(const SkRRect &rr)
Like SkRRect.isSimple, but allows the corners to differ by kEhCloseEnough.
ContentContext & GetContentContext() const
void setDrawStyle(flutter::DlDrawStyle style) 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
TextFrameDispatcher(const ContentContext &renderer, const Matrix &initial_matrix, const Rect cull_rect)
void setStrokeJoin(flutter::DlStrokeJoin join) override
void setStrokeCap(flutter::DlStrokeCap cap) override
Size ToSize(const SkPoint &point)
void scale(DlScalar sx, DlScalar sy) override
void Skew(Scalar sx, Scalar sy)
void saveLayer(const DlRect &bounds, const flutter::SaveLayerOptions &options, uint32_t total_content_depth, flutter::DlBlendMode max_content_mode, const flutter::DlImageFilter *backdrop) override
bool RenderToOnscreen(ContentContext &context, RenderTarget render_target, const sk_sp< flutter::DisplayList > &display_list, SkIRect cull_rect, bool reset_host_buffer)
Render the provided display list to the render target.
impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlImageSampling options)
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)
void drawTextFrame(const std::shared_ptr< impeller::TextFrame > &text_frame, DlScalar x, DlScalar y) override
void DrawTextFrame(const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint)
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
PathBuilder & AddPath(const Path &path)
constexpr bool IsMaximum() const
void translate(DlScalar tx, DlScalar ty) override
FilterContents::BlurStyle style
@ kRound
Points are drawn as squares.
void DrawVertices(const std::shared_ptr< VerticesGeometry > &vertices, BlendMode blend_mode, const Paint &paint)
Color ToColor(const flutter::DlColor &color)
void setStrokeCap(flutter::DlStrokeCap cap) override
void setColorFilter(const flutter::DlColorFilter *filter) override
static std::unique_ptr< Geometry > MakeOval(const Rect &rect)
void drawShadow(const DlPath &path, const flutter::DlColor color, const DlScalar elevation, bool transparent_occluder, DlScalar dpr) override
void drawTextFrame(const std::shared_ptr< impeller::TextFrame > &text_frame, DlScalar x, DlScalar y) override
@ kNormal
Blurred inside and outside.
void drawCircle(const DlPoint ¢er, DlScalar radius) override
const flutter::DlColorFilter * color_filter
void setStrokeMiter(DlScalar limit) override
static constexpr Matrix MakeTranslation(const Vector3 &t)
void DrawLine(const Point &p0, const Point &p1, const Paint &paint)
#define AUTO_DEPTH_CHECK()
void translate(DlScalar tx, DlScalar ty) override
void setImageFilter(const flutter::DlImageFilter *filter) override
void DrawRect(const Rect &rect, const Paint &paint)
const Matrix & GetCurrentTransform() const
BlendMode ToBlendMode(flutter::DlBlendMode mode)
void drawLine(const DlPoint &p0, const DlPoint &p1) override
void drawAtlas(const sk_sp< flutter::DlImage > atlas, const SkRSXform 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 drawVertices(const std::shared_ptr< flutter::DlVertices > &vertices, flutter::DlBlendMode dl_mode) override
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
RoundOut(const TRect< U > &r)
void transform2DAffine(DlScalar mxx, DlScalar mxy, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myt) override
@ kNearest
Select nearest to the sample point. Most widely supported.
A wrapper around data provided by a drawAtlas call.
void setColor(flutter::DlColor color) override
Rect ToRect(const SkRect &rect)
uint64_t GetMaxOpDepth() const
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
static impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlFilterMode options)
@ kSquare
Points are drawn as circles.
void drawRRect(const SkRRect &rrect) override
std::shared_ptr< Texture > GetRenderTargetTexture() const
constexpr auto GetLeft() const
void Scale(const Vector2 &scale)
void drawPoints(PointMode mode, uint32_t count, const DlPoint points[]) override
void setImageFilter(const flutter::DlImageFilter *filter) override
void clipPath(const DlPath &path, ClipOp clip_op, bool is_aa) override
void setColorSource(const flutter::DlColorSource *source) override
For convolution filters, the "radius" is the size of the convolution kernel to use on the local space...
@ kSolid
Solid inside, blurred outside.
void setDrawStyle(flutter::DlDrawStyle style) override
constexpr Vector3 GetScale() const
std::optional< Rect > GetLocalCoverageLimit() const
Return the culling bounds of the current render target, or nullopt if there is no coverage.
void setStrokeJoin(flutter::DlStrokeJoin join) override
void transformReset() override
void skew(DlScalar sx, DlScalar sy) override
constexpr Color WithAlpha(Scalar new_alpha) const
void drawVertices(const std::shared_ptr< flutter::DlVertices > &vertices, flutter::DlBlendMode dl_mode) override
void DrawCircle(const Point ¢er, Scalar radius, const Paint &paint)
static Paint::Style ToStyle(flutter::DlDrawStyle style)
constexpr Matrix Translate(const Vector3 &t) const
const flutter::DlColorSource * color_source
PathBuilder & LineTo(Point point, bool relative=false)
Insert a line from the current position to point.
In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of t...
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)
void rotate(DlScalar degrees) override
void setAntiAlias(bool aa) override
const flutter::DlImageFilter * image_filter
CanvasDlDispatcher(ContentContext &renderer, RenderTarget &render_target, bool has_root_backdrop_filter, flutter::DlBlendMode max_root_blend_mode, IRect cull_rect)
void DrawPath(const Path &path, const Paint &paint)
Path TakePath(FillType fill=FillType::kNonZero)
void DrawPaint(const Paint &paint)
static FilterContents::BlurStyle ToBlurStyle(flutter::DlBlurStyle blur_style)
size_t GetSaveCount() const
void DrawImageRect(const std::shared_ptr< Texture > &image, Rect source, Rect dest, const Paint &paint, SamplerDescriptor sampler={}, SourceRectConstraint src_rect_constraint=SourceRectConstraint::kFast)
void drawPath(const DlPath &path) override
@ kInner
Blurred inside, nothing outside.
virtual RenderTarget CreateOffscreenMSAA(const Context &context, ISize size, int mip_count, const std::string &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)
static std::unique_ptr< Geometry > MakeRoundRect(const Rect &rect, const Size &radii)
virtual Canvas & GetCanvas()=0
a wrapper around the impeller [Allocator] instance that can be used to provide caching of allocated r...
void drawImageNine(const sk_sp< flutter::DlImage > image, const DlIRect ¢er, const DlRect &dst, flutter::DlFilterMode filter, bool render_with_attributes) override
void clipRRect(const SkRRect &rrect, ClipOp clip_op, bool is_aa) override
void DrawAtlas(const std::shared_ptr< AtlasContents > &atlas_contents, const Paint &paint)
void saveLayer(const DlRect &bounds, const flutter::SaveLayerOptions options, const flutter::DlImageFilter *backdrop) override
void ClipGeometry(std::unique_ptr< Geometry > geometry, Entity::ClipOperation clip_op)
static void SimplifyOrDrawPath(Canvas &canvas, const DlPath &cache, const Paint &paint)
uint64_t GetOpDepth() const
void drawDashedLine(const DlPoint &p0, const DlPoint &p1, DlScalar on_length, DlScalar off_length) override
void PreConcat(const Matrix &transform)
void drawDisplayList(const sk_sp< flutter::DisplayList > display_list, DlScalar opacity) override
void drawArc(const DlRect &oval_bounds, DlScalar start_degrees, DlScalar sweep_degrees, bool use_center) override
std::shared_ptr< Context > GetContext() const
static std::unique_ptr< Geometry > MakeRect(const Rect &rect)
void drawDisplayList(const sk_sp< flutter::DisplayList > display_list, DlScalar opacity) override
void DrawOval(const Rect &rect, const Paint &paint)
@ kOuter
Nothing inside, blurred outside.
constexpr auto GetRight() const
static Matrix MakeRotationZ(Radians r)
void setBlendMode(flutter::DlBlendMode mode) override
const Capabilities & GetDeviceCapabilities() const
void Rotate(Radians radians)
constexpr static TRect MakeSize(const TSize< U > &size)
void setStrokeMiter(DlScalar limit) override
void Reset()
Resets the contents of the HostBuffer to nothing so it can be reused.
constexpr static TRect MakeMaximum()
void Transform(const Matrix &transform)
PathBuilder & MoveTo(Point point, bool relative=false)
static std::unique_ptr< Geometry > MakeFillPath(const Path &path, std::optional< Rect > inner_rect=std::nullopt)
void transform2DAffine(DlScalar mxx, DlScalar mxy, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myt) override
void Save(uint32_t total_content_depth=kMaxDepth)
void skew(DlScalar sx, DlScalar sy) override
void setColor(flutter::DlColor color) override
void setStrokeWidth(DlScalar width) override
constexpr auto GetBottom() const
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.
Path ToPath(const SkRRect &rrect)
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
void DrawNinePatch(const std::shared_ptr< Texture > &image, Rect center, Rect dst, const SamplerDescriptor &sampler, Canvas *canvas, Paint *paint)
void drawPaint() override
Performs a first pass over the display list to collect all text frames.
constexpr size_t MipCount() const
void drawOval(const DlRect &bounds) override
void clipRect(const DlRect &rect, ClipOp clip_op, bool is_aa) override
void setMaskFilter(const flutter::DlMaskFilter *filter) override
void clipOval(const DlRect &bounds, ClipOp clip_op, bool is_aa) override
virtual bool SupportsFramebufferFetch() const =0
Whether the context backend is able to support pipelines with shaders that read from the framebuffer ...
@ kContainsContents
The caller claims the bounds are a reasonably tight estimate of the coverage of the contents and shou...
void setInvertColors(bool invert) override
flutter::DlScalar DlScalar
std::optional< MaskBlurDescriptor > mask_blur_descriptor
constexpr auto GetTop() const
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
A 4x4 matrix using column-major storage.
PathBuilder & AddArc(const Rect &oval_bounds, Radians start, Radians sweep, bool use_center=false)
static bool RequiresReadbackForBlends(const ContentContext &renderer, flutter::DlBlendMode max_root_blend_mode)
Subclasses.
void drawImage(const sk_sp< flutter::DlImage > image, const DlPoint &point, flutter::DlImageSampling sampling, bool render_with_attributes) override
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
constexpr Matrix Scale(const Vector3 &s) const
void Translate(const Vector3 &offset)
void rotate(DlScalar degrees) override
void drawTextBlob(const sk_sp< SkTextBlob > blob, DlScalar x, DlScalar y) override