#include <canvas.h>
Classes | |
| struct | DebugOptions |
Public Member Functions | |
| Canvas () | |
| Canvas (Rect cull_rect) | |
| Canvas (IRect cull_rect) | |
| ~Canvas () | |
| void | Save () |
| void | SaveLayer (const Paint &paint, std::optional< Rect > bounds=std::nullopt, const std::shared_ptr< ImageFilter > &backdrop_filter=nullptr) |
| bool | Restore () |
| size_t | GetSaveCount () const |
| void | RestoreToCount (size_t count) |
| const Matrix & | GetCurrentTransformation () const |
| const std::optional< Rect > | GetCurrentLocalCullingBounds () const |
| void | ResetTransform () |
| void | Transform (const Matrix &xformation) |
| void | Concat (const Matrix &xformation) |
| void | PreConcat (const Matrix &xformation) |
| 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 | DrawRect (Rect rect, const Paint &paint) |
| void | DrawRRect (Rect rect, Scalar corner_radius, const Paint &paint) |
| void | DrawCircle (Point center, Scalar radius, const Paint &paint) |
| void | DrawPoints (std::vector< Point >, 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={}) |
| 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 | ClipRRect (const Rect &rect, Scalar corner_radius, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect) |
| void | DrawPicture (const Picture &picture) |
| 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 () |
Public Attributes | |
| struct impeller::Canvas::DebugOptions | debug_options |
| impeller::Canvas::Canvas | ( | ) |
|
explicit |
|
explicit |
Definition at line 33 of file canvas.cc.
References impeller::TRect< T >::GetBottom(), impeller::TRect< T >::GetLeft(), impeller::TRect< T >::GetRight(), impeller::TRect< T >::GetTop(), and impeller::TRect< Scalar >::MakeLTRB().
|
default |
| void impeller::Canvas::ClipPath | ( | const Path & | path, |
| Entity::ClipOperation | clip_op = Entity::ClipOperation::kIntersect |
||
| ) |
Definition at line 284 of file canvas.cc.
References impeller::Path::GetBoundingBox(), impeller::Entity::kIntersect, and impeller::Geometry::MakeFillPath().
Referenced by impeller::DlDispatcher::clipPath(), impeller::DlDispatcher::clipRRect(), impeller::testing::TEST(), and impeller::testing::TEST_P().
| void impeller::Canvas::ClipRect | ( | const Rect & | rect, |
| Entity::ClipOperation | clip_op = Entity::ClipOperation::kIntersect |
||
| ) |
Definition at line 294 of file canvas.cc.
References impeller::Entity::kDifference, impeller::Entity::kIntersect, and impeller::Geometry::MakeRect().
Referenced by impeller::DlDispatcher::clipRect(), impeller::testing::TEST(), and impeller::testing::TEST_P().
| void impeller::Canvas::ClipRRect | ( | const Rect & | rect, |
| Scalar | corner_radius, | ||
| Entity::ClipOperation | clip_op = Entity::ClipOperation::kIntersect |
||
| ) |
Definition at line 315 of file canvas.cc.
References impeller::PathBuilder::AddRoundedRect(), impeller::TRect< T >::Expand(), impeller::TRect< T >::GetBottom(), impeller::TRect< T >::GetLeft(), impeller::TRect< T >::GetRight(), impeller::TRect< T >::GetTop(), impeller::TSize< T >::height, impeller::kConvex, impeller::Entity::kDifference, impeller::Entity::kIntersect, impeller::Geometry::MakeFillPath(), impeller::TRect< Scalar >::MakeLTRB(), impeller::PathBuilder::SetConvexity(), impeller::TRect< T >::size, impeller::PathBuilder::TakePath(), and impeller::TSize< T >::width.
Referenced by impeller::DlDispatcher::clipRRect(), impeller::testing::TEST(), and impeller::testing::TEST_P().
| void impeller::Canvas::Concat | ( | const Matrix & | xformation | ) |
Definition at line 112 of file canvas.cc.
References GetCurrentTransformation().
Referenced by Rotate(), Scale(), Skew(), impeller::testing::TEST_P(), Transform(), and Translate().
| 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 653 of file canvas.cc.
References impeller::EntityPass::AddEntity(), impeller::Color::alpha, impeller::Paint::blend_mode, impeller::Paint::color, GetCurrentTransformation(), impeller::Entity::SetBlendMode(), impeller::Entity::SetContents(), impeller::Entity::SetStencilDepth(), impeller::Entity::SetTransformation(), and impeller::Paint::WithFilters().
Referenced by impeller::DlDispatcher::drawAtlas(), and impeller::testing::TEST_P().
Definition at line 271 of file canvas.cc.
References impeller::PathBuilder::AddCircle(), DrawPath(), impeller::kConvex, impeller::PathBuilder::SetConvexity(), and impeller::PathBuilder::TakePath().
Referenced by impeller::DlDispatcher::drawCircle(), impeller::DlDispatcher::drawOval(), impeller::DlDispatcher::drawPath(), impeller::DlDispatcher::drawShadow(), and impeller::testing::TEST_P().
| void impeller::Canvas::DrawImage | ( | const std::shared_ptr< Image > & | image, |
| Point | offset, | ||
| const Paint & | paint, | ||
| SamplerDescriptor | sampler = {} |
||
| ) |
Definition at line 467 of file canvas.cc.
References DrawImageRect(), impeller::TRect< Scalar >::MakeSize(), impeller::TRect< Scalar >::MakeXYWH(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
Referenced by impeller::testing::TEST_P().
| void impeller::Canvas::DrawImageRect | ( | const std::shared_ptr< Image > & | image, |
| Rect | source, | ||
| Rect | dest, | ||
| const Paint & | paint, | ||
| SamplerDescriptor | sampler = {} |
||
| ) |
Definition at line 482 of file canvas.cc.
References impeller::EntityPass::AddEntity(), impeller::Color::alpha, impeller::Paint::blend_mode, impeller::Paint::color, GetCurrentTransformation(), impeller::Paint::HasColorFilter(), impeller::TSize< T >::IsEmpty(), impeller::TextureContents::MakeRect(), impeller::Entity::SetBlendMode(), impeller::Entity::SetContents(), impeller::Entity::SetStencilDepth(), impeller::Entity::SetTransformation(), impeller::TRect< T >::size, and impeller::Paint::WithFilters().
Referenced by DrawImage(), impeller::DlDispatcher::drawImageRect(), impeller::NinePatchConverter::DrawNinePatch(), and impeller::testing::TEST_P().
| void impeller::Canvas::DrawPaint | ( | const Paint & | paint | ) |
Definition at line 183 of file canvas.cc.
References impeller::EntityPass::AddEntity(), impeller::Paint::blend_mode, impeller::Paint::CreateContentsForEntity(), GetCurrentTransformation(), impeller::Entity::SetBlendMode(), impeller::Entity::SetContents(), impeller::Entity::SetStencilDepth(), and impeller::Entity::SetTransformation().
Referenced by impeller::testing::BlendModeTest(), impeller::DlDispatcher::drawColor(), impeller::DlDispatcher::drawPaint(), and impeller::testing::TEST_P().
Definition at line 173 of file canvas.cc.
References impeller::EntityPass::AddEntity(), impeller::Paint::blend_mode, impeller::Paint::CreateContentsForEntity(), GetCurrentTransformation(), impeller::Entity::SetBlendMode(), impeller::Entity::SetContents(), impeller::Entity::SetStencilDepth(), impeller::Entity::SetTransformation(), and impeller::Paint::WithFilters().
Referenced by impeller::DlDispatcher::drawArc(), DrawCircle(), impeller::DlDispatcher::drawDRRect(), impeller::DlDispatcher::drawLine(), impeller::DlDispatcher::drawOval(), impeller::DlDispatcher::drawPath(), impeller::DlDispatcher::drawPoints(), DrawRect(), DrawRRect(), impeller::DlDispatcher::drawRRect(), impeller::DlDispatcher::drawShadow(), and impeller::testing::TEST_P().
| void impeller::Canvas::DrawPicture | ( | const Picture & | picture | ) |
Definition at line 437 of file canvas.cc.
References impeller::EntityPass::AddSubpassInline(), GetCurrentTransformation(), and impeller::Picture::pass.
Referenced by impeller::testing::TEST_P().
| void impeller::Canvas::DrawPoints | ( | std::vector< Point > | points, |
| Scalar | radius, | ||
| const Paint & | paint, | ||
| PointStyle | point_style | ||
| ) |
Definition at line 418 of file canvas.cc.
References impeller::EntityPass::AddEntity(), impeller::Paint::blend_mode, impeller::Paint::CreateContentsForGeometry(), GetCurrentTransformation(), impeller::kRound, impeller::Geometry::MakePointField(), impeller::Entity::SetBlendMode(), impeller::Entity::SetContents(), impeller::Entity::SetStencilDepth(), impeller::Entity::SetTransformation(), and impeller::Paint::WithFilters().
Referenced by impeller::DlDispatcher::drawPoints(), and impeller::testing::TEST_P().
Definition at line 229 of file canvas.cc.
References impeller::EntityPass::AddEntity(), impeller::PathBuilder::AddRect(), impeller::Paint::blend_mode, impeller::Paint::CreateContentsForGeometry(), DrawPath(), GetCurrentTransformation(), impeller::Paint::kStroke, impeller::Geometry::MakeRect(), impeller::Entity::SetBlendMode(), impeller::Entity::SetContents(), impeller::Entity::SetStencilDepth(), impeller::Entity::SetTransformation(), impeller::Paint::style, and impeller::Paint::WithFilters().
Referenced by impeller::testing::CanRenderConicalGradientWithDithering(), impeller::testing::CanRenderLinearGradientWithDithering(), impeller::testing::CanRenderRadialGradientWithDithering(), impeller::testing::CanRenderSweepGradientWithDithering(), impeller::DlDispatcher::drawPath(), impeller::DlDispatcher::drawRect(), impeller::DlDispatcher::drawShadow(), impeller::testing::TEST_F(), and impeller::testing::TEST_P().
Definition at line 249 of file canvas.cc.
References impeller::EntityPass::AddEntity(), impeller::PathBuilder::AddRoundedRect(), impeller::Paint::blend_mode, impeller::Paint::CreateContentsForGeometry(), DrawPath(), GetCurrentTransformation(), impeller::kConvex, impeller::Paint::kFill, impeller::Geometry::MakeFillPath(), impeller::Entity::SetBlendMode(), impeller::Entity::SetContents(), impeller::PathBuilder::SetConvexity(), impeller::Entity::SetStencilDepth(), impeller::Entity::SetTransformation(), impeller::Paint::style, impeller::PathBuilder::TakePath(), and impeller::Paint::WithFilters().
Referenced by impeller::DlDispatcher::drawPath(), impeller::DlDispatcher::drawRRect(), impeller::DlDispatcher::drawShadow(), and impeller::testing::TEST_P().
| void impeller::Canvas::DrawTextFrame | ( | const std::shared_ptr< TextFrame > & | text_frame, |
| Point | position, | ||
| const Paint & | paint | ||
| ) |
Definition at line 549 of file canvas.cc.
References impeller::EntityPass::AddEntity(), impeller::Paint::blend_mode, impeller::Paint::color, GetCurrentTransformation(), impeller::Matrix::MakeTranslation(), impeller::Entity::SetBlendMode(), impeller::Entity::SetContents(), impeller::Entity::SetStencilDepth(), impeller::Entity::SetTransformation(), impeller::Paint::WithFilters(), and impeller::Paint::WithMaskBlur().
Referenced by impeller::DlDispatcher::drawTextFrame(), and impeller::testing::TEST_P().
| void impeller::Canvas::DrawVertices | ( | const std::shared_ptr< VerticesGeometry > & | vertices, |
| BlendMode | blend_mode, | ||
| const Paint & | paint | ||
| ) |
Definition at line 592 of file canvas.cc.
References impeller::EntityPass::AddEntity(), impeller::Color::alpha, impeller::Paint::blend_mode, impeller::Paint::color, impeller::Paint::color_source, impeller::Paint::CreateContentsForGeometry(), GetCurrentTransformation(), impeller::ColorSource::GetType(), impeller::ColorSource::kColor, impeller::kDestination, impeller::Geometry::MakeRect(), impeller::TRect< Scalar >::MakeXYWH(), impeller::Entity::SetBlendMode(), impeller::Entity::SetContents(), impeller::Entity::SetStencilDepth(), impeller::Entity::SetTransformation(), impeller::UseColorSourceContents(), impeller::Color::WithAlpha(), and impeller::Paint::WithFilters().
Referenced by impeller::DlDispatcher::drawVertices(), and impeller::testing::TEST_P().
| Picture impeller::Canvas::EndRecordingAsPicture | ( | ) |
Definition at line 513 of file canvas.cc.
References impeller::Picture::pass.
Referenced by impeller::testing::CanRenderConicalGradientWithDithering(), impeller::testing::CanRenderLinearGradientWithDithering(), impeller::testing::CanRenderRadialGradientWithDithering(), impeller::testing::CanRenderSweepGradientWithDithering(), impeller::DlDispatcher::EndRecordingAsPicture(), impeller::testing::TEST_F(), and impeller::testing::TEST_P().
| const std::optional< Rect > impeller::Canvas::GetCurrentLocalCullingBounds | ( | ) | const |
Definition at line 132 of file canvas.cc.
Referenced by impeller::DlDispatcher::drawDisplayList(), and impeller::testing::TEST().
| const Matrix & impeller::Canvas::GetCurrentTransformation | ( | ) | const |
Definition at line 128 of file canvas.cc.
Referenced by Concat(), DrawAtlas(), impeller::DlDispatcher::drawDisplayList(), DrawImageRect(), DrawPaint(), DrawPath(), DrawPicture(), DrawPoints(), DrawRect(), DrawRRect(), impeller::DlDispatcher::drawShadow(), DrawTextFrame(), DrawVertices(), PreConcat(), and impeller::testing::TEST_P().
| size_t impeller::Canvas::GetSaveCount | ( | ) | const |
Definition at line 161 of file canvas.cc.
Referenced by impeller::DlDispatcher::drawDisplayList(), RestoreToCount(), and impeller::testing::TEST_P().
| void impeller::Canvas::PreConcat | ( | const Matrix & | xformation | ) |
Definition at line 116 of file canvas.cc.
References GetCurrentTransformation().
Referenced by impeller::DlDispatcher::drawShadow().
| void impeller::Canvas::ResetTransform | ( | ) |
Definition at line 120 of file canvas.cc.
Referenced by impeller::DlDispatcher::transformReset().
| bool impeller::Canvas::Restore | ( | ) |
Definition at line 91 of file canvas.cc.
References impeller::EntityPass::GetSuperpass(), and impeller::Entity::kSubpass.
Referenced by impeller::DlDispatcher::drawShadow(), impeller::DlDispatcher::restore(), RestoreToCount(), and impeller::testing::TEST_P().
| void impeller::Canvas::RestoreToCount | ( | size_t | count | ) |
Definition at line 165 of file canvas.cc.
References GetSaveCount(), and Restore().
Referenced by impeller::DlDispatcher::drawDisplayList().
| void impeller::Canvas::Rotate | ( | Radians | radians | ) |
Definition at line 157 of file canvas.cc.
References Concat(), and impeller::Matrix::MakeRotationZ().
Referenced by impeller::DlDispatcher::rotate(), and impeller::testing::TEST_P().
| void impeller::Canvas::Save | ( | ) |
Definition at line 55 of file canvas.cc.
Referenced by impeller::DlDispatcher::drawDisplayList(), impeller::DlDispatcher::drawShadow(), impeller::DlDispatcher::save(), SaveLayer(), and impeller::testing::TEST_P().
| void impeller::Canvas::SaveLayer | ( | const Paint & | paint, |
| std::optional< Rect > | bounds = std::nullopt, |
||
| const std::shared_ptr< ImageFilter > & | backdrop_filter = nullptr |
||
| ) |
Definition at line 532 of file canvas.cc.
References impeller::Paint::blend_mode, impeller::kSourceOver, and Save().
Referenced by impeller::DlDispatcher::drawDisplayList(), impeller::DlDispatcher::saveLayer(), and impeller::testing::TEST_P().
| void impeller::Canvas::Scale | ( | const Vector2 & | scale | ) |
Definition at line 145 of file canvas.cc.
References Concat(), and impeller::Matrix::MakeScale().
Referenced by impeller::testing::CanRenderConicalGradientWithDithering(), impeller::testing::CanRenderSweepGradientWithDithering(), impeller::DlDispatcher::scale(), impeller::testing::TEST(), and impeller::testing::TEST_P().
| void impeller::Canvas::Scale | ( | const Vector3 & | scale | ) |
Definition at line 149 of file canvas.cc.
References Concat(), and impeller::Matrix::MakeScale().
Definition at line 153 of file canvas.cc.
References Concat(), and impeller::Matrix::MakeSkew().
Referenced by impeller::DlDispatcher::skew(), and impeller::testing::TEST_P().
| void impeller::Canvas::Transform | ( | const Matrix & | xformation | ) |
Definition at line 124 of file canvas.cc.
References Concat().
Referenced by impeller::testing::TEST_P(), impeller::DlDispatcher::transformFullPerspective(), and impeller::DlDispatcher::transformReset().
| void impeller::Canvas::Translate | ( | const Vector3 & | offset | ) |
Definition at line 141 of file canvas.cc.
References Concat(), and impeller::Matrix::MakeTranslation().
Referenced by impeller::testing::CanRenderConicalGradientWithDithering(), impeller::testing::CanRenderLinearGradientWithDithering(), impeller::testing::CanRenderRadialGradientWithDithering(), impeller::testing::CanRenderSweepGradientWithDithering(), impeller::testing::TEST(), impeller::testing::TEST_P(), and impeller::DlDispatcher::translate().
| struct impeller::Canvas::DebugOptions impeller::Canvas::debug_options |
Referenced by impeller::testing::TEST_P().