5#ifndef FLUTTER_DISPLAY_LIST_DL_CANVAS_H_
6#define FLUTTER_DISPLAY_LIST_DL_CANVAS_H_
8#include "flutter/display_list/dl_blend_mode.h"
9#include "flutter/display_list/dl_paint.h"
10#include "flutter/display_list/dl_vertices.h"
11#include "flutter/display_list/geometry/dl_geometry_types.h"
12#include "flutter/display_list/image/dl_image.h"
107 bool is_aa =
false) = 0;
110 bool is_aa =
false) = 0;
113 bool is_aa =
false) = 0;
213 const std::shared_ptr<impeller::TextFrame>& text_frame,
225 bool transparent_occluder,
DlAutoCanvasRestore(DlCanvas *canvas, bool do_save)
Developer-facing API for rendering anything within the engine.
virtual void DrawPaint(const DlPaint &paint)=0
virtual void Rotate(SkScalar degrees)=0
virtual void Transform2DAffine(SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt)=0
virtual void TransformReset()=0
virtual void DrawRect(const SkRect &rect, const DlPaint &paint)=0
virtual void Transform(const SkMatrix *matrix)=0
virtual void DrawTextFrame(const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y, const DlPaint &paint)=0
virtual void DrawDRRect(const SkRRect &outer, const SkRRect &inner, const DlPaint &paint)=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 Scale(SkScalar sx, SkScalar sy)=0
virtual void DrawCircle(const SkPoint ¢er, SkScalar radius, const DlPaint &paint)=0
virtual int GetSaveCount() const =0
virtual void ClipRect(const SkRect &rect, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false)=0
void DrawImageRect(const sk_sp< DlImage > &image, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast)
virtual void DrawPoints(PointMode mode, uint32_t count, const SkPoint pts[], const DlPaint &paint)=0
virtual SkM44 GetTransformFullPerspective() const =0
virtual void SetTransform(const SkM44 &matrix44)
virtual void SetTransform(const SkMatrix *matrix)=0
virtual SkRect GetDestinationClipBounds() const =0
virtual void SaveLayer(const SkRect *bounds, const DlPaint *paint=nullptr, const DlImageFilter *backdrop=nullptr)=0
static constexpr SkScalar kShadowLightRadius
virtual SkRect GetLocalClipBounds() const =0
virtual void DrawRRect(const SkRRect &rrect, const DlPaint &paint)=0
virtual bool QuickReject(const SkRect &bounds) const =0
virtual void DrawColor(DlColor color, DlBlendMode mode=DlBlendMode::kSrcOver)=0
virtual void DrawDashedLine(const DlPoint &p0, const DlPoint &p1, DlScalar on_length, DlScalar off_length, const DlPaint &paint)=0
virtual void Transform(const SkM44 *matrix44)=0
virtual SkImageInfo GetImageInfo() const =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 Transform(const SkM44 &matrix44)
static constexpr SkScalar kShadowLightHeight
virtual void DrawTextBlob(const sk_sp< SkTextBlob > &blob, SkScalar x, SkScalar y, const DlPaint &paint)=0
virtual void DrawOval(const SkRect &bounds, const DlPaint &paint)=0
virtual void DrawVertices(const DlVertices *vertices, DlBlendMode mode, const DlPaint &paint)=0
virtual SkISize GetBaseLayerSize() const =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 RestoreToCount(int restore_count)=0
virtual void Translate(SkScalar tx, SkScalar ty)=0
virtual ~DlCanvas()=default
virtual void SetTransform(const SkM44 *matrix44)=0
static SkRect ComputeShadowBounds(const SkPath &path, float elevation, SkScalar dpr, const SkMatrix &ctm)
virtual void DrawArc(const SkRect &bounds, SkScalar start, SkScalar sweep, bool useCenter, const DlPaint &paint)=0
void Clear(DlColor color)
virtual void Skew(SkScalar sx, SkScalar sy)=0
virtual void SetTransform(const SkMatrix &matrix)
virtual void DrawLine(const SkPoint &p0, const SkPoint &p1, const DlPaint &paint)=0
virtual void DrawDisplayList(const sk_sp< DisplayList > display_list, SkScalar opacity=SK_Scalar1)=0
void Transform(const SkMatrix &matrix)
virtual void DrawShadow(const SkPath &path, const DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr)=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 SkMatrix GetTransform() const =0
virtual void DrawImage(const sk_sp< DlImage > &image, const SkPoint point, DlImageSampling sampling, const DlPaint *paint=nullptr)=0
void DrawVertices(const std::shared_ptr< const DlVertices > &vertices, DlBlendMode mode, const DlPaint &paint)
virtual void ClipPath(const SkPath &path, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false)=0
virtual void DrawImageNine(const sk_sp< DlImage > &image, const SkIRect ¢er, const SkRect &dst, DlFilterMode filter, const DlPaint *paint=nullptr)=0
virtual void ClipRRect(const SkRRect &rrect, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false)=0
virtual void DrawPath(const SkPath &path, const DlPaint &paint)=0
Holds all of the data (both required and optional) for a DisplayList drawVertices call.
sk_sp< const SkImage > atlas
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
sk_sp< const SkImage > image
sk_sp< const SkImageFilter > backdrop
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
SkSamplingOptions sampling
impeller::Scalar DlScalar
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
@ kSrcOver
r = s + (1-sa)*d
@ kDifference
rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
static SkRect Make(const SkISize &size)