| Flutter Impeller |

Public Member Functions | List of all members
impeller::CanvasDlDispatcher Class Reference

`#include <dl_dispatcher.h>`

Inheritance diagram for impeller::CanvasDlDispatcher:

## Public Member Functions
| CanvasDlDispatcher (ContentContext &renderer, RenderTarget &render_target, bool has_root_backdrop_filter, flutter::DlBlendMode max_root_blend_mode, IRect cull_rect)
| ~CanvasDlDispatcher ()=default
void | save () override
void | saveLayer (const DlRect &bounds, const flutter::SaveLayerOptions options, const flutter::DlImageFilter *backdrop) 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) 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) 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, ClipOp clip_op, bool is_aa) override
void | clipOval (const DlRect &bounds, ClipOp clip_op, bool is_aa) override
void | clipRRect (const SkRRect &rrect, ClipOp clip_op, bool is_aa) override
void | clipPath (const DlPath &path, ClipOp 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 | drawRRect (const SkRRect &rrect) override
void | drawDRRect (const SkRRect &outer, const SkRRect &inner) 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 (PointMode 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, SrcRectConstraint 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 SkRSXform 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 246 of file dl_dispatcher.h.

## Constructor & Destructor Documentation

## ◆ CanvasDlDispatcher()

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

Definition at line 951 of file dl_dispatcher.cc.

956 : canvas_(renderer,
957 render_target,
958 has_root_backdrop_filter ||
959 RequiresReadbackForBlends(renderer, max_root_blend_mode),
960 cull_rect),
961 renderer_(renderer) {}

## ◆ ~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 967 of file dl_dispatcher.cc.

969 {
970 AUTO_DEPTH_WATCHER(1u);
971
972 GetCanvas().DrawVertices(
973 std::make_shared<DlVerticesGeometry>(vertices, renderer_),
974 skia_conversions::ToBlendMode(dl_mode), paint_);
975 }

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

## ◆ FinishRecording()

void impeller::CanvasDlDispatcher::FinishRecording | ( |  | ) |
| inline

Definition at line 274 of file dl_dispatcher.h.

274 { canvas_.EndReplay(); }

References impeller::Canvas::EndReplay().

Referenced by impeller::DisplayListToTexture(), impeller::DlPlayground::OpenPlaygroundHere(), impeller::AiksPlayground::OpenPlaygroundHere(), and impeller::RenderToOnscreen().

## ◆ save() [1/2]

void impeller::CanvasDlDispatcher::save | ( |  | ) |
| inlineoverride

Definition at line 257 of file dl_dispatcher.h.

257 {
258 // This dispatcher should never be used with the save() variant
259 // that does not include the content_depth parameter.
260 FML_UNREACHABLE();
261 }

## ◆ save() [2/2]

void impeller::DlDispatcherBase::save
| override

Definition at line 294 of file dl_dispatcher.cc.

294 {
295 AUTO_DEPTH_WATCHER(1u);
296
297 GetCanvas().Save(total_content_depth);
298 }

## ◆ saveLayer() [1/2]

void impeller::DlDispatcherBase::saveLayer
| override

Definition at line 301 of file dl_dispatcher.cc.

305 {
306 AUTO_DEPTH_WATCHER(1u);
307
308 auto paint = options.renders_with_attributes() ? paint_ : Paint{};
309 auto promise = options.content_is_clipped()
310 ? ContentBoundsPromise::kMayClipContents
311 : ContentBoundsPromise::kContainsContents;
312 std::optional<Rect> impeller_bounds;
313 // If the content is unbounded but has developer specified bounds, we take
314 // the original bounds so that we clip the content as expected.
315 if (!options.content_is_unbounded() || options.bounds_from_caller()) {
316 impeller_bounds = bounds;
317 }
318
319 GetCanvas().SaveLayer(
320 paint, impeller_bounds, backdrop, promise, total_content_depth,
321 // Unbounded content can still have user specified bounds that require a
322 // saveLayer to be created to perform the clip.
323 options.can_distribute_opacity() && !options.content_is_unbounded());
324 }

## ◆ saveLayer() [2/2]

void impeller::CanvasDlDispatcher::saveLayer | ( | const DlRect & | bounds,
|  | const flutter::SaveLayerOptions | options,
|  | const flutter::DlImageFilter * | backdrop
| ) |  |
| inlineoverride

Definition at line 265 of file dl_dispatcher.h.

267 {
268 // This dispatcher should never be used with the saveLayer() variant
269 // that does not include the content_depth parameter.
270 FML_UNREACHABLE();
271 }

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

- impeller/display_list/dl_dispatcher.h
- impeller/display_list/dl_dispatcher.cc

AUTO_DEPTH_WATCHER
#define AUTO_DEPTH_WATCHER(d)
Definition: dl_dispatcher.cc:110
impeller::ContentBoundsPromise::kMayClipContents
@ kMayClipContents
The caller claims the bounds are a subset of an estimate of the reasonably tight bounds but likely cl...
impeller::Canvas::SaveLayer
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)
Definition: canvas.cc:982
impeller::Canvas::DrawVertices
void DrawVertices(const std::shared_ptr< VerticesGeometry > &vertices, BlendMode blend_mode, const Paint &paint)
Definition: canvas.cc:758
impeller::skia_conversions::ToBlendMode
BlendMode ToBlendMode(flutter::DlBlendMode mode)
Definition: skia_conversions.cc:204
impeller::DlDispatcherBase::paint_
Paint paint_
Definition: dl_dispatcher.h:238
impeller::Canvas::Save
void Save(uint32_t total_content_depth=kMaxDepth)
Definition: canvas.cc:934
impeller::Canvas::EndReplay
void EndReplay()
Definition: canvas.cc:1639
impeller::ContentBoundsPromise::kContainsContents
@ kContainsContents
The caller claims the bounds are a reasonably tight estimate of the coverage of the contents and shou...
impeller::RequiresReadbackForBlends
static bool RequiresReadbackForBlends(const ContentContext &renderer, flutter::DlBlendMode max_root_blend_mode)
Subclasses.
Definition: dl_dispatcher.cc:943