#include <dl_dispatcher.h>
Public Member Functions | |
| DlDispatcherBase () | |
| virtual | ~DlDispatcherBase ()=default |
| void | setAntiAlias (bool aa) override |
| void | setDrawStyle (flutter::DlDrawStyle style) override |
| void | setColor (flutter::DlColor color) override |
| void | setStrokeWidth (DlScalar width) override |
| void | setStrokeMiter (DlScalar limit) override |
| void | setStrokeCap (flutter::DlStrokeCap cap) override |
| void | setStrokeJoin (flutter::DlStrokeJoin join) override |
| void | setColorSource (const flutter::DlColorSource *source) override |
| void | setColorFilter (const flutter::DlColorFilter *filter) override |
| void | setInvertColors (bool invert) override |
| void | setBlendMode (flutter::DlBlendMode mode) override |
| void | setMaskFilter (const flutter::DlMaskFilter *filter) override |
| void | setImageFilter (const flutter::DlImageFilter *filter) override |
| void | save (uint32_t total_content_depth) override |
| void | saveLayer (const DlRect &bounds, const flutter::SaveLayerOptions &options, uint32_t total_content_depth, flutter::DlBlendMode max_content_mode, const flutter::DlImageFilter *backdrop, std::optional< int64_t > backdrop_id) override |
| void | restore () 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 | clipRect (const DlRect &rect, flutter::DlClipOp clip_op, bool is_aa) override |
| void | clipOval (const DlRect &bounds, flutter::DlClipOp clip_op, bool is_aa) override |
| void | clipRoundRect (const DlRoundRect &rrect, flutter::DlClipOp clip_op, bool is_aa) override |
| void | clipRoundSuperellipse (const DlRoundSuperellipse &rse, flutter::DlClipOp clip_op, bool is_aa) override |
| void | clipPath (const DlPath &path, flutter::DlClipOp clip_op, bool is_aa) override |
| void | drawColor (flutter::DlColor color, flutter::DlBlendMode mode) override |
| void | drawPaint () override |
| void | drawLine (const DlPoint &p0, const DlPoint &p1) override |
| void | drawDashedLine (const DlPoint &p0, const DlPoint &p1, DlScalar on_length, DlScalar off_length) override |
| void | drawRect (const DlRect &rect) override |
| void | drawOval (const DlRect &bounds) override |
| void | drawCircle (const DlPoint ¢er, DlScalar radius) override |
| void | drawRoundRect (const DlRoundRect &rrect) override |
| void | drawDiffRoundRect (const DlRoundRect &outer, const DlRoundRect &inner) override |
| void | drawRoundSuperellipse (const DlRoundSuperellipse &rse) override |
| void | drawPath (const DlPath &path) override |
| void | drawArc (const DlRect &oval_bounds, DlScalar start_degrees, DlScalar sweep_degrees, bool use_center) override |
| void | drawPoints (flutter::DlPointMode mode, uint32_t count, const DlPoint points[]) override |
| void | drawVertices (const std::shared_ptr< flutter::DlVertices > &vertices, flutter::DlBlendMode dl_mode) override |
| void | drawImage (const sk_sp< flutter::DlImage > image, const DlPoint &point, flutter::DlImageSampling sampling, bool render_with_attributes) override |
| void | drawImageRect (const sk_sp< flutter::DlImage > image, const DlRect &src, const DlRect &dst, flutter::DlImageSampling sampling, bool render_with_attributes, flutter::DlSrcRectConstraint constraint) override |
| void | drawImageNine (const sk_sp< flutter::DlImage > image, const DlIRect ¢er, const DlRect &dst, flutter::DlFilterMode filter, bool render_with_attributes) override |
| void | drawAtlas (const sk_sp< flutter::DlImage > atlas, const RSTransform xform[], const DlRect tex[], const flutter::DlColor colors[], int count, flutter::DlBlendMode mode, flutter::DlImageSampling sampling, const DlRect *cull_rect, bool render_with_attributes) override |
| void | drawDisplayList (const sk_sp< flutter::DisplayList > display_list, DlScalar opacity) override |
| void | drawText (const std::shared_ptr< flutter::DlText > &text, DlScalar x, DlScalar y) override |
| void | drawShadow (const DlPath &path, const flutter::DlColor color, const DlScalar elevation, bool transparent_occluder, DlScalar dpr) override |
| virtual Canvas & | GetCanvas ()=0 |
| virtual const ContentContext & | GetContentContext () const =0 |
| std::shared_ptr< Texture > | GetTexture (const sk_sp< flutter::DlImage > &image) |
Public Member Functions inherited from flutter::DlOpReceiver | |
| virtual void | save ()=0 |
| virtual void | saveLayer (const DlRect &bounds, const SaveLayerOptions options, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt)=0 |
| virtual void | saveLayer (const DlRect *bounds, const SaveLayerOptions options, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt) final |
Static Protected Member Functions | |
| static void | SimplifyOrDrawPath (Canvas &canvas, const DlPath &cache, const Paint &paint) |
Protected Attributes | |
| Paint | paint_ |
| Matrix | initial_matrix_ |
Additional Inherited Members | |
Static Public Attributes inherited from flutter::DlOpReceiver | |
| static constexpr int | kMaxDrawPointsCount = ((1 << 29) - 1) |
Important implementation note.
The Impeller DisplayList Dispatcher implementation is divided into two parts and conducted in two passes.
The first pass is conducted using the FirstPassDispatcher which examines the rendering ops for important conditions needed by the rendering pass and computes some needed information for them.
The second pass is conducted using CanvasDlDispatcher to perform the actual rendering using a Canvas and data provided by the first pass.
@important It is important to note that the 2 passes perform slightly different DisplayList culling and may process different subsets of the frame's operations. See https://github.com/flutter/flutter/issues/182639
Given the above issue any data precomputed by the first pass should be presented in a way that doesn't assume a 1:1 correlation of the rendering operations in both passes (perhaps provide it in a map instead of a vector). While we have not yet observed and cases where an operation is missed during the first pass but still processed in the rendering pass, it would be wise to include a backup plan in the canvas dispatcher for when the data was not forwarded. Base (virtual) dispatcher utility class to implement most DlOpReceiver operations for other specific classes.
Definition at line 65 of file dl_dispatcher.h.
|
inlineexplicit |
Definition at line 67 of file dl_dispatcher.h.
|
virtualdefault |
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 435 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), GetCanvas(), and impeller::ToClipOperation().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 486 of file dl_dispatcher.cc.
References impeller::RoundingRadii::AreAllCornersSame(), AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), impeller::RoundRect::GetBounds(), GetCanvas(), impeller::RoundRect::GetRadii(), impeller::ToClipOperation(), and impeller::RoundingRadii::top_left.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 425 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), GetCanvas(), and impeller::ToClipOperation().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 445 of file dl_dispatcher.cc.
References impeller::RoundingRadii::AreAllCornersSame(), AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), impeller::RoundRect::GetBounds(), GetCanvas(), impeller::RoundRect::GetRadii(), impeller::RoundRect::IsOval(), impeller::RoundRect::IsRect(), impeller::ToClipOperation(), and impeller::RoundingRadii::top_left.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 467 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), impeller::RoundSuperellipse::GetBounds(), GetCanvas(), impeller::RoundSuperellipse::GetRadii(), impeller::RoundSuperellipse::IsOval(), impeller::RoundSuperellipse::IsRect(), and impeller::ToClipOperation().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 631 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawArc(), GetCanvas(), paint_, and use_center.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 759 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawAtlas(), GetCanvas(), GetTexture(), paint_, impeller::ToOptRect(), and impeller::skia_conversions::ToSamplerDescriptor().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 562 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawCircle(), GetCanvas(), and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 513 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Paint::blend_mode, impeller::Paint::color, impeller::Canvas::DrawPaint(), GetCanvas(), and impeller::skia_conversions::ToColor().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 538 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawDashedLine(), GetCanvas(), p1, and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 576 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawDiffRoundRect(), GetCanvas(), and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 787 of file dl_dispatcher.cc.
References AUTO_DEPTH_CHECK, AUTO_DEPTH_WATCHER, impeller::Paint::color, GetCanvas(), impeller::Canvas::GetCurrentTransform(), impeller::Canvas::GetLocalCoverageLimit(), impeller::Canvas::GetSaveCount(), impeller::Matrix::HasPerspective(), initial_matrix_, impeller::kContainsContents, paint_, impeller::Canvas::RestoreToCount(), impeller::Canvas::Save(), impeller::Canvas::SaveLayer(), and impeller::TRect< T >::TransformBounds().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 695 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, drawImageRect(), GetTexture(), image, flutter::kStrict, impeller::TRect< Scalar >::MakeWH(), impeller::TRect< Scalar >::MakeXYWH(), texture, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 743 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::NinePatchConverter::DrawNinePatch(), GetCanvas(), GetTexture(), image, impeller::TRect< Scalar >::MakeLTRB(), paint_, and impeller::ToSamplerDescriptor().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 724 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawImageRect(), GetCanvas(), GetTexture(), image, paint_, and impeller::skia_conversions::ToSamplerDescriptor().
Referenced by drawImage().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 531 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawLine(), GetCanvas(), p1, and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 555 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawOval(), GetCanvas(), and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 524 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawPaint(), GetCanvas(), and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 591 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawPath(), GetCanvas(), and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 643 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::StrokeParameters::cap, impeller::Canvas::DrawLine(), impeller::Canvas::DrawPoints(), GetCanvas(), i, flutter::kLines, flutter::kPoints, flutter::kPolygon, impeller::kRound, impeller::kSquare, impeller::Paint::kStroke, p1, paint_, points, impeller::Paint::stroke, impeller::Paint::style, and impeller::StrokeParameters::width.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 548 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawRect(), GetCanvas(), and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 569 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawRoundRect(), GetCanvas(), and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 584 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawRoundSuperellipse(), GetCanvas(), and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 869 of file dl_dispatcher.cc.
References impeller::Color::alpha, AUTO_DEPTH_CHECK, AUTO_DEPTH_WATCHER, impeller::Color::blue, impeller::Paint::color, GetCanvas(), impeller::Canvas::GetCurrentTransform(), impeller::Matrix::GetScale(), impeller::Color::green, impeller::Paint::kFill, impeller::FilterContents::kNormal, impeller::Matrix::MakeTranslation(), impeller::Paint::mask_blur_descriptor, impeller::Canvas::PreConcat(), impeller::Color::red, impeller::Canvas::Restore(), impeller::Canvas::Save(), SimplifyOrDrawPath(), impeller::Paint::MaskBlurDescriptor::style, impeller::Paint::style, impeller::skia_conversions::ToColor(), and impeller::Vector3::y.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 852 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawTextFrame(), FML_CHECK, GetCanvas(), paint_, text, x, and y.
|
overridevirtual |
|
pure virtual |
Referenced by clipOval(), clipPath(), clipRect(), clipRoundRect(), clipRoundSuperellipse(), drawArc(), drawAtlas(), drawCircle(), drawColor(), drawDashedLine(), drawDiffRoundRect(), drawDisplayList(), drawImageNine(), drawImageRect(), drawLine(), drawOval(), drawPaint(), drawPath(), drawPoints(), drawRect(), drawRoundRect(), drawRoundSuperellipse(), drawShadow(), drawText(), restore(), rotate(), save(), saveLayer(), scale(), skew(), transformFullPerspective(), transformReset(), and translate().
|
pure virtual |
Referenced by GetTexture().
| std::shared_ptr< Texture > impeller::DlDispatcherBase::GetTexture | ( | const sk_sp< flutter::DlImage > & | image | ) |
Definition at line 682 of file dl_dispatcher.cc.
References GetContentContext(), and image.
Referenced by drawAtlas(), drawImage(), drawImageNine(), and drawImageRect().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 338 of file dl_dispatcher.cc.
References GetCanvas(), and impeller::Canvas::Restore().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 357 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, GetCanvas(), and impeller::Canvas::Rotate().
|
overridevirtual |
Reimplemented from flutter::DlOpReceiver.
Definition at line 302 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, GetCanvas(), and impeller::Canvas::Save().
|
overridevirtual |
Reimplemented from flutter::DlOpReceiver.
Definition at line 309 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, flutter::SaveLayerOptions::bounds_from_caller(), flutter::SaveLayerOptions::can_distribute_opacity(), flutter::SaveLayerOptions::content_is_clipped(), flutter::SaveLayerOptions::content_is_unbounded(), GetCanvas(), impeller::kContainsContents, impeller::kMayClipContents, paint_, flutter::SaveLayerOptions::renders_with_attributes(), and impeller::Canvas::SaveLayer().
Implements flutter::DlOpReceiver.
Definition at line 350 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, GetCanvas(), and impeller::Canvas::Scale().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 149 of file dl_dispatcher.cc.
References impeller::Paint::anti_alias, AUTO_DEPTH_WATCHER, and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 252 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Paint::blend_mode, and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 176 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Paint::color, paint_, and impeller::skia_conversions::ToColor().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 238 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Paint::color_filter, and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 231 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Paint::color_source, and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 169 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, paint_, impeller::Paint::style, and impeller::ToStyle().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 295 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Paint::image_filter, and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 245 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::Paint::invert_colors, and paint_.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 272 of file dl_dispatcher.cc.
References flutter::DlMaskFilter::asBlur(), AUTO_DEPTH_WATCHER, flutter::kBlur, impeller::Paint::mask_blur_descriptor, paint_, impeller::ToBlurStyle(), and flutter::DlAttribute< D, T >::type().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 197 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::StrokeParameters::cap, flutter::kButt, impeller::kButt, flutter::kRound, impeller::kRound, flutter::kSquare, impeller::kSquare, paint_, and impeller::Paint::stroke.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 214 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::StrokeParameters::join, flutter::kBevel, impeller::kBevel, flutter::kMiter, impeller::kMiter, flutter::kRound, impeller::kRound, paint_, and impeller::Paint::stroke.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 190 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, impeller::StrokeParameters::miter_limit, paint_, and impeller::Paint::stroke.
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 183 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, paint_, impeller::Paint::stroke, impeller::StrokeParameters::width, and width.
|
staticprotected |
Definition at line 597 of file dl_dispatcher.cc.
References impeller::RoundingRadii::AreAllCornersSame(), impeller::Canvas::DrawLine(), impeller::Canvas::DrawOval(), impeller::Canvas::DrawPath(), impeller::Canvas::DrawRect(), impeller::Canvas::DrawRoundRect(), end, impeller::RoundRect::GetRadii(), and start.
Referenced by drawShadow().
Implements flutter::DlOpReceiver.
Definition at line 364 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, GetCanvas(), and impeller::Canvas::Skew().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 372 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, and transformFullPerspective().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 388 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, GetCanvas(), impeller::Canvas::Transform(), and transform.
Referenced by transform2DAffine().
|
overridevirtual |
Implements flutter::DlOpReceiver.
Definition at line 408 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, GetCanvas(), initial_matrix_, impeller::Canvas::ResetTransform(), and impeller::Canvas::Transform().
Implements flutter::DlOpReceiver.
Definition at line 343 of file dl_dispatcher.cc.
References AUTO_DEPTH_WATCHER, GetCanvas(), and impeller::Canvas::Translate().
|
protected |
Definition at line 298 of file dl_dispatcher.h.
Referenced by drawDisplayList(), and transformReset().
|
protected |
Definition at line 297 of file dl_dispatcher.h.
Referenced by drawArc(), drawAtlas(), drawCircle(), drawDashedLine(), drawDiffRoundRect(), drawDisplayList(), drawImageNine(), drawImageRect(), drawLine(), drawOval(), drawPaint(), drawPath(), drawPoints(), drawRect(), drawRoundRect(), drawRoundSuperellipse(), drawText(), impeller::CanvasDlDispatcher::drawVertices(), saveLayer(), setAntiAlias(), setBlendMode(), setColor(), setColorFilter(), setColorSource(), setDrawStyle(), setImageFilter(), setInvertColors(), setMaskFilter(), setStrokeCap(), setStrokeJoin(), setStrokeMiter(), and setStrokeWidth().