Flutter Impeller
impeller::CanvasDlDispatcher Class Reference

#include <dl_dispatcher.h>

Inheritance diagram for impeller::CanvasDlDispatcher:
impeller::DlDispatcherBase

Public Member Functions

 CanvasDlDispatcher (ContentContext &renderer, RenderTarget &render_target, bool is_onscreen, bool has_root_backdrop_filter, flutter::DlBlendMode max_root_blend_mode, IRect cull_rect)
 
 ~CanvasDlDispatcher ()=default
 
void SetBackdropData (std::unordered_map< int64_t, BackdropData > backdrop, size_t backdrop_count)
 
void save () override
 
void saveLayer (const DlRect &bounds, const flutter::SaveLayerOptions options, const flutter::DlImageFilter *backdrop, std::optional< int64_t > backdrop_id) override
 
void FinishRecording ()
 
void drawVertices (const std::shared_ptr< flutter::DlVertices > &vertices, flutter::DlBlendMode dl_mode) 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
 
- Public Member Functions inherited from impeller::DlDispatcherBase
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 &center, 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 &center, 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 drawTextBlob (const sk_sp< SkTextBlob > blob, DlScalar x, DlScalar y) override
 
void drawTextFrame (const std::shared_ptr< impeller::TextFrame > &text_frame, DlScalar x, DlScalar y) override
 
void drawShadow (const DlPath &path, const flutter::DlColor color, const DlScalar elevation, bool transparent_occluder, DlScalar dpr) override
 

Additional Inherited Members

- Static Protected Member Functions inherited from impeller::DlDispatcherBase
static void SimplifyOrDrawPath (Canvas &canvas, const DlPath &cache, const Paint &paint)
 
- Protected Attributes inherited from impeller::DlDispatcherBase
Paint paint_
 
Matrix initial_matrix_
 

Detailed Description

Definition at line 268 of file dl_dispatcher.h.

Constructor & Destructor Documentation

◆ CanvasDlDispatcher()

impeller::CanvasDlDispatcher::CanvasDlDispatcher ( ContentContext renderer,
RenderTarget render_target,
bool  is_onscreen,
bool  has_root_backdrop_filter,
flutter::DlBlendMode  max_root_blend_mode,
IRect  cull_rect 
)

Definition at line 948 of file dl_dispatcher.cc.

954  : canvas_(renderer,
955  render_target,
956  is_onscreen,
957  has_root_backdrop_filter ||
958  RequiresReadbackForBlends(renderer, max_root_blend_mode),
959  cull_rect),
960  renderer_(renderer) {}
static bool RequiresReadbackForBlends(const ContentContext &renderer, flutter::DlBlendMode max_root_blend_mode)
Subclasses.

◆ ~CanvasDlDispatcher()

impeller::CanvasDlDispatcher::~CanvasDlDispatcher ( )
default

Member Function Documentation

◆ drawVertices()

void impeller::CanvasDlDispatcher::drawVertices ( const std::shared_ptr< flutter::DlVertices > &  vertices,
flutter::DlBlendMode  dl_mode 
)
override

Definition at line 966 of file dl_dispatcher.cc.

968  {
969  AUTO_DEPTH_WATCHER(1u);
970 
971  GetCanvas().DrawVertices(
972  std::make_shared<DlVerticesGeometry>(vertices, renderer_), dl_mode,
973  paint_);
974 }
void DrawVertices(const std::shared_ptr< VerticesGeometry > &vertices, BlendMode blend_mode, const Paint &paint)
Definition: canvas.cc:1004
#define AUTO_DEPTH_WATCHER(d)

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawVertices(), and impeller::DlDispatcherBase::paint_.

◆ FinishRecording()

void impeller::CanvasDlDispatcher::FinishRecording ( )
inline

Definition at line 301 of file dl_dispatcher.h.

301 { canvas_.EndReplay(); }
void EndReplay()
Definition: canvas.cc:2086

References impeller::Canvas::EndReplay().

Referenced by impeller::DisplayListToTexture(), and impeller::RenderToTarget().

◆ save() [1/2]

void impeller::CanvasDlDispatcher::save ( )
inlineoverride

Definition at line 283 of file dl_dispatcher.h.

283  {
284  // This dispatcher should never be used with the save() variant
285  // that does not include the content_depth parameter.
286  FML_UNREACHABLE();
287  }

◆ save() [2/2]

void impeller::DlDispatcherBase::save
override

Definition at line 73 of file dl_dispatcher.cc.

300  {
301  AUTO_DEPTH_WATCHER(1u);
302 
303  GetCanvas().Save(total_content_depth);
304 }
void Save(uint32_t total_content_depth=kMaxDepth)
Definition: canvas.cc:1183

◆ saveLayer() [1/2]

void impeller::DlDispatcherBase::saveLayer
override

Definition at line 76 of file dl_dispatcher.cc.

312  {
313  AUTO_DEPTH_WATCHER(1u);
314 
315  auto paint = options.renders_with_attributes() ? paint_ : Paint{};
316  auto promise = options.content_is_clipped()
319  std::optional<Rect> impeller_bounds;
320  // If the content is unbounded but has developer specified bounds, we take
321  // the original bounds so that we clip the content as expected.
322  if (!options.content_is_unbounded() || options.bounds_from_caller()) {
323  impeller_bounds = bounds;
324  }
325 
326  GetCanvas().SaveLayer(
327  paint, impeller_bounds, backdrop, promise, total_content_depth,
328  // Unbounded content can still have user specified bounds that require a
329  // saveLayer to be created to perform the clip.
330  options.can_distribute_opacity() && !options.content_is_unbounded(),
331  backdrop_id //
332  );
333 }
void SaveLayer(const Paint &paint, std::optional< Rect > bounds=std::nullopt, const flutter::DlImageFilter *backdrop_filter=nullptr, ContentBoundsPromise bounds_promise=ContentBoundsPromise::kUnknown, uint32_t total_content_depth=kMaxDepth, bool can_distribute_opacity=false, std::optional< int64_t > backdrop_id=std::nullopt)
Definition: canvas.cc:1231
@ kMayClipContents
The caller claims the bounds are a subset of an estimate of the reasonably tight bounds but likely cl...
@ kContainsContents
The caller claims the bounds are a reasonably tight estimate of the coverage of the contents and shou...

References impeller::Canvas::GetMaxOpDepth(), and impeller::Canvas::GetOpDepth().

◆ saveLayer() [2/2]

void impeller::CanvasDlDispatcher::saveLayer ( const DlRect bounds,
const flutter::SaveLayerOptions  options,
const flutter::DlImageFilter *  backdrop,
std::optional< int64_t >  backdrop_id 
)
inlineoverride

Definition at line 291 of file dl_dispatcher.h.

294  {
295  // This dispatcher should never be used with the saveLayer() variant
296  // that does not include the content_depth parameter.
297  FML_UNREACHABLE();
298  }

◆ SetBackdropData()

void impeller::CanvasDlDispatcher::SetBackdropData ( std::unordered_map< int64_t, BackdropData backdrop,
size_t  backdrop_count 
)

Definition at line 976 of file dl_dispatcher.cc.

978  {
979  GetCanvas().SetBackdropData(std::move(backdrop), backdrop_count);
980 }
void SetBackdropData(std::unordered_map< int64_t, BackdropData > backdrop_data, size_t backdrop_count)
Update the backdrop data used to group together backdrop filters within the same layer.
Definition: canvas.cc:1882

References impeller::Canvas::SetBackdropData().

Referenced by impeller::DisplayListToTexture(), and impeller::RenderToTarget().


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