Flutter Engine
The Flutter Engine
|
Developer-facing API for rendering anything within the engine. More...
#include <dl_canvas.h>
Public Types | |
enum class | ClipOp { kDifference , kIntersect } |
enum class | PointMode { kPoints , kLines , kPolygon } |
enum class | SrcRectConstraint { kStrict , kFast } |
Public Member Functions | |
virtual | ~DlCanvas ()=default |
virtual SkISize | GetBaseLayerSize () const =0 |
virtual SkImageInfo | GetImageInfo () const =0 |
virtual void | Save ()=0 |
virtual void | SaveLayer (const SkRect *bounds, const DlPaint *paint=nullptr, const DlImageFilter *backdrop=nullptr)=0 |
virtual void | Restore ()=0 |
virtual int | GetSaveCount () const =0 |
virtual void | RestoreToCount (int restore_count)=0 |
virtual void | Translate (SkScalar tx, SkScalar ty)=0 |
virtual void | Scale (SkScalar sx, SkScalar sy)=0 |
virtual void | Rotate (SkScalar degrees)=0 |
virtual void | Skew (SkScalar sx, SkScalar sy)=0 |
virtual void | Transform2DAffine (SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt)=0 |
virtual void | TransformFullPerspective (SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt)=0 |
virtual void | TransformReset ()=0 |
virtual void | Transform (const SkMatrix *matrix)=0 |
virtual void | Transform (const SkM44 *matrix44)=0 |
void | Transform (const SkMatrix &matrix) |
void | Transform (const SkM44 &matrix44) |
virtual void | SetTransform (const SkMatrix *matrix)=0 |
virtual void | SetTransform (const SkM44 *matrix44)=0 |
virtual void | SetTransform (const SkMatrix &matrix) |
virtual void | SetTransform (const SkM44 &matrix44) |
virtual SkM44 | GetTransformFullPerspective () const =0 |
virtual SkMatrix | GetTransform () const =0 |
virtual void | ClipRect (const SkRect &rect, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false)=0 |
virtual void | ClipRRect (const SkRRect &rrect, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false)=0 |
virtual void | ClipPath (const SkPath &path, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false)=0 |
virtual SkRect | GetDestinationClipBounds () const =0 |
virtual SkRect | GetLocalClipBounds () const =0 |
virtual bool | QuickReject (const SkRect &bounds) const =0 |
virtual void | DrawPaint (const DlPaint &paint)=0 |
virtual void | DrawColor (DlColor color, DlBlendMode mode=DlBlendMode::kSrcOver)=0 |
void | Clear (DlColor color) |
virtual void | DrawLine (const SkPoint &p0, const SkPoint &p1, const DlPaint &paint)=0 |
virtual void | DrawDashedLine (const DlPoint &p0, const DlPoint &p1, DlScalar on_length, DlScalar off_length, const DlPaint &paint)=0 |
virtual void | DrawRect (const SkRect &rect, const DlPaint &paint)=0 |
virtual void | DrawOval (const SkRect &bounds, const DlPaint &paint)=0 |
virtual void | DrawCircle (const SkPoint ¢er, SkScalar radius, const DlPaint &paint)=0 |
virtual void | DrawRRect (const SkRRect &rrect, const DlPaint &paint)=0 |
virtual void | DrawDRRect (const SkRRect &outer, const SkRRect &inner, const DlPaint &paint)=0 |
virtual void | DrawPath (const SkPath &path, const DlPaint &paint)=0 |
virtual void | DrawArc (const SkRect &bounds, SkScalar start, SkScalar sweep, bool useCenter, const DlPaint &paint)=0 |
virtual void | DrawPoints (PointMode mode, uint32_t count, const SkPoint pts[], const DlPaint &paint)=0 |
virtual void | DrawVertices (const DlVertices *vertices, DlBlendMode mode, const DlPaint &paint)=0 |
void | DrawVertices (const std::shared_ptr< const DlVertices > &vertices, DlBlendMode mode, const DlPaint &paint) |
virtual void | DrawImage (const sk_sp< DlImage > &image, const SkPoint point, DlImageSampling sampling, const DlPaint *paint=nullptr)=0 |
virtual void | DrawImageRect (const sk_sp< DlImage > &image, const SkRect &src, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast)=0 |
virtual void | DrawImageRect (const sk_sp< DlImage > &image, const SkIRect &src, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast) |
void | DrawImageRect (const sk_sp< DlImage > &image, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast) |
virtual void | DrawImageNine (const sk_sp< DlImage > &image, const SkIRect ¢er, const SkRect &dst, DlFilterMode filter, const DlPaint *paint=nullptr)=0 |
virtual void | DrawAtlas (const sk_sp< DlImage > &atlas, const SkRSXform xform[], const SkRect tex[], const DlColor colors[], int count, DlBlendMode mode, DlImageSampling sampling, const SkRect *cullRect, const DlPaint *paint=nullptr)=0 |
virtual void | DrawDisplayList (const sk_sp< DisplayList > display_list, SkScalar opacity=SK_Scalar1)=0 |
virtual void | DrawTextFrame (const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y, const DlPaint &paint)=0 |
virtual void | DrawTextBlob (const sk_sp< SkTextBlob > &blob, SkScalar x, SkScalar y, const DlPaint &paint)=0 |
virtual void | DrawShadow (const SkPath &path, const DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr)=0 |
virtual void | Flush ()=0 |
Static Public Member Functions | |
static SkRect | ComputeShadowBounds (const SkPath &path, float elevation, SkScalar dpr, const SkMatrix &ctm) |
Static Public Attributes | |
static constexpr SkScalar | kShadowLightHeight = 600 |
static constexpr SkScalar | kShadowLightRadius = 800 |
Developer-facing API for rendering anything within the engine.
|DlCanvas| should be used to render anything in the framework classes (i.e. lib/ui
), flow and flow layers, embedders, shell, and elsewhere.
The only state carried by implementations of this interface are the clip and transform which are saved and restored by the |save|, |saveLayer|, and |restore| calls.
Definition at line 38 of file dl_canvas.h.
|
strong |
Enumerator | |
---|---|
kDifference | |
kIntersect |
Definition at line 40 of file dl_canvas.h.
|
strong |
Enumerator | |
---|---|
kPoints | draw each point separately |
kLines | draw each separate pair of points as a line segment |
kPolygon | draw each pair of overlapping points as a line segment |
Definition at line 45 of file dl_canvas.h.
|
strong |
Enumerator | |
---|---|
kStrict | |
kFast |
Definition at line 51 of file dl_canvas.h.
|
virtualdefault |
|
inline |
Definition at line 132 of file dl_canvas.h.
|
pure virtual |
Implemented in flutter::DlSkCanvasAdapter, flutter::testing::MockCanvas, and flutter::DisplayListBuilder.
|
pure virtual |
Implemented in flutter::DlSkCanvasAdapter, flutter::testing::MockCanvas, and flutter::DisplayListBuilder.
|
pure virtual |
Implemented in flutter::DlSkCanvasAdapter, flutter::testing::MockCanvas, and flutter::DisplayListBuilder.
|
static |
Definition at line 12 of file dl_canvas.cc.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::testing::MockCanvas, flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
inlinevirtual |
Reimplemented in flutter::DisplayListBuilder.
Definition at line 179 of file dl_canvas.h.
|
inline |
Definition at line 188 of file dl_canvas.h.
|
pure virtual |
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
|
inline |
Definition at line 163 of file dl_canvas.h.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Conservative estimate of the bounds of all outstanding clip operations measured in the coordinate space within which this DisplayList will be rendered.
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Conservative estimate of the bounds of all outstanding clip operations transformed into the local coordinate space in which currently recorded rendering operations are interpreted.
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::testing::MockCanvas, flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
|
pure virtual |
Returns the 3x3 partial perspective transform representing all transform operations executed so far in this DisplayList within the enclosing save stack.
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Returns the 4x4 full perspective transform representing all transform operations executed so far in this DisplayList within the enclosing save stack.
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Return true iff the supplied bounds are easily shown to be outside of the current clip bounds. This method may conservatively return false if it cannot make the determination.
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::testing::MockCanvas, flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
inlinevirtual |
Reimplemented in flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
Definition at line 94 of file dl_canvas.h.
|
pure virtual |
|
inlinevirtual |
Reimplemented in flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
Definition at line 93 of file dl_canvas.h.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
inline |
Definition at line 90 of file dl_canvas.h.
|
pure virtual |
|
inline |
Definition at line 89 of file dl_canvas.h.
|
pure virtual |
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::testing::MockCanvas.
|
staticconstexpr |
Definition at line 230 of file dl_canvas.h.
|
staticconstexpr |
Definition at line 231 of file dl_canvas.h.