Developer-facing API for rendering anything within the engine. More...
#include <dl_canvas.h>
Public Member Functions | |
| virtual | ~DlCanvas ()=default |
| virtual DlISize | GetBaseLayerDimensions () const =0 |
| virtual SkImageInfo | GetImageInfo () const =0 |
| virtual void | Save ()=0 |
| virtual void | SaveLayer (const std::optional< DlRect > &bounds, const DlPaint *paint=nullptr, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt)=0 |
| virtual void | Restore ()=0 |
| virtual int | GetSaveCount () const =0 |
| virtual void | RestoreToCount (int restore_count)=0 |
| virtual void | Translate (DlScalar tx, DlScalar ty)=0 |
| virtual void | Scale (DlScalar sx, DlScalar sy)=0 |
| virtual void | Rotate (DlScalar degrees)=0 |
| virtual void | Skew (DlScalar sx, DlScalar sy)=0 |
| virtual void | Transform2DAffine (DlScalar mxx, DlScalar mxy, DlScalar mxt, DlScalar myx, DlScalar myy, DlScalar myt)=0 |
| virtual 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)=0 |
| virtual void | TransformReset ()=0 |
| virtual void | Transform (const DlMatrix &matrix)=0 |
| virtual void | SetTransform (const DlMatrix &matrix)=0 |
| virtual DlMatrix | GetMatrix () const =0 |
| virtual void | ClipRect (const DlRect &rect, DlClipOp clip_op=DlClipOp::kIntersect, bool is_aa=false)=0 |
| virtual void | ClipOval (const DlRect &bounds, DlClipOp clip_op=DlClipOp::kIntersect, bool is_aa=false)=0 |
| virtual void | ClipRoundRect (const DlRoundRect &rrect, DlClipOp clip_op=DlClipOp::kIntersect, bool is_aa=false)=0 |
| virtual void | ClipRoundSuperellipse (const DlRoundSuperellipse &rse, DlClipOp clip_op=DlClipOp::kIntersect, bool is_aa=false)=0 |
| virtual void | ClipPath (const DlPath &path, DlClipOp clip_op=DlClipOp::kIntersect, bool is_aa=false)=0 |
| virtual DlRect | GetDestinationClipCoverage () const =0 |
| virtual DlRect | GetLocalClipCoverage () const =0 |
| virtual bool | QuickReject (const DlRect &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 DlPoint &p0, const DlPoint &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 DlRect &rect, const DlPaint &paint)=0 |
| virtual void | DrawOval (const DlRect &bounds, const DlPaint &paint)=0 |
| virtual void | DrawCircle (const DlPoint ¢er, DlScalar radius, const DlPaint &paint)=0 |
| virtual void | DrawRoundRect (const DlRoundRect &rrect, const DlPaint &paint)=0 |
| virtual void | DrawDiffRoundRect (const DlRoundRect &outer, const DlRoundRect &inner, const DlPaint &paint)=0 |
| virtual void | DrawRoundSuperellipse (const DlRoundSuperellipse &rse, const DlPaint &paint)=0 |
| virtual void | DrawPath (const DlPath &path, const DlPaint &paint)=0 |
| virtual void | DrawArc (const DlRect &bounds, DlScalar start, DlScalar sweep, bool useCenter, const DlPaint &paint)=0 |
| virtual void | DrawPoints (DlPointMode mode, uint32_t count, const DlPoint pts[], const DlPaint &paint)=0 |
| virtual void | DrawVertices (const std::shared_ptr< DlVertices > &vertices, DlBlendMode mode, const DlPaint &paint)=0 |
| virtual void | DrawImage (const sk_sp< DlImage > &image, const DlPoint &point, DlImageSampling sampling, const DlPaint *paint=nullptr)=0 |
| virtual void | DrawImageRect (const sk_sp< DlImage > &image, const DlRect &src, const DlRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, DlSrcRectConstraint constraint=DlSrcRectConstraint::kFast)=0 |
| 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) |
| virtual void | DrawImageNine (const sk_sp< DlImage > &image, const DlIRect ¢er, const DlRect &dst, DlFilterMode filter, const DlPaint *paint=nullptr)=0 |
| virtual 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)=0 |
| virtual void | DrawDisplayList (const sk_sp< DisplayList > display_list, DlScalar opacity=SK_Scalar1)=0 |
| virtual void | DrawText (const std::shared_ptr< DlText > &text, DlScalar x, DlScalar y, const DlPaint &paint)=0 |
| virtual void | DrawShadow (const DlPath &path, const DlColor color, const DlScalar elevation, bool transparent_occluder, DlScalar dpr)=0 |
| 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. | |
| virtual void | Flush ()=0 |
Static Public Member Functions | |
| 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 | |
| static constexpr DlScalar | kShadowLightHeight = 600 |
| static constexpr DlScalar | 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 32 of file dl_canvas.h.
|
virtualdefault |
|
inline |
Definition at line 104 of file dl_canvas.h.
References DrawColor().
Referenced by flutter::testing::RenderEnvironment::getImpellerResult(), flutter::RasterCache::Rasterize(), flutter::EmbedderExternalView::Render(), flutter::RenderFrameForScreenshot(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DlSkCanvasAdapter, and flutter::DisplayListBuilder.
|
pure virtual |
Implemented in flutter::DlSkCanvasAdapter, and flutter::DisplayListBuilder.
Referenced by flutter::DlCanvasDelegate::clipPath(), and flutter::testing::TEST_P().
|
pure virtual |
|
pure virtual |
Implemented in flutter::DlSkCanvasAdapter, and flutter::DisplayListBuilder.
Referenced by flutter::DlCanvasDelegate::clipRRect(), and flutter::testing::TEST_P().
|
pure virtual |
Implemented in flutter::DlSkCanvasAdapter, and flutter::DisplayListBuilder.
Referenced by flutter::DlCanvasDelegate::clipRSuperellipse().
|
static |
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).
Since the elevation is expressed in device coordinates relative to the provided |dpr| value, the |ctm| of the final rendering coordinate system that will be applied to the path must be provided so the two sets of coordinates (path and light source) can be correlated.
Definition at line 125 of file dl_canvas.cc.
References flutter::path.
Referenced by flutter::DisplayListBuilder::DrawShadow(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_P(), and flutter::testing::TEST_P().
|
pure virtual |
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F(), and flutter::testing::TEST_P().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DisplayListLayer::Paint(), flutter::DisplayListEmbedderViewSlice::render_into(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::DisplayListRasterCacheItem::TryToPrepareRasterCache().
|
pure virtual |
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F().
|
inlinevirtual |
Reimplemented in flutter::DisplayListBuilder.
Definition at line 149 of file dl_canvas.h.
References DrawImageRect(), impeller::TRect< T >::GetBottom(), impeller::TRect< T >::GetLeft(), impeller::TRect< T >::GetRight(), impeller::TRect< T >::GetTop(), image, and impeller::TRect< Scalar >::MakeLTRB().
|
inline |
Definition at line 160 of file dl_canvas.h.
References DrawImageRect(), and image.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, flutter::DlSkCanvasAdapter, and flutter::DisplayListBuilder.
Referenced by flutter::RasterCacheResult::draw(), DrawImageRect(), DrawImageRect(), flutter::testing::MockTexture::Paint(), and flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DrawCheckerboard(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), and flutter::testing::TEST_P().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::DrawCheckerboard(), flutter::DrawCheckerboard(), flutter::SurfaceTextureExternalTexture::DrawFrame(), flutter::ShaderMaskLayer::Paint(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), and flutter::testing::TEST_P().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
|
pure virtual |
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.
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::RenderTextInCanvasSkia(), and flutter::testing::TEST_F().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_F(), and flutter::DlStopwatchVisualizer::Visualize().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::RenderFrameForScreenshot(), and flutter::testing::TEST().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::DrawCheckerboard(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), and flutter_runner::testing::TEST_F().
|
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, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DlCanvasDelegate::device_cull_rect(), and flutter::testing::DlJobRenderer::Render().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::GetColorSpace().
|
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, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DlCanvasDelegate::local_cull_rect(), and flutter::TEST().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::RasterCache::Draw(), flutter::RasterCacheResult::draw(), flutter::DlCanvasDelegate::matrix(), flutter::testing::MockLayer::Paint(), flutter::testing::DlJobRenderer::Render(), and flutter::testing::TEST().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DlAutoCanvasRestore::DlAutoCanvasRestore(), and flutter::AndroidExternalViewEmbedder2::SubmitFlutterView().
|
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, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DlCanvasDelegate::content_culled(), and flutter::TEST().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DrawCheckerboard(), flutter::DlCanvasDelegate::restore(), flutter::testing::TEST_F(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), and flutter::testing::TEST_P().
|
pure virtual |
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::testing::TEST_P().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DlAutoCanvasRestore::DlAutoCanvasRestore(), flutter::DrawCheckerboard(), flutter::DlCanvasDelegate::save(), flutter::AndroidExternalViewEmbedder2::SubmitFlutterView(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), and flutter::testing::TEST_P().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DlCanvasDelegate::saveLayer(), flutter::testing::TEST_F(), flutter::testing::TEST_P(), and flutter::testing::TEST_P().
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::SurfaceTextureExternalTexture::DrawFrame(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), and flutter::testing::TEST_P().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DlCanvasDelegate::integralTransform().
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::DlCanvasDelegate::transform().
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
|
pure virtual |
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::RasterCacheResult::draw().
Implemented in flutter::DisplayListBuilder, and flutter::DlSkCanvasAdapter.
Referenced by flutter::RasterCacheResult::draw(), flutter::SurfaceTextureExternalTexture::DrawFrame(), flutter::ShaderMaskLayer::Paint(), flutter::testing::TEST(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), and flutter::DlCanvasDelegate::translate().
|
staticconstexpr |
Definition at line 215 of file dl_canvas.h.
Referenced by flutter::DlSkCanvasDispatcher::DrawShadow().
|
staticconstexpr |
Definition at line 216 of file dl_canvas.h.
Referenced by flutter::DlSkCanvasDispatcher::DrawShadow().