Flutter Engine
The Flutter Engine
|
#include <canvas.h>
Public Member Functions | |
Canvas () | |
Canvas (Rect cull_rect) | |
Canvas (IRect cull_rect) | |
virtual | ~Canvas () |
virtual void | Save (uint32_t total_content_depth=kMaxDepth) |
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) |
virtual bool | Restore () |
size_t | GetSaveCount () const |
void | RestoreToCount (size_t count) |
const Matrix & | GetCurrentTransform () const |
const std::optional< Rect > | GetCurrentLocalCullingBounds () const |
void | ResetTransform () |
void | Transform (const Matrix &transform) |
void | Concat (const Matrix &transform) |
void | PreConcat (const Matrix &transform) |
void | Translate (const Vector3 &offset) |
void | Scale (const Vector2 &scale) |
void | Scale (const Vector3 &scale) |
void | Skew (Scalar sx, Scalar sy) |
void | Rotate (Radians radians) |
void | DrawPath (const Path &path, const Paint &paint) |
void | DrawPaint (const Paint &paint) |
void | DrawLine (const Point &p0, const Point &p1, const Paint &paint) |
void | DrawRect (const Rect &rect, const Paint &paint) |
void | DrawOval (const Rect &rect, const Paint &paint) |
void | DrawRRect (const Rect &rect, const Size &corner_radii, const Paint &paint) |
void | DrawCircle (const Point ¢er, Scalar radius, const Paint &paint) |
void | DrawPoints (std::vector< Point > points, Scalar radius, const Paint &paint, PointStyle point_style) |
void | DrawImage (const std::shared_ptr< Image > &image, Point offset, const Paint &paint, SamplerDescriptor sampler={}) |
void | DrawImageRect (const std::shared_ptr< Image > &image, Rect source, Rect dest, const Paint &paint, SamplerDescriptor sampler={}, SourceRectConstraint src_rect_constraint=SourceRectConstraint::kFast) |
void | ClipPath (const Path &path, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect) |
void | ClipRect (const Rect &rect, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect) |
void | ClipOval (const Rect &bounds, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect) |
void | ClipRRect (const Rect &rect, const Size &corner_radii, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect) |
virtual void | DrawTextFrame (const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint) |
void | DrawVertices (const std::shared_ptr< VerticesGeometry > &vertices, BlendMode blend_mode, const Paint &paint) |
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) |
Picture | EndRecordingAsPicture () |
Static Public Attributes | |
static constexpr uint32_t | kMaxDepth = 1 << 24 |
Protected Member Functions | |
size_t | GetClipHeight () const |
void | Initialize (std::optional< Rect > cull_rect) |
void | Reset () |
Protected Attributes | |
std::deque< CanvasStackEntry > | transform_stack_ |
std::optional< Rect > | initial_cull_rect_ |
uint64_t | current_depth_ = 0u |
Private Member Functions | |
virtual void | AddRenderEntityToCurrentPass (Entity entity, bool reuse_depth=false) |
virtual void | AddClipEntityToCurrentPass (Entity entity) |
virtual void | Save (bool create_subpass, uint32_t total_content_depth, BlendMode=BlendMode::kSourceOver, const std::shared_ptr< ImageFilter > &backdrop_filter=nullptr) |
impeller::Canvas::Canvas | ( | ) |
Definition at line 149 of file canvas.cc.
|
explicit |
|
explicit |
Definition at line 157 of file canvas.cc.
|
virtualdefault |
|
privatevirtual |
|
privatevirtual |
Definition at line 829 of file canvas.cc.
void impeller::Canvas::ClipOval | ( | const Rect & | bounds, |
Entity::ClipOperation | clip_op = Entity::ClipOperation::kIntersect |
||
) |
Definition at line 620 of file canvas.cc.
void impeller::Canvas::ClipPath | ( | const Path & | path, |
Entity::ClipOperation | clip_op = Entity::ClipOperation::kIntersect |
||
) |
Definition at line 589 of file canvas.cc.
void impeller::Canvas::ClipRect | ( | const Rect & | rect, |
Entity::ClipOperation | clip_op = Entity::ClipOperation::kIntersect |
||
) |
Definition at line 599 of file canvas.cc.
void impeller::Canvas::ClipRRect | ( | const Rect & | rect, |
const Size & | corner_radii, | ||
Entity::ClipOperation | clip_op = Entity::ClipOperation::kIntersect |
||
) |
Definition at line 640 of file canvas.cc.
void impeller::Canvas::Concat | ( | const Matrix & | transform | ) |
void impeller::Canvas::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 | ||
) |
Definition at line 1020 of file canvas.cc.
Definition at line 566 of file canvas.cc.
void impeller::Canvas::DrawImage | ( | const std::shared_ptr< Image > & | image, |
Point | offset, | ||
const Paint & | paint, | ||
SamplerDescriptor | sampler = {} |
||
) |
Definition at line 752 of file canvas.cc.
void impeller::Canvas::DrawImageRect | ( | const std::shared_ptr< Image > & | image, |
Rect | source, | ||
Rect | dest, | ||
const Paint & | paint, | ||
SamplerDescriptor | sampler = {} , |
||
SourceRectConstraint | src_rect_constraint = SourceRectConstraint::kFast |
||
) |
Definition at line 766 of file canvas.cc.
Definition at line 485 of file canvas.cc.
Definition at line 514 of file canvas.cc.
void impeller::Canvas::DrawPaint | ( | const Paint & | paint | ) |
Definition at line 352 of file canvas.cc.
Definition at line 343 of file canvas.cc.
void impeller::Canvas::DrawPoints | ( | std::vector< Point > | points, |
Scalar | radius, | ||
const Paint & | paint, | ||
PointStyle | point_style | ||
) |
Definition at line 733 of file canvas.cc.
Definition at line 495 of file canvas.cc.
void impeller::Canvas::DrawRRect | ( | const Rect & | rect, |
const Size & | corner_radii, | ||
const Paint & | paint | ||
) |
Definition at line 540 of file canvas.cc.
|
virtual |
Reimplemented in impeller::ExperimentalCanvas.
Definition at line 884 of file canvas.cc.
void impeller::Canvas::DrawVertices | ( | const std::shared_ptr< VerticesGeometry > & | vertices, |
BlendMode | blend_mode, | ||
const Paint & | paint | ||
) |
Definition at line 933 of file canvas.cc.
Picture impeller::Canvas::EndRecordingAsPicture | ( | ) |
Definition at line 804 of file canvas.cc.
|
protected |
const std::optional< Rect > impeller::Canvas::GetCurrentLocalCullingBounds | ( | ) | const |
const Matrix & impeller::Canvas::GetCurrentTransform | ( | ) | const |
size_t impeller::Canvas::GetSaveCount | ( | ) | const |
|
protected |
Definition at line 164 of file canvas.cc.
void impeller::Canvas::PreConcat | ( | const Matrix & | transform | ) |
|
protected |
Definition at line 177 of file canvas.cc.
void impeller::Canvas::ResetTransform | ( | ) |
|
virtual |
Reimplemented in impeller::ExperimentalCanvas.
Definition at line 257 of file canvas.cc.
void impeller::Canvas::RestoreToCount | ( | size_t | count | ) |
void impeller::Canvas::Rotate | ( | Radians | radians | ) |
|
privatevirtual |
Definition at line 219 of file canvas.cc.
|
virtual |
Reimplemented in impeller::ExperimentalCanvas.
|
virtual |
Reimplemented in impeller::ExperimentalCanvas.
Definition at line 842 of file canvas.cc.
void impeller::Canvas::Scale | ( | const Vector2 & | scale | ) |
void impeller::Canvas::Scale | ( | const Vector3 & | scale | ) |
void impeller::Canvas::Transform | ( | const Matrix & | transform | ) |
void impeller::Canvas::Translate | ( | const Vector3 & | offset | ) |
|
protected |
|
staticconstexpr |
|
protected |