Backend implementation of |DlCanvas| for |SkCanvas|. More...
#include <dl_sk_canvas.h>
Public Member Functions | |
| DlSkCanvasAdapter () | |
| DlSkCanvasAdapter (SkCanvas *canvas) | |
| ~DlSkCanvasAdapter () override=default | |
| void | set_canvas (SkCanvas *canvas) |
| SkCanvas * | canvas () |
| DlISize | GetBaseLayerDimensions () const override |
| SkImageInfo | GetImageInfo () const override |
| void | Save () override |
| void | SaveLayer (const std::optional< DlRect > &bounds, const DlPaint *paint=nullptr, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt) override |
| void | Restore () override |
| int | GetSaveCount () const override |
| void | RestoreToCount (int restore_count) override |
| void | Translate (DlScalar tx, DlScalar ty) override |
| void | Scale (DlScalar sx, DlScalar sy) override |
| void | Rotate (DlScalar degrees) override |
| void | Skew (DlScalar sx, DlScalar sy) override |
| void | Transform2DAffine (DlScalar mxx, DlScalar mxy, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myt) override |
| void | TransformFullPerspective (DlScalar mxx, DlScalar mxy, DlScalar mxz, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myz, DlScalar myt, DlScalar mzx, DlScalar mzy, DlScalar mzz, DlScalar mzt, DlScalar mwx, DlScalar mwy, DlScalar mwz, DlScalar mwt) override |
| void | TransformReset () override |
| void | Transform (const DlMatrix &matrix) override |
| void | SetTransform (const DlMatrix &matrix) override |
| DlMatrix | GetMatrix () const override |
| void | ClipRect (const DlRect &rect, DlClipOp clip_op, bool is_aa) override |
| void | ClipOval (const DlRect &bounds, DlClipOp clip_op, bool is_aa) override |
| void | ClipRoundRect (const DlRoundRect &rrect, DlClipOp clip_op, bool is_aa) override |
| void | ClipRoundSuperellipse (const DlRoundSuperellipse &rse, DlClipOp clip_op, bool is_aa) override |
| void | ClipPath (const DlPath &path, DlClipOp clip_op, bool is_aa) override |
| DlRect | GetDestinationClipCoverage () const override |
| DlRect | GetLocalClipCoverage () const override |
| bool | QuickReject (const DlRect &bounds) const override |
| void | DrawPaint (const DlPaint &paint) override |
| void | DrawColor (DlColor color, DlBlendMode mode) override |
| void | DrawLine (const DlPoint &p0, const DlPoint &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 DlRect &rect, const DlPaint &paint) override |
| void | DrawOval (const DlRect &bounds, const DlPaint &paint) override |
| void | DrawCircle (const DlPoint ¢er, DlScalar radius, const DlPaint &paint) override |
| void | DrawRoundRect (const DlRoundRect &rrect, const DlPaint &paint) override |
| void | DrawDiffRoundRect (const DlRoundRect &outer, const DlRoundRect &inner, const DlPaint &paint) override |
| void | DrawRoundSuperellipse (const DlRoundSuperellipse &rse, const DlPaint &paint) override |
| void | DrawPath (const DlPath &path, const DlPaint &paint) override |
| void | DrawArc (const DlRect &bounds, DlScalar start, DlScalar sweep, bool useCenter, const DlPaint &paint) override |
| void | DrawPoints (DlPointMode mode, uint32_t count, const DlPoint pts[], const DlPaint &paint) override |
| void | DrawVertices (const std::shared_ptr< DlVertices > &vertices, DlBlendMode mode, const DlPaint &paint) override |
| void | DrawImage (const sk_sp< DlImage > &image, const DlPoint &point, DlImageSampling sampling, const DlPaint *paint=nullptr) override |
| void | DrawImageRect (const sk_sp< DlImage > &image, const DlRect &src, const DlRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, DlSrcRectConstraint constraint=DlSrcRectConstraint::kFast) override |
| void | DrawImageNine (const sk_sp< DlImage > &image, const DlIRect ¢er, const DlRect &dst, DlFilterMode filter, const DlPaint *paint=nullptr) override |
| void | DrawAtlas (const sk_sp< DlImage > &atlas, const DlRSTransform xform[], const DlRect tex[], const DlColor colors[], int count, DlBlendMode mode, DlImageSampling sampling, const DlRect *cullRect, const DlPaint *paint=nullptr) override |
| void | DrawDisplayList (const sk_sp< DisplayList > display_list, DlScalar opacity=SK_Scalar1) override |
| void | DrawText (const std::shared_ptr< DlText > &text, DlScalar x, DlScalar y, const DlPaint &paint) override |
| void | DrawShadow (const DlPath &path, const DlColor color, const DlScalar elevation, bool transparent_occluder, DlScalar dpr) override |
| Draws the shadow of the given |path| rendered in the provided |color| (which is only consulted for its opacity) as would be produced by a directional light source uniformly shining in the device space direction {0, -1, 1} against a backdrop which is |elevation * dpr| device coordinates below the |path| in the Z direction. | |
| void | Flush () override |
Public Member Functions inherited from flutter::DlCanvas | |
| virtual | ~DlCanvas ()=default |
| void | Clear (DlColor color) |
| virtual void | DrawImageRect (const sk_sp< DlImage > &image, const DlIRect &src, const DlRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, DlSrcRectConstraint constraint=DlSrcRectConstraint::kFast) |
| void | DrawImageRect (const sk_sp< DlImage > &image, const DlRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, DlSrcRectConstraint constraint=DlSrcRectConstraint::kFast) |
Additional Inherited Members | |
Static Public Member Functions inherited from flutter::DlCanvas | |
| static DlRect | ComputeShadowBounds (const DlPath &path, float elevation, DlScalar dpr, const DlMatrix &ctm) |
| Compute the local coverage for a |DrawShadow| operation using the given parameters (excluding the color and the transparent occluder parameters which do not affect the bounds). | |
Static Public Attributes inherited from flutter::DlCanvas | |
| static constexpr DlScalar | kShadowLightHeight = 600 |
| static constexpr DlScalar | kShadowLightRadius = 800 |
Backend implementation of |DlCanvas| for |SkCanvas|.
Definition at line 23 of file dl_sk_canvas.h.
|
inline |
Definition at line 25 of file dl_sk_canvas.h.
|
inlineexplicit |
Definition at line 26 of file dl_sk_canvas.h.
|
overridedefault |
|
inline |
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 148 of file dl_sk_canvas.cc.
References flutter::ToSk(), and flutter::ToSkRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 168 of file dl_sk_canvas.cc.
References flutter::path, and flutter::ToSk().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 142 of file dl_sk_canvas.cc.
References flutter::ToSk(), and flutter::ToSkRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 155 of file dl_sk_canvas.cc.
References flutter::ToSk(), and flutter::ToSkRRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 161 of file dl_sk_canvas.cc.
References flutter::ToApproximateSkRRect(), and flutter::ToSk().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 257 of file dl_sk_canvas.cc.
References start, flutter::ToSk(), and flutter::ToSkRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 313 of file dl_sk_canvas.cc.
References i, flutter::mode, flutter::ToSk(), and flutter::ToSkRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 229 of file dl_sk_canvas.cc.
References flutter::ToSk(), and flutter::ToSkPoint().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 200 of file dl_sk_canvas.cc.
References flutter::mode, flutter::ToSk(), and flutter::ToSkColor4f().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 210 of file dl_sk_canvas.cc.
References flutter::ToSkPoint(), and flutter::ToStrokedSk().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 240 of file dl_sk_canvas.cc.
References flutter::ToSk(), and flutter::ToSkRRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 335 of file dl_sk_canvas.cc.
References flutter::ToDlRect(), flutter::ToSkRect(), and TRACE_EVENT0.
Referenced by flutter::SnapshotControllerSkia::MakeRasterSnapshotSync(), flutter::testing::DisplayListJobRenderer::Render(), and flutter::testing::TEST_F().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 280 of file dl_sk_canvas.cc.
References image, flutter::ToSk(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 302 of file dl_sk_canvas.cc.
References image, flutter::ToSk(), flutter::ToSkIRect(), and flutter::ToSkRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 290 of file dl_sk_canvas.cc.
References image, flutter::ToSk(), and flutter::ToSkRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 204 of file dl_sk_canvas.cc.
References flutter::ToSkPoint(), and flutter::ToStrokedSk().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 225 of file dl_sk_canvas.cc.
References flutter::ToSk(), and flutter::ToSkRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 196 of file dl_sk_canvas.cc.
References flutter::ToSk().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 252 of file dl_sk_canvas.cc.
References flutter::path, and flutter::ToSk().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 265 of file dl_sk_canvas.cc.
References flutter::mode, flutter::ToSk(), flutter::ToSkPoints(), and flutter::ToStrokedSk().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 221 of file dl_sk_canvas.cc.
References flutter::ToSk(), and flutter::ToSkRect().
Referenced by flutter::testing::MakeTestImage().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 235 of file dl_sk_canvas.cc.
References flutter::ToSk(), and flutter::ToSkRRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 246 of file dl_sk_canvas.cc.
References flutter::ToApproximateSkRRect(), and flutter::ToSk().
|
overridevirtual |
Draws the shadow of the given |path| rendered in the provided |color| (which is only consulted for its opacity) as would be produced by a directional light source uniformly shining in the device space direction {0, -1, 1} against a backdrop which is |elevation * dpr| device coordinates below the |path| in the Z direction.
Normally the renderer might consider omitting the rendering of any of the shadow pixels that fall under the |path| itself, as an optimization, unless the |transparent_occluder| flag is specified which would indicate that the optimization isn't appropriate.
Note that the |elevation| and |dpr| are unique in the API for being considered in pure device coordinates while the |path| is interpreted relative to the current local-to-device transform.
Implements flutter::DlCanvas.
Definition at line 369 of file dl_sk_canvas.cc.
References flutter::DlSkCanvasDispatcher::DrawShadow(), and flutter::path.
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 360 of file dl_sk_canvas.cc.
References FML_CHECK, text, flutter::ToSk(), x, and y.
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 273 of file dl_sk_canvas.cc.
References flutter::mode, and flutter::ToSk().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 379 of file dl_sk_canvas.cc.
Referenced by flutter::EmbedderExternalView::Render().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 45 of file dl_sk_canvas.cc.
References flutter::ToDlISize().
|
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 178 of file dl_sk_canvas.cc.
References flutter::ToDlRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 49 of file dl_sk_canvas.cc.
|
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 185 of file dl_sk_canvas.cc.
References flutter::ToDlRect().
|
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 138 of file dl_sk_canvas.cc.
References flutter::ToDlMatrix().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 76 of file dl_sk_canvas.cc.
Referenced by flutter::EmbedderExternalView::Render().
|
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 192 of file dl_sk_canvas.cc.
References flutter::ToSkRect().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 72 of file dl_sk_canvas.cc.
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 80 of file dl_sk_canvas.cc.
Referenced by flutter::EmbedderExternalView::Render().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 92 of file dl_sk_canvas.cc.
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 53 of file dl_sk_canvas.cc.
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 57 of file dl_sk_canvas.cc.
References flutter::DlImageFilter::asBlur(), params, flutter::DlBlurImageFilter::tile_mode(), flutter::ToSk(), flutter::ToSkRect(), and TRACE_EVENT0.
Implements flutter::DlCanvas.
Definition at line 88 of file dl_sk_canvas.cc.
| void flutter::DlSkCanvasAdapter::set_canvas | ( | SkCanvas * | canvas | ) |
Definition at line 41 of file dl_sk_canvas.cc.
References canvas().
Referenced by flutter::CanvasSpy::CanvasSpy(), flutter::OffscreenSurface::OffscreenSurface(), and flutter::SurfaceFrame::SurfaceFrame().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 131 of file dl_sk_canvas.cc.
References flutter::ToSkM44().
Referenced by flutter::EmbedderExternalView::Render().
Implements flutter::DlCanvas.
Definition at line 96 of file dl_sk_canvas.cc.
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 127 of file dl_sk_canvas.cc.
References flutter::ToSkM44().
Referenced by flutter::RasterCache::Rasterize().
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 103 of file dl_sk_canvas.cc.
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 110 of file dl_sk_canvas.cc.
|
overridevirtual |
Implements flutter::DlCanvas.
Definition at line 123 of file dl_sk_canvas.cc.
Implements flutter::DlCanvas.
Definition at line 84 of file dl_sk_canvas.cc.
Referenced by flutter::RasterCache::Rasterize().