 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_AIKS_CANVAS_H_
6 #define FLUTTER_IMPELLER_AIKS_CANVAS_H_
76 std::optional<Rect> bounds = std::nullopt,
77 const std::shared_ptr<ImageFilter>& backdrop_filter =
nullptr,
80 bool can_distribute_opacity =
false);
121 const Size& corner_radii,
131 void DrawImage(
const std::shared_ptr<Image>& image,
137 const std::shared_ptr<Image>& image,
158 const Size& corner_radii,
161 virtual void DrawTextFrame(
const std::shared_ptr<TextFrame>& text_frame,
165 void DrawVertices(
const std::shared_ptr<VerticesGeometry>& vertices,
169 void DrawAtlas(
const std::shared_ptr<Image>& atlas,
170 std::vector<Matrix> transforms,
171 std::vector<Rect> texture_coordinates,
172 std::vector<Color> colors,
174 SamplerDescriptor sampler,
175 std::optional<Rect> cull_rect,
187 void Initialize(std::optional<Rect> cull_rect);
192 std::unique_ptr<EntityPass> base_pass_;
197 virtual void AddRenderEntityToCurrentPass(
Entity entity,
198 bool reuse_depth =
false);
199 virtual void AddClipEntityToCurrentPass(
Entity entity);
201 void ClipGeometry(
const std::shared_ptr<Geometry>& geometry,
204 void IntersectCulling(
Rect clip_bounds);
205 void SubtractCulling(
Rect clip_bounds);
209 uint32_t total_content_depth,
211 const std::shared_ptr<ImageFilter>& backdrop_filter =
nullptr);
215 bool AttemptDrawBlurredRRect(
const Rect& rect,
226 #endif // FLUTTER_IMPELLER_AIKS_CANVAS_H_
void DrawPoints(std::vector< Point > points, Scalar radius, const Paint &paint, PointStyle point_style)
Picture EndRecordingAsPicture()
void ClipOval(const Rect &bounds, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Scalar distributed_opacity
void DrawRRect(const Rect &rect, const Size &corner_radii, const Paint &paint)
void RestoreToCount(size_t count)
void DrawImageRect(const std::shared_ptr< Image > &image, Rect source, Rect dest, const Paint &paint, SamplerDescriptor sampler={}, SourceRectConstraint src_rect_constraint=SourceRectConstraint::kFast)
@ kFast
Faster, but may sample outside the bounds of the source rectangle.
std::optional< Rect > cull_rect
void Skew(Scalar sx, Scalar sy)
virtual 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.
Entity::RenderingMode rendering_mode
void DrawLine(const Point &p0, const Point &p1, const Paint &paint)
std::optional< Rect > initial_cull_rect_
void DrawRect(const Rect &rect, const Paint &paint)
const Matrix & GetCurrentTransform() const
void Concat(const Matrix &transform)
void DrawImage(const std::shared_ptr< Image > &image, Point offset, const Paint &paint, SamplerDescriptor sampler={})
void Initialize(std::optional< Rect > cull_rect)
@ kStrict
Sample only within the source rectangle. May be slower.
@ kSquare
Points are drawn as circles.
void Scale(const Vector2 &scale)
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
void DrawCircle(const Point ¢er, Scalar radius, const Paint &paint)
SourceRectConstraint
Controls the behavior of the source rectangle given to DrawImageRect.
void DrawAtlas(const std::shared_ptr< Image > &atlas, std::vector< Matrix > transforms, std::vector< Rect > texture_coordinates, std::vector< Color > colors, BlendMode blend_mode, SamplerDescriptor sampler, std::optional< Rect > cull_rect, const Paint &paint)
void DrawPath(const Path &path, const Paint &paint)
void DrawPaint(const Paint &paint)
size_t GetSaveCount() const
void ClipRRect(const Rect &rect, const Size &corner_radii, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
void PreConcat(const Matrix &transform)
void DrawOval(const Rect &rect, const Paint &paint)
size_t GetClipHeight() const
void Rotate(Radians radians)
void Transform(const Matrix &transform)
virtual void Save(uint32_t total_content_depth=kMaxDepth)
const std::optional< Rect > GetCurrentLocalCullingBounds() const
void ClipRect(const Rect &rect, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
std::deque< CanvasStackEntry > transform_stack_
virtual void SaveLayer(const Paint &paint, std::optional< Rect > bounds=std::nullopt, const std::shared_ptr< ImageFilter > &backdrop_filter=nullptr, ContentBoundsPromise bounds_promise=ContentBoundsPromise::kUnknown, uint32_t total_content_depth=kMaxDepth, bool can_distribute_opacity=false)
A 4x4 matrix using column-major storage.
void Translate(const Vector3 &offset)
void ClipPath(const Path &path, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
static constexpr uint32_t kMaxDepth