 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_DISPLAY_LIST_CANVAS_H_
6 #define FLUTTER_IMPELLER_DISPLAY_LIST_CANVAS_H_
14 #include "display_list/effects/dl_image_filter.h"
88 std::unique_ptr<EntityPassTarget> p_entity_pass_target)
107 const Matrix& effect_transform,
112 bool requires_readback);
116 bool requires_readback,
121 bool requires_readback,
134 std::optional<Rect> bounds = std::nullopt,
135 const flutter::DlImageFilter* backdrop_filter =
nullptr,
137 uint32_t total_content_depth =
kMaxDepth,
138 bool can_distribute_opacity =
false);
173 bool reuse_depth =
false);
180 const Size& corner_radii,
190 void DrawImage(
const std::shared_ptr<Texture>& image,
196 const std::shared_ptr<Texture>& image,
203 void DrawTextFrame(
const std::shared_ptr<TextFrame>& text_frame,
207 void DrawVertices(
const std::shared_ptr<VerticesGeometry>& vertices,
211 void DrawAtlas(
const std::shared_ptr<AtlasContents>& atlas_contents,
221 uint64_t
GetMaxOpDepth()
const {
return transform_stack_.back().clip_depth; }
231 const bool requires_readback_;
234 std::deque<CanvasStackEntry> transform_stack_;
235 std::optional<Rect> initial_cull_rect_;
236 std::vector<LazyRenderingConfig> render_passes_;
237 std::vector<SaveLayerState> save_layer_state_;
242 std::vector<std::unique_ptr<Geometry>> clip_geometry_;
244 uint64_t current_depth_ = 0u;
246 Point GetGlobalPassPosition()
const;
249 size_t GetClipHeightFloor()
const;
253 bool IsSkipping()
const;
256 void SkipUntilMatchingRestore(
size_t total_content_depth);
258 void SetupRenderPass();
260 bool BlitToOnscreen();
262 size_t GetClipHeight()
const;
264 void Initialize(std::optional<Rect> cull_rect);
268 void AddRenderEntityWithFiltersToCurrentPass(
Entity& entity,
271 bool reuse_depth =
false);
273 void AddRenderEntityToCurrentPass(
Entity& entity,
bool reuse_depth =
false);
275 void AddClipEntityToCurrentPass(
Entity& entity);
279 bool AttemptDrawBlurredRRect(
const Rect& rect,
290 #endif // FLUTTER_IMPELLER_DISPLAY_LIST_CANVAS_H_
void DrawPoints(std::vector< Point > points, Scalar radius, const Paint &paint, PointStyle point_style)
bool IsApplyingClearColor() const
Whether or not the clear color texture can still be updated.
Scalar distributed_opacity
void DrawRRect(const Rect &rect, const Size &corner_radii, const Paint &paint)
void RestoreToCount(size_t count)
@ kFast
Faster, but may sample outside the bounds of the source rectangle.
@ kMayClipContents
The caller claims the bounds are a subset of an estimate of the reasonably tight bounds but likely cl...
void Skew(Scalar sx, Scalar sy)
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< TextFrame > &text_frame, Point position, const Paint &paint)
@ kRound
Points are drawn as squares.
void DrawVertices(const std::shared_ptr< VerticesGeometry > &vertices, BlendMode blend_mode, const Paint &paint)
@ kUnknown
The caller makes no claims related to the size of the bounds.
LazyRenderingConfig(ContentContext &renderer, std::unique_ptr< EntityPassTarget > p_entity_pass_target)
Entity::RenderingMode rendering_mode
void DrawRect(const Rect &rect, const Paint &paint)
const Matrix & GetCurrentTransform() const
void Concat(const Matrix &transform)
uint64_t GetMaxOpDepth() const
@ kStrict
Sample only within the source rectangle. May be slower.
@ kSquare
Points are drawn as circles.
void Scale(const Vector2 &scale)
LazyRenderingConfig(ContentContext &renderer, std::unique_ptr< EntityPassTarget > entity_pass_target, std::unique_ptr< InlinePassContext > inline_pass_context)
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
std::optional< Rect > GetLocalCoverageLimit() const
Return the culling bounds of the current render target, or nullopt if there is no coverage.
Canvas(ContentContext &renderer, RenderTarget &render_target, bool requires_readback)
std::unique_ptr< InlinePassContext > inline_pass_context
void DrawCircle(const Point ¢er, Scalar radius, const Paint &paint)
SourceRectConstraint
Controls the behavior of the source rectangle given to DrawImageRect.
void DrawPath(const Path &path, const Paint &paint)
void DrawPaint(const Paint &paint)
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 DrawAtlas(const std::shared_ptr< AtlasContents > &atlas_contents, const Paint &paint)
void ClipGeometry(std::unique_ptr< Geometry > geometry, Entity::ClipOperation clip_op)
uint64_t GetOpDepth() const
void DrawImage(const std::shared_ptr< Texture > &image, Point offset, const Paint &paint, SamplerDescriptor sampler={})
void PreConcat(const Matrix &transform)
std::function< std::shared_ptr< FilterContents >(FilterInput::Ref, const Matrix &effect_transform, Entity::RenderingMode rendering_mode)> BackdropFilterProc
void DrawOval(const Rect &rect, const Paint &paint)
void Rotate(Radians radians)
void Transform(const Matrix &transform)
void DrawLine(const Point &p0, const Point &p1, const Paint &paint, bool reuse_depth=false)
void Save(uint32_t total_content_depth=kMaxDepth)
A class that tracks all clips that have been recorded in the current entity pass stencil.
std::unique_ptr< EntityPassTarget > entity_pass_target
@ kContainsContents
The caller claims the bounds are a reasonably tight estimate of the coverage of the contents and shou...
A 4x4 matrix using column-major storage.
void Translate(const Vector3 &offset)
static constexpr uint32_t kMaxDepth