 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_AIKS_CANVAS_H_
6 #define FLUTTER_IMPELLER_AIKS_CANVAS_H_
80 std::optional<Rect> bounds = std::nullopt,
81 const std::shared_ptr<ImageFilter>& backdrop_filter =
nullptr,
123 const Size& corner_radii,
133 void DrawImage(
const std::shared_ptr<Image>& image,
139 const std::shared_ptr<Image>& image,
160 const Size& corner_radii,
163 void DrawTextFrame(
const std::shared_ptr<TextFrame>& text_frame,
167 void DrawVertices(
const std::shared_ptr<VerticesGeometry>& vertices,
171 void DrawAtlas(
const std::shared_ptr<Image>& atlas,
172 std::vector<Matrix> transforms,
173 std::vector<Rect> texture_coordinates,
174 std::vector<Color> colors,
176 SamplerDescriptor sampler,
177 std::optional<Rect> cull_rect,
183 std::unique_ptr<EntityPass> base_pass_;
184 EntityPass* current_pass_ =
nullptr;
185 uint64_t current_depth_ = 0u;
186 std::deque<CanvasStackEntry> transform_stack_;
187 std::optional<Rect> initial_cull_rect_;
189 void Initialize(std::optional<Rect> cull_rect);
193 EntityPass& GetCurrentPass();
195 size_t GetClipDepth()
const;
197 void AddEntityToCurrentPass(Entity entity);
199 void ClipGeometry(
const std::shared_ptr<Geometry>& geometry,
202 void IntersectCulling(
Rect clip_bounds);
203 void SubtractCulling(
Rect clip_bounds);
205 void Save(
bool create_subpass,
207 const std::shared_ptr<ImageFilter>& backdrop_filter =
nullptr);
211 bool AttemptDrawBlurredRRect(
const Rect& rect,
222 #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)
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)
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.
bool offscreen_texture_checkerboard
struct impeller::Canvas::DebugOptions debug_options
Entity::RenderingMode rendering_mode
void DrawLine(const Point &p0, const Point &p1, const Paint &paint)
void DrawRect(const Rect &rect, const Paint &paint)
const Matrix & GetCurrentTransform() const
void Concat(const Matrix &transform)
void SaveLayer(const Paint &paint, std::optional< Rect > bounds=std::nullopt, const std::shared_ptr< ImageFilter > &backdrop_filter=nullptr, ContentBoundsPromise bounds_promise=ContentBoundsPromise::kUnknown)
void DrawImage(const std::shared_ptr< Image > &image, Point offset, const Paint &paint, SamplerDescriptor sampler={})
@ 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)
void Rotate(Radians radians)
void Transform(const Matrix &transform)
const std::optional< Rect > GetCurrentLocalCullingBounds() const
void ClipRect(const Rect &rect, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
A 4x4 matrix using column-major storage.
void Translate(const Vector3 &offset)
void ClipPath(const Path &path, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)