Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::DlSkCanvasAdapter Class Referencefinal

Backend implementation of |DlCanvas| for |SkCanvas|. More...

#include <dl_sk_canvas.h>

Inheritance diagram for flutter::DlSkCanvasAdapter:
flutter::DlCanvas

Public Member Functions

 DlSkCanvasAdapter ()
 
 DlSkCanvasAdapter (SkCanvas *canvas)
 
 ~DlSkCanvasAdapter () override=default
 
void set_canvas (SkCanvas *canvas)
 
SkCanvascanvas ()
 
SkISize GetBaseLayerSize () const override
 
SkImageInfo GetImageInfo () const override
 
void Save () override
 
void SaveLayer (const SkRect *bounds, const DlPaint *paint=nullptr, const DlImageFilter *backdrop=nullptr) override
 
void Restore () override
 
int GetSaveCount () const override
 
void RestoreToCount (int restore_count) override
 
void Translate (SkScalar tx, SkScalar ty) override
 
void Scale (SkScalar sx, SkScalar sy) override
 
void Rotate (SkScalar degrees) override
 
void Skew (SkScalar sx, SkScalar sy) override
 
void Transform2DAffine (SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt) override
 
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) override
 
void TransformReset () override
 
void Transform (const SkMatrix *matrix) override
 
void Transform (const SkM44 *matrix44) override
 
void SetTransform (const SkMatrix *matrix) override
 
void SetTransform (const SkM44 *matrix44) override
 
SkM44 GetTransformFullPerspective () const override
 
SkMatrix GetTransform () const override
 
void ClipRect (const SkRect &rect, ClipOp clip_op, bool is_aa) override
 
void ClipRRect (const SkRRect &rrect, ClipOp clip_op, bool is_aa) override
 
void ClipPath (const SkPath &path, ClipOp clip_op, bool is_aa) override
 
SkRect GetDestinationClipBounds () const override
 
SkRect GetLocalClipBounds () const override
 
bool QuickReject (const SkRect &bounds) const override
 
void DrawPaint (const DlPaint &paint) override
 
void DrawColor (DlColor color, DlBlendMode mode) override
 
void DrawLine (const SkPoint &p0, const SkPoint &p1, const DlPaint &paint) override
 
void DrawDashedLine (const DlPoint &p0, const DlPoint &p1, DlScalar on_length, DlScalar off_length, const DlPaint &paint) override
 
void DrawRect (const SkRect &rect, const DlPaint &paint) override
 
void DrawOval (const SkRect &bounds, const DlPaint &paint) override
 
void DrawCircle (const SkPoint &center, SkScalar radius, const DlPaint &paint) override
 
void DrawRRect (const SkRRect &rrect, const DlPaint &paint) override
 
void DrawDRRect (const SkRRect &outer, const SkRRect &inner, const DlPaint &paint) override
 
void DrawPath (const SkPath &path, const DlPaint &paint) override
 
void DrawArc (const SkRect &bounds, SkScalar start, SkScalar sweep, bool useCenter, const DlPaint &paint) override
 
void DrawPoints (PointMode mode, uint32_t count, const SkPoint pts[], const DlPaint &paint) override
 
void DrawVertices (const DlVertices *vertices, DlBlendMode mode, const DlPaint &paint) override
 
void DrawImage (const sk_sp< DlImage > &image, const SkPoint point, DlImageSampling sampling, const DlPaint *paint=nullptr) override
 
void DrawImageRect (const sk_sp< DlImage > &image, const SkRect &src, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast) override
 
void DrawImageNine (const sk_sp< DlImage > &image, const SkIRect &center, const SkRect &dst, DlFilterMode filter, const DlPaint *paint=nullptr) override
 
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) override
 
void DrawDisplayList (const sk_sp< DisplayList > display_list, SkScalar opacity=SK_Scalar1) override
 
void DrawTextBlob (const sk_sp< SkTextBlob > &blob, SkScalar x, SkScalar y, const DlPaint &paint) override
 
void DrawTextFrame (const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y, const DlPaint &paint) override
 
void DrawShadow (const SkPath &path, const DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr) override
 
void Flush () override
 
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 void Transform (const SkMatrix *matrix)=0
 
virtual void Transform (const SkM44 *matrix44)=0
 
void Transform (const SkMatrix &matrix)
 
void Transform (const SkM44 &matrix44)
 
- Public Member Functions inherited from flutter::DlCanvas
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 &center, 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 &center, 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
 

Additional Inherited Members

- Public Types inherited from flutter::DlCanvas
enum class  ClipOp { kDifference , kIntersect }
 
enum class  PointMode { kPoints , kLines , kPolygon }
 
enum class  SrcRectConstraint { kStrict , kFast }
 
- Static Public Member Functions inherited from flutter::DlCanvas
static SkRect ComputeShadowBounds (const SkPath &path, float elevation, SkScalar dpr, const SkMatrix &ctm)
 
- Static Public Attributes inherited from flutter::DlCanvas
static constexpr SkScalar kShadowLightHeight = 600
 
static constexpr SkScalar kShadowLightRadius = 800
 

Detailed Description

Backend implementation of |DlCanvas| for |SkCanvas|.

See also
DlCanvas

Definition at line 20 of file dl_sk_canvas.h.

Constructor & Destructor Documentation

◆ DlSkCanvasAdapter() [1/2]

flutter::DlSkCanvasAdapter::DlSkCanvasAdapter ( )
inline

Definition at line 22 of file dl_sk_canvas.h.

22: delegate_(nullptr) {}

◆ DlSkCanvasAdapter() [2/2]

flutter::DlSkCanvasAdapter::DlSkCanvasAdapter ( SkCanvas canvas)
inlineexplicit

Definition at line 23 of file dl_sk_canvas.h.

23: delegate_(canvas) {}

◆ ~DlSkCanvasAdapter()

flutter::DlSkCanvasAdapter::~DlSkCanvasAdapter ( )
overridedefault

Member Function Documentation

◆ canvas()

SkCanvas * flutter::DlSkCanvasAdapter::canvas ( )
inline

Definition at line 27 of file dl_sk_canvas.h.

27{ return delegate_; }

◆ ClipPath()

void flutter::DlSkCanvasAdapter::ClipPath ( const SkPath path,
ClipOp  clip_op,
bool  is_aa 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 162 of file dl_sk_canvas.cc.

164 {
165 delegate_->clipPath(path, ToSk(clip_op), is_aa);
166}
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1456
SkPaint ToSk(const DlPaint &paint)
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
Definition: switches.h:57

◆ ClipRect()

void flutter::DlSkCanvasAdapter::ClipRect ( const SkRect rect,
ClipOp  clip_op,
bool  is_aa 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 150 of file dl_sk_canvas.cc.

152 {
153 delegate_->clipRect(rect, ToSk(clip_op), is_aa);
154}
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350

◆ ClipRRect()

void flutter::DlSkCanvasAdapter::ClipRRect ( const SkRRect rrect,
ClipOp  clip_op,
bool  is_aa 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 156 of file dl_sk_canvas.cc.

158 {
159 delegate_->clipRRect(rrect, ToSk(clip_op), is_aa);
160}
void clipRRect(const SkRRect &rrect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1439
SkRRect rrect
Definition: SkRecords.h:232

◆ DrawArc()

void flutter::DlSkCanvasAdapter::DrawArc ( const SkRect bounds,
SkScalar  start,
SkScalar  sweep,
bool  useCenter,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 242 of file dl_sk_canvas.cc.

246 {
247 delegate_->drawArc(bounds, start, sweep, useCenter, ToSk(paint));
248}
void drawArc(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
Definition: SkCanvas.cpp:2728
const Paint & paint
Definition: color_source.cc:38
Optional< SkRect > bounds
Definition: SkRecords.h:189

◆ DrawAtlas()

void flutter::DlSkCanvasAdapter::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 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 296 of file dl_sk_canvas.cc.

304 {
305 SkOptionalPaint sk_paint(paint);
306 sk_sp<SkImage> sk_image = atlas->skia_image();
307 const SkColor* sk_colors = reinterpret_cast<const SkColor*>(colors);
308 delegate_->drawAtlas(sk_image.get(), xform, tex, sk_colors, count, ToSk(mode),
309 ToSk(sampling), cullRect, sk_paint());
310}
int count
Definition: FontMgrTest.cpp:50
uint32_t SkColor
Definition: SkColor.h:37
void drawAtlas(const SkImage *atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkSamplingOptions &sampling, const SkRect *cullRect, const SkPaint *paint)
Definition: SkCanvas.cpp:1810
T * get() const
Definition: SkRefCnt.h:303
sk_sp< const SkImage > atlas
Definition: SkRecords.h:331
PODArray< SkColor > colors
Definition: SkRecords.h:276
SkSamplingOptions sampling
Definition: SkRecords.h:337
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
Definition: switches.h:228

◆ DrawCircle()

void flutter::DlSkCanvasAdapter::DrawCircle ( const SkPoint center,
SkScalar  radius,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 222 of file dl_sk_canvas.cc.

224 {
225 delegate_->drawCircle(center, radius, ToSk(paint));
226}
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707

◆ DrawColor()

void flutter::DlSkCanvasAdapter::DrawColor ( DlColor  color,
DlBlendMode  mode 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 193 of file dl_sk_canvas.cc.

193 {
194 delegate_->drawColor(ToSk(color), ToSk(mode));
195}
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
Definition: SkCanvas.h:1182
DlColor color

◆ DrawDashedLine()

void flutter::DlSkCanvasAdapter::DrawDashedLine ( const DlPoint p0,
const DlPoint p1,
DlScalar  on_length,
DlScalar  off_length,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 203 of file dl_sk_canvas.cc.

207 {
208 SkPaint dashed_paint = ToStrokedSk(paint);
209 SkScalar intervals[2] = {on_length, off_length};
210 dashed_paint.setPathEffect(SkDashPathEffect::Make(intervals, 2, 0.0f));
211 delegate_->drawLine(ToSkPoint(p0), ToSkPoint(p1), dashed_paint);
212}
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
Definition: SkCanvas.cpp:2700
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
void setPathEffect(sk_sp< SkPathEffect > pathEffect)
float SkScalar
Definition: extension.cpp:12
const SkPoint & ToSkPoint(const DlPoint &point)
SkPaint ToStrokedSk(const DlPaint &paint)

◆ DrawDisplayList()

void flutter::DlSkCanvasAdapter::DrawDisplayList ( const sk_sp< DisplayList display_list,
SkScalar  opacity = SK_Scalar1 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 312 of file dl_sk_canvas.cc.

313 {
314 const int restore_count = delegate_->getSaveCount();
315
316 // Figure out whether we can apply the opacity during dispatch or
317 // if we need a saveLayer.
318 if (opacity < SK_Scalar1 && !display_list->can_apply_group_opacity()) {
319 TRACE_EVENT0("flutter", "Canvas::saveLayer");
320 delegate_->saveLayerAlphaf(&display_list->bounds(), opacity);
321 opacity = SK_Scalar1;
322 } else {
323 delegate_->save();
324 }
325
326 DlSkCanvasDispatcher dispatcher(delegate_, opacity);
327 if (display_list->has_rtree()) {
328 display_list->Dispatch(dispatcher, delegate_->getLocalClipBounds());
329 } else {
330 display_list->Dispatch(dispatcher);
331 }
332
333 delegate_->restoreToCount(restore_count);
334}
#define SK_Scalar1
Definition: SkScalar.h:18
SkRect getLocalClipBounds() const
Definition: SkCanvas.cpp:1586
int getSaveCount() const
Definition: SkCanvas.cpp:431
void restoreToCount(int saveCount)
Definition: SkCanvas.cpp:478
int save()
Definition: SkCanvas.cpp:447
int saveLayerAlphaf(const SkRect *bounds, float alpha)
Definition: SkCanvas.cpp:1077
#define TRACE_EVENT0(category_group, name)
Definition: trace_event.h:131

◆ DrawDRRect()

void flutter::DlSkCanvasAdapter::DrawDRRect ( const SkRRect outer,
const SkRRect inner,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 232 of file dl_sk_canvas.cc.

234 {
235 delegate_->drawDRRect(outer, inner, ToSk(paint));
236}
void drawDRRect(const SkRRect &outer, const SkRRect &inner, const SkPaint &paint)
Definition: SkCanvas.cpp:1645

◆ DrawImage()

void flutter::DlSkCanvasAdapter::DrawImage ( const sk_sp< DlImage > &  image,
const SkPoint  point,
DlImageSampling  sampling,
const DlPaint paint = nullptr 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 263 of file dl_sk_canvas.cc.

266 {
267 SkOptionalPaint sk_paint(paint);
268 sk_sp<SkImage> sk_image = image->skia_image();
269 delegate_->drawImage(sk_image.get(), point.fX, point.fY, ToSk(sampling),
270 sk_paint());
271}
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
sk_sp< const SkImage > image
Definition: SkRecords.h:269
float fX
x-axis value
Definition: SkPoint_impl.h:164
float fY
y-axis value
Definition: SkPoint_impl.h:165

◆ DrawImageNine()

void flutter::DlSkCanvasAdapter::DrawImageNine ( const sk_sp< DlImage > &  image,
const SkIRect center,
const SkRect dst,
DlFilterMode  filter,
const DlPaint paint = nullptr 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 285 of file dl_sk_canvas.cc.

289 {
290 SkOptionalPaint sk_paint(paint);
291 sk_sp<SkImage> sk_image = image->skia_image();
292 delegate_->drawImageNine(sk_image.get(), center, dst, ToSk(filter),
293 sk_paint());
294}
void drawImageNine(const SkImage *image, const SkIRect &center, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
Definition: SkCanvas.cpp:1769
dst
Definition: cp.py:12

◆ DrawImageRect()

void flutter::DlSkCanvasAdapter::DrawImageRect ( const sk_sp< DlImage > &  image,
const SkRect src,
const SkRect dst,
DlImageSampling  sampling,
const DlPaint paint = nullptr,
SrcRectConstraint  constraint = SrcRectConstraint::kFast 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 273 of file dl_sk_canvas.cc.

278 {
279 SkOptionalPaint sk_paint(paint);
280 sk_sp<SkImage> sk_image = image->skia_image();
281 delegate_->drawImageRect(sk_image.get(), src, dst, ToSk(sampling), sk_paint(),
282 ToSk(constraint));
283}
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
Definition: SkCanvas.cpp:2333

◆ DrawLine()

void flutter::DlSkCanvasAdapter::DrawLine ( const SkPoint p0,
const SkPoint p1,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 197 of file dl_sk_canvas.cc.

199 {
200 delegate_->drawLine(p0, p1, ToStrokedSk(paint));
201}

◆ DrawOval()

void flutter::DlSkCanvasAdapter::DrawOval ( const SkRect bounds,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 218 of file dl_sk_canvas.cc.

218 {
219 delegate_->drawOval(bounds, ToSk(paint));
220}
void drawOval(const SkRect &oval, const SkPaint &paint)
Definition: SkCanvas.cpp:1698

◆ DrawPaint()

void flutter::DlSkCanvasAdapter::DrawPaint ( const DlPaint paint)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 189 of file dl_sk_canvas.cc.

189 {
190 delegate_->drawPaint(ToSk(paint));
191}
void drawPaint(const SkPaint &paint)
Definition: SkCanvas.cpp:1668

◆ DrawPath()

void flutter::DlSkCanvasAdapter::DrawPath ( const SkPath path,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 238 of file dl_sk_canvas.cc.

238 {
239 delegate_->drawPath(path, ToSk(paint));
240}
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747

◆ DrawPoints()

void flutter::DlSkCanvasAdapter::DrawPoints ( PointMode  mode,
uint32_t  count,
const SkPoint  pts[],
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 250 of file dl_sk_canvas.cc.

253 {
254 delegate_->drawPoints(ToSk(mode), count, pts, ToStrokedSk(paint));
255}
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
Definition: SkCanvas.cpp:1710

◆ DrawRect()

void flutter::DlSkCanvasAdapter::DrawRect ( const SkRect rect,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 214 of file dl_sk_canvas.cc.

214 {
215 delegate_->drawRect(rect, ToSk(paint));
216}
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673

◆ DrawRRect()

void flutter::DlSkCanvasAdapter::DrawRRect ( const SkRRect rrect,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 228 of file dl_sk_canvas.cc.

228 {
229 delegate_->drawRRect(rrect, ToSk(paint));
230}
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
Definition: SkCanvas.cpp:1705

◆ DrawShadow()

void flutter::DlSkCanvasAdapter::DrawShadow ( const SkPath path,
const DlColor  color,
const SkScalar  elevation,
bool  transparent_occluder,
SkScalar  dpr 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 351 of file dl_sk_canvas.cc.

355 {
356 DlSkCanvasDispatcher::DrawShadow(delegate_, path, color, elevation,
357 transparent_occluder, dpr);
358}
static void DrawShadow(SkCanvas *canvas, const SkPath &path, DlColor color, float elevation, bool transparentOccluder, SkScalar dpr)

◆ DrawTextBlob()

void flutter::DlSkCanvasAdapter::DrawTextBlob ( const sk_sp< SkTextBlob > &  blob,
SkScalar  x,
SkScalar  y,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 336 of file dl_sk_canvas.cc.

339 {
340 delegate_->drawTextBlob(blob, x, y, ToSk(paint));
341}
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
Definition: SkCanvas.cpp:2484
double y
double x

◆ DrawTextFrame()

void flutter::DlSkCanvasAdapter::DrawTextFrame ( const std::shared_ptr< impeller::TextFrame > &  text_frame,
SkScalar  x,
SkScalar  y,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 343 of file dl_sk_canvas.cc.

347 {
348 FML_CHECK(false);
349}
#define FML_CHECK(condition)
Definition: logging.h:85

◆ DrawVertices()

void flutter::DlSkCanvasAdapter::DrawVertices ( const DlVertices vertices,
DlBlendMode  mode,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 257 of file dl_sk_canvas.cc.

259 {
260 delegate_->drawVertices(ToSk(vertices), ToSk(mode), ToSk(paint));
261}
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
Definition: SkCanvas.cpp:1720

◆ Flush()

void flutter::DlSkCanvasAdapter::Flush ( )
overridevirtual

Implements flutter::DlCanvas.

Definition at line 360 of file dl_sk_canvas.cc.

360 {
361 auto dContext = GrAsDirectContext(delegate_->recordingContext());
362
363 if (dContext) {
364 dContext->flushAndSubmit();
365 }
366}
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
virtual GrRecordingContext * recordingContext() const
Definition: SkCanvas.cpp:1637

◆ GetBaseLayerSize()

SkISize flutter::DlSkCanvasAdapter::GetBaseLayerSize ( ) const
overridevirtual

Implements flutter::DlCanvas.

Definition at line 43 of file dl_sk_canvas.cc.

43 {
44 return delegate_->getBaseLayerSize();
45}
virtual SkISize getBaseLayerSize() const
Definition: SkCanvas.cpp:369

◆ GetDestinationClipBounds()

SkRect flutter::DlSkCanvasAdapter::GetDestinationClipBounds ( ) const
overridevirtual

Conservative estimate of the bounds of all outstanding clip operations measured in the coordinate space within which this DisplayList will be rendered.

Implements flutter::DlCanvas.

Definition at line 171 of file dl_sk_canvas.cc.

171 {
172 return SkRect::Make(delegate_->getDeviceClipBounds());
173}
SkIRect getDeviceClipBounds() const
Definition: SkCanvas.cpp:1607
static SkRect Make(const SkISize &size)
Definition: SkRect.h:669

◆ GetImageInfo()

SkImageInfo flutter::DlSkCanvasAdapter::GetImageInfo ( ) const
overridevirtual

Implements flutter::DlCanvas.

Definition at line 47 of file dl_sk_canvas.cc.

47 {
48 return delegate_->imageInfo();
49}
SkImageInfo imageInfo() const
Definition: SkCanvas.cpp:1206

◆ GetLocalClipBounds()

SkRect flutter::DlSkCanvasAdapter::GetLocalClipBounds ( ) const
overridevirtual

Conservative estimate of the bounds of all outstanding clip operations transformed into the local coordinate space in which currently recorded rendering operations are interpreted.

Implements flutter::DlCanvas.

Definition at line 178 of file dl_sk_canvas.cc.

178 {
179 return delegate_->getLocalClipBounds();
180}

◆ GetSaveCount()

int flutter::DlSkCanvasAdapter::GetSaveCount ( ) const
overridevirtual

Implements flutter::DlCanvas.

Definition at line 69 of file dl_sk_canvas.cc.

69 {
70 return delegate_->getSaveCount();
71}

◆ GetTransform()

SkMatrix flutter::DlSkCanvasAdapter::GetTransform ( ) const
overridevirtual

Returns the 3x3 partial perspective transform representing all transform operations executed so far in this DisplayList within the enclosing save stack.

Implements flutter::DlCanvas.

Definition at line 146 of file dl_sk_canvas.cc.

146 {
147 return delegate_->getTotalMatrix();
148}
SkMatrix getTotalMatrix() const
Definition: SkCanvas.cpp:1629

◆ GetTransformFullPerspective()

SkM44 flutter::DlSkCanvasAdapter::GetTransformFullPerspective ( ) const
overridevirtual

Returns the 4x4 full perspective transform representing all transform operations executed so far in this DisplayList within the enclosing save stack.

Implements flutter::DlCanvas.

Definition at line 139 of file dl_sk_canvas.cc.

139 {
140 return delegate_->getLocalToDevice();
141}
SkM44 getLocalToDevice() const
Definition: SkCanvas.cpp:1633

◆ QuickReject()

bool flutter::DlSkCanvasAdapter::QuickReject ( const SkRect bounds) const
overridevirtual

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.

Implements flutter::DlCanvas.

Definition at line 185 of file dl_sk_canvas.cc.

185 {
186 return delegate_->quickReject(bounds);
187}
bool quickReject(const SkRect &rect) const
Definition: SkCanvas.cpp:1557

◆ Restore()

void flutter::DlSkCanvasAdapter::Restore ( )
overridevirtual

Implements flutter::DlCanvas.

Definition at line 65 of file dl_sk_canvas.cc.

65 {
66 delegate_->restore();
67}
void restore()
Definition: SkCanvas.cpp:461

◆ RestoreToCount()

void flutter::DlSkCanvasAdapter::RestoreToCount ( int  restore_count)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 73 of file dl_sk_canvas.cc.

73 {
74 delegate_->restoreToCount(restore_count);
75}

◆ Rotate()

void flutter::DlSkCanvasAdapter::Rotate ( SkScalar  degrees)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 85 of file dl_sk_canvas.cc.

85 {
86 delegate_->rotate(degrees);
87}
void rotate(SkScalar degrees)
Definition: SkCanvas.cpp:1300

◆ Save()

void flutter::DlSkCanvasAdapter::Save ( )
overridevirtual

Implements flutter::DlCanvas.

Definition at line 51 of file dl_sk_canvas.cc.

51 {
52 delegate_->save();
53}

◆ SaveLayer()

void flutter::DlSkCanvasAdapter::SaveLayer ( const SkRect bounds,
const DlPaint paint = nullptr,
const DlImageFilter backdrop = nullptr 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 55 of file dl_sk_canvas.cc.

57 {
58 sk_sp<SkImageFilter> sk_backdrop = ToSk(backdrop);
59 SkOptionalPaint sk_paint(paint);
60 TRACE_EVENT0("flutter", "Canvas::saveLayer");
61 delegate_->saveLayer(
62 SkCanvas::SaveLayerRec{bounds, sk_paint(), sk_backdrop.get(), 0});
63}
int saveLayer(const SkRect *bounds, const SkPaint *paint)
Definition: SkCanvas.cpp:496
sk_sp< const SkImageFilter > backdrop
Definition: SkRecords.h:191

◆ Scale()

void flutter::DlSkCanvasAdapter::Scale ( SkScalar  sx,
SkScalar  sy 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 81 of file dl_sk_canvas.cc.

81 {
82 delegate_->scale(sx, sy);
83}
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289

◆ set_canvas()

void flutter::DlSkCanvasAdapter::set_canvas ( SkCanvas canvas)

Definition at line 39 of file dl_sk_canvas.cc.

39 {
40 delegate_ = canvas;
41}

◆ SetTransform() [1/6]

virtual void flutter::DlCanvas::SetTransform ( const SkM44 matrix44)
inlinevirtual

Reimplemented from flutter::DlCanvas.

Definition at line 94 of file dl_canvas.h.

94{ SetTransform(&matrix44); }
void SetTransform(const SkMatrix *matrix) override

◆ SetTransform() [2/6]

void flutter::DlSkCanvasAdapter::SetTransform ( const SkM44 matrix44)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 132 of file dl_sk_canvas.cc.

132 {
133 delegate_->setMatrix(*matrix44);
134}
void setMatrix(const SkM44 &matrix)
Definition: SkCanvas.cpp:1349

◆ SetTransform() [3/6]

virtual void flutter::DlCanvas::SetTransform ( const SkM44 matrix44)
virtual

Implements flutter::DlCanvas.

◆ SetTransform() [4/6]

virtual void flutter::DlCanvas::SetTransform ( const SkMatrix matrix)
inlinevirtual

Reimplemented from flutter::DlCanvas.

Definition at line 93 of file dl_canvas.h.

unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ SetTransform() [5/6]

void flutter::DlSkCanvasAdapter::SetTransform ( const SkMatrix matrix)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 128 of file dl_sk_canvas.cc.

128 {
129 delegate_->setMatrix(*matrix);
130}

◆ SetTransform() [6/6]

virtual void flutter::DlCanvas::SetTransform ( const SkMatrix matrix)
virtual

Implements flutter::DlCanvas.

◆ Skew()

void flutter::DlSkCanvasAdapter::Skew ( SkScalar  sx,
SkScalar  sy 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 89 of file dl_sk_canvas.cc.

89 {
90 delegate_->skew(sx, sy);
91}
void skew(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1312

◆ Transform() [1/6]

void flutter::DlCanvas::Transform ( const SkM44 matrix44)
inline

Definition at line 90 of file dl_canvas.h.

90{ Transform(&matrix44); }
void Transform(const SkMatrix *matrix) override

◆ Transform() [2/6]

void flutter::DlSkCanvasAdapter::Transform ( const SkM44 matrix44)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 124 of file dl_sk_canvas.cc.

124 {
125 delegate_->concat(*matrix44);
126}
void concat(const SkMatrix &matrix)
Definition: SkCanvas.cpp:1318

◆ Transform() [3/6]

virtual void flutter::DlCanvas::Transform ( const SkM44 matrix44)
virtual

Implements flutter::DlCanvas.

◆ Transform() [4/6]

void flutter::DlCanvas::Transform ( const SkMatrix matrix)
inline

Definition at line 89 of file dl_canvas.h.

89{ Transform(&matrix); }

◆ Transform() [5/6]

void flutter::DlSkCanvasAdapter::Transform ( const SkMatrix matrix)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 120 of file dl_sk_canvas.cc.

120 {
121 delegate_->concat(*matrix);
122}

◆ Transform() [6/6]

virtual void flutter::DlCanvas::Transform ( const SkMatrix matrix)
virtual

Implements flutter::DlCanvas.

◆ Transform2DAffine()

void flutter::DlSkCanvasAdapter::Transform2DAffine ( SkScalar  mxx,
SkScalar  mxy,
SkScalar  mxt,
SkScalar  myx,
SkScalar  myy,
SkScalar  myt 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 96 of file dl_sk_canvas.cc.

98 {
99 delegate_->concat(SkMatrix::MakeAll(mxx, mxy, mxt, myx, myy, myt, 0, 0, 1));
100}
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
Definition: SkMatrix.h:179

◆ TransformFullPerspective()

void flutter::DlSkCanvasAdapter::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 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 103 of file dl_sk_canvas.cc.

107 {
108 delegate_->concat(SkM44(mxx, mxy, mxz, mxt,
109 myx, myy, myz, myt,
110 mzx, mzy, mzz, mzt,
111 mwx, mwy, mwz, mwt));
112}
Definition: SkM44.h:150

◆ TransformReset()

void flutter::DlSkCanvasAdapter::TransformReset ( )
overridevirtual

Implements flutter::DlCanvas.

Definition at line 116 of file dl_sk_canvas.cc.

116 {
117 delegate_->resetMatrix();
118}
void resetMatrix()
Definition: SkCanvas.cpp:1355

◆ Translate()

void flutter::DlSkCanvasAdapter::Translate ( SkScalar  tx,
SkScalar  ty 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 77 of file dl_sk_canvas.cc.

77 {
78 delegate_->translate(tx, ty);
79}
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278

The documentation for this class was generated from the following files: