Flutter Engine
 
Loading...
Searching...
No Matches
flutter::DlOpReceiver Class Referenceabstract

Internal API for rendering recorded display lists to backends. More...

#include <dl_op_receiver.h>

Inheritance diagram for flutter::DlOpReceiver:
flutter::ComplexityCalculatorHelper flutter::DisplayListBuilder flutter::DlOpSpy flutter::DlSkCanvasDispatcher flutter::DlSkPaintDispatchHelper flutter::IgnoreAttributeDispatchHelper flutter::IgnoreClipDispatchHelper flutter::IgnoreDrawDispatchHelper flutter::IgnoreTransformDispatchHelper flutter::testing::ClipExpector flutter::testing::DepthExpector flutter::testing::DisplayListGeneralReceiver flutter::testing::DisplayListStreamDispatcher flutter::testing::DlOpRecorder flutter::testing::ImageSizeTextBlobInspector flutter::testing::MockDispatchHelper flutter::testing::SaveLayerBoundsExpector flutter::testing::SaveLayerExpector impeller::DlDispatcherBase

Public Member Functions

virtual void setAntiAlias (bool aa)=0
 
virtual void setDrawStyle (DlDrawStyle style)=0
 
virtual void setColor (DlColor color)=0
 
virtual void setStrokeWidth (float width)=0
 
virtual void setStrokeMiter (float limit)=0
 
virtual void setStrokeCap (DlStrokeCap cap)=0
 
virtual void setStrokeJoin (DlStrokeJoin join)=0
 
virtual void setColorSource (const DlColorSource *source)=0
 
virtual void setColorFilter (const DlColorFilter *filter)=0
 
virtual void setInvertColors (bool invert)=0
 
virtual void setBlendMode (DlBlendMode mode)=0
 
virtual void setMaskFilter (const DlMaskFilter *filter)=0
 
virtual void setImageFilter (const DlImageFilter *filter)=0
 
virtual void save ()=0
 
virtual void save (uint32_t total_content_depth)
 
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, uint32_t total_content_depth, DlBlendMode max_content_blend_mode, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt)
 
virtual void restore ()=0
 
virtual void saveLayer (const DlRect *bounds, const SaveLayerOptions options, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt) final
 
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 clipRect (const DlRect &rect, DlClipOp clip_op, bool is_aa)=0
 
virtual void clipOval (const DlRect &bounds, DlClipOp clip_op, bool is_aa)=0
 
virtual void clipRoundRect (const DlRoundRect &rrect, DlClipOp clip_op, bool is_aa)=0
 
virtual void clipRoundSuperellipse (const DlRoundSuperellipse &rse, DlClipOp clip_op, bool is_aa)=0
 
virtual void clipPath (const DlPath &path, DlClipOp clip_op, bool is_aa)=0
 
virtual void drawColor (DlColor color, DlBlendMode mode)=0
 
virtual void drawPaint ()=0
 
virtual void drawLine (const DlPoint &p0, const DlPoint &p1)=0
 
virtual void drawDashedLine (const DlPoint &p0, const DlPoint &p1, DlScalar on_length, DlScalar off_length)=0
 
virtual void drawRect (const DlRect &rect)=0
 
virtual void drawOval (const DlRect &bounds)=0
 
virtual void drawCircle (const DlPoint &center, DlScalar radius)=0
 
virtual void drawRoundRect (const DlRoundRect &rrect)=0
 
virtual void drawDiffRoundRect (const DlRoundRect &outer, const DlRoundRect &inner)=0
 
virtual void drawRoundSuperellipse (const DlRoundSuperellipse &rse)=0
 
virtual void drawPath (const DlPath &path)=0
 
virtual void drawArc (const DlRect &oval_bounds, DlScalar start_degrees, DlScalar sweep_degrees, bool use_center)=0
 
virtual void drawPoints (DlPointMode mode, uint32_t count, const DlPoint points[])=0
 
virtual void drawVertices (const std::shared_ptr< DlVertices > &vertices, DlBlendMode mode)=0
 
virtual void drawImage (const sk_sp< DlImage > image, const DlPoint &point, DlImageSampling sampling, bool render_with_attributes)=0
 
virtual void drawImageRect (const sk_sp< DlImage > image, const DlRect &src, const DlRect &dst, DlImageSampling sampling, bool render_with_attributes, DlSrcRectConstraint constraint=DlSrcRectConstraint::kFast)=0
 
virtual void drawImageNine (const sk_sp< DlImage > image, const DlIRect &center, const DlRect &dst, DlFilterMode filter, bool render_with_attributes)=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 *cull_rect, bool render_with_attributes)=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)=0
 
virtual void drawShadow (const DlPath &path, const DlColor color, const DlScalar elevation, bool transparent_occluder, DlScalar dpr)=0
 

Static Public Attributes

static constexpr int kMaxDrawPointsCount = ((1 << 29) - 1)
 

Detailed Description

Internal API for rendering recorded display lists to backends.

The |DisplayList| object will play back recorded operations in this format. Most developers should not need to deal with this interface unless they are writing a utility that needs to examine the contents of a display list.

Similar to |DlCanvas|, this interface carries clip and transform state which are saved and restored by the |save|, |saveLayer|, and |restore| calls.

Unlike DlCanvas, this interface has attribute state which is global across an entire DisplayList (not affected by save/restore).

DISPLAYLIST DEPTH TRACKING

Each rendering call in the DisplayList stream is assumed to have a "depth" value relative to the beginning of its DisplayList. The depth value is implicitly allocated during recording and only reported in 2 places so it is important for a dispatcher to perform the same internal allocations if it is to make sense of the information reported by the save/saveLayer calls. This depth value is maintained as follows:

  • The absolute depth value is never reported, only the total depth size of the entire DisplayList or one of its save/restore pairs is reported. Since the DisplayList might be dispatched recursively due to embedded drawDisplayList calls, these depth size values will often be relative to things like:
    • the start of a given save/saveLayer group
    • the start of a DisplayList dispatch or recursion as such, only totals for groups of DisplayList dispatched calls will be reported. These totals will be reported in:
    • the DisplayList::total_depth() method reporting the total depth accumulated for every operation in the DisplayList
    • the save/saveLayer dispatch calls will report the total depth accumulated for every call until their corresponding restore call.
  • The depth value is incremented for every drawing operation, including:
    • all draw* calls (including drawDisplayList)
    • drawDisplayList will also accumulate the total_depth() of the DisplayList object it is drawing (in other words it will skip enough depth values for each drawing call in the child). This bump is in addition to the depth value it records for being a rendering operation. Some implementations may need to surround the actual drawDisplayList with a protective saveLayer, but others may not - so the implicit depth value assigned to the drawDisplayList call itself may go unused, but must be accounted for.
    • a saveLayer call will also increment the depth value just like a rendering call. This is in addition to the depth of its content. It is doing so to reserve a depth for the drawing operation that copies its layer back to the parent.
  • Each save() or saveLayer() call will report the total depth of all rendering calls within its content (recorded before the corresponding restore) and report this total during dispatch. This information might be needed to assign depths to the clip operations that occur within its content. As there is no enclosing saveLayer/restore pair around the root of a DisplayList, the total depth of the DisplayList can be used to determine the appropriate clip depths for any clip ops appearing before the first save/saveLayer or after the last restore.
See also
DlSkCanvasDispatcher
impeller::DlDispatcher
DlOpSpy

Definition at line 90 of file dl_op_receiver.h.

Member Function Documentation

◆ clipOval()

virtual void flutter::DlOpReceiver::clipOval ( const DlRect bounds,
DlClipOp  clip_op,
bool  is_aa 
)
pure virtual

◆ clipPath()

virtual void flutter::DlOpReceiver::clipPath ( const DlPath path,
DlClipOp  clip_op,
bool  is_aa 
)
pure virtual

◆ clipRect()

virtual void flutter::DlOpReceiver::clipRect ( const DlRect rect,
DlClipOp  clip_op,
bool  is_aa 
)
pure virtual

◆ clipRoundRect()

virtual void flutter::DlOpReceiver::clipRoundRect ( const DlRoundRect rrect,
DlClipOp  clip_op,
bool  is_aa 
)
pure virtual

◆ clipRoundSuperellipse()

virtual void flutter::DlOpReceiver::clipRoundSuperellipse ( const DlRoundSuperellipse rse,
DlClipOp  clip_op,
bool  is_aa 
)
pure virtual

◆ drawArc()

virtual void flutter::DlOpReceiver::drawArc ( const DlRect oval_bounds,
DlScalar  start_degrees,
DlScalar  sweep_degrees,
bool  use_center 
)
pure virtual

◆ drawAtlas()

virtual void flutter::DlOpReceiver::drawAtlas ( const sk_sp< DlImage atlas,
const DlRSTransform  xform[],
const DlRect  tex[],
const DlColor  colors[],
int  count,
DlBlendMode  mode,
DlImageSampling  sampling,
const DlRect cull_rect,
bool  render_with_attributes 
)
pure virtual

◆ drawCircle()

◆ drawColor()

◆ drawDashedLine()

virtual void flutter::DlOpReceiver::drawDashedLine ( const DlPoint p0,
const DlPoint p1,
DlScalar  on_length,
DlScalar  off_length 
)
pure virtual

◆ drawDiffRoundRect()

virtual void flutter::DlOpReceiver::drawDiffRoundRect ( const DlRoundRect outer,
const DlRoundRect inner 
)
pure virtual

◆ drawDisplayList()

◆ drawImage()

virtual void flutter::DlOpReceiver::drawImage ( const sk_sp< DlImage image,
const DlPoint point,
DlImageSampling  sampling,
bool  render_with_attributes 
)
pure virtual

◆ drawImageNine()

virtual void flutter::DlOpReceiver::drawImageNine ( const sk_sp< DlImage image,
const DlIRect center,
const DlRect dst,
DlFilterMode  filter,
bool  render_with_attributes 
)
pure virtual

◆ drawImageRect()

virtual void flutter::DlOpReceiver::drawImageRect ( const sk_sp< DlImage image,
const DlRect src,
const DlRect dst,
DlImageSampling  sampling,
bool  render_with_attributes,
DlSrcRectConstraint  constraint = DlSrcRectConstraint::kFast 
)
pure virtual

◆ drawLine()

◆ drawOval()

◆ drawPaint()

◆ drawPath()

◆ drawPoints()

◆ drawRect()

◆ drawRoundRect()

◆ drawRoundSuperellipse()

◆ drawShadow()

virtual void flutter::DlOpReceiver::drawShadow ( const DlPath path,
const DlColor  color,
const DlScalar  elevation,
bool  transparent_occluder,
DlScalar  dpr 
)
pure virtual

◆ drawText()

◆ drawVertices()

◆ restore()

◆ rotate()

◆ save() [1/2]

◆ save() [2/2]

virtual void flutter::DlOpReceiver::save ( uint32_t  total_content_depth)
inlinevirtual

Reimplemented in flutter::testing::DepthExpector, impeller::DlDispatcherBase, and impeller::CanvasDlDispatcher.

Definition at line 123 of file dl_op_receiver.h.

123{ save(); }
virtual void save()=0

References save().

Referenced by save().

◆ saveLayer() [1/3]

virtual void flutter::DlOpReceiver::saveLayer ( const DlRect bounds,
const SaveLayerOptions options,
uint32_t  total_content_depth,
DlBlendMode  max_content_blend_mode,
const DlImageFilter backdrop = nullptr,
std::optional< int64_t >  backdrop_id = std::nullopt 
)
inlinevirtual

Reimplemented in impeller::DlDispatcherBase, impeller::CanvasDlDispatcher, flutter::testing::SaveLayerExpector, and flutter::testing::DepthExpector.

Definition at line 146 of file dl_op_receiver.h.

151 {
152 saveLayer(bounds, options, backdrop, backdrop_id);
153 }
virtual void saveLayer(const DlRect &bounds, const SaveLayerOptions options, const DlImageFilter *backdrop=nullptr, std::optional< int64_t > backdrop_id=std::nullopt)=0

References saveLayer().

◆ saveLayer() [2/3]

◆ saveLayer() [3/3]

virtual void flutter::DlOpReceiver::saveLayer ( const DlRect bounds,
const SaveLayerOptions  options,
const DlImageFilter backdrop = nullptr,
std::optional< int64_t >  backdrop_id = std::nullopt 
)
inlinefinalvirtual

Definition at line 171 of file dl_op_receiver.h.

175 {
176 if (bounds) {
177 saveLayer(*bounds, options.with_bounds_from_caller(), backdrop,
178 backdrop_id);
179 } else {
180 saveLayer(DlRect(), options.without_bounds_from_caller(), backdrop,
181 backdrop_id);
182 }
183 }
impeller::Rect DlRect

References saveLayer().

◆ scale()

◆ setAntiAlias()

◆ setBlendMode()

◆ setColor()

◆ setColorFilter()

◆ setColorSource()

◆ setDrawStyle()

◆ setImageFilter()

◆ setInvertColors()

◆ setMaskFilter()

◆ setStrokeCap()

◆ setStrokeJoin()

◆ setStrokeMiter()

◆ setStrokeWidth()

◆ skew()

◆ transform2DAffine()

◆ transformFullPerspective()

◆ transformReset()

◆ translate()

Member Data Documentation

◆ kMaxDrawPointsCount

constexpr int flutter::DlOpReceiver::kMaxDrawPointsCount = ((1 << 29) - 1)
staticconstexpr

Definition at line 93 of file dl_op_receiver.h.


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