| Flutter Impeller |

Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
impeller::DlDispatcherBase Class Referenceabstract

`#include <dl_dispatcher.h>`

Inheritance diagram for impeller::DlDispatcherBase:

## Public Member Functions
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 | 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

## Static Protected Member Functions
static void | SimplifyOrDrawPath (Canvas &canvas, const DlPath &cache, const Paint &paint)

## Protected Attributes
Paint | paint_
Matrix | initial_matrix_

## Detailed Description

Definition at line 31 of file dl_dispatcher.h.

## Member Function Documentation

## ◆ clipOval()

void impeller::DlDispatcherBase::clipOval | ( | const DlRect & | bounds,
|  | flutter::DlClipOp | clip_op,
|  | bool | is_aa
| ) |  |
| override

Definition at line 434 of file dl_dispatcher.cc.

436 {
437 AUTO_DEPTH_WATCHER(0u);
438
439 EllipseGeometry geom(bounds);
440 GetCanvas().ClipGeometry(geom, ToClipOperation(clip_op));
441 }
impeller::Canvas::ClipGeometry
void ClipGeometry(const Geometry &geometry, Entity::ClipOperation clip_op, bool is_aa=true)
Definition: canvas.cc:1024
impeller::DlDispatcherBase::GetCanvas
virtual Canvas & GetCanvas()=0
AUTO_DEPTH_WATCHER
#define AUTO_DEPTH_WATCHER(d)
Definition: dl_dispatcher.cc:114
impeller::ToClipOperation
static Entity::ClipOperation ToClipOperation(flutter::DlClipOp clip_op)
Definition: dl_dispatcher.cc:414

References AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), GetCanvas(), and impeller::ToClipOperation().

## ◆ clipPath()

void impeller::DlDispatcherBase::clipPath | ( | const DlPath & | path,
|  | flutter::DlClipOp | clip_op,
|  | bool | is_aa
| ) |  |
| override

Definition at line 485 of file dl_dispatcher.cc.

487 {
488 AUTO_DEPTH_WATCHER(0u);
489
490 auto clip_op = ToClipOperation(sk_op);
491
492 DlRect rect;
493 if (path.IsRect(&rect)) {
494 FillRectGeometry geom(rect);
495 GetCanvas().ClipGeometry(geom, clip_op, /*is_aa=*/is_aa);
496 } else if (path.IsOval(&rect)) {
497 EllipseGeometry geom(rect);
498 GetCanvas().ClipGeometry(geom, clip_op);
499 } else {
500 DlRoundRect rrect;
501 if (path.IsRoundRect(&rrect) && rrect.GetRadii().AreAllCornersSame()) {
502 RoundRectGeometry geom(rrect.GetBounds(), rrect.GetRadii().top_left);
503 GetCanvas().ClipGeometry(geom, clip_op);
504 } else {
505 FillPathGeometry geom(path);
506 GetCanvas().ClipGeometry(geom, clip_op);
507 }
508 }
509 }
impeller::DlRect
flutter::DlRect DlRect
Definition: dl_dispatcher.h:25
impeller::DlRoundRect
flutter::DlRoundRect DlRoundRect
Definition: dl_dispatcher.h:27

References AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), GetCanvas(), and impeller::ToClipOperation().

## ◆ clipRect()

void impeller::DlDispatcherBase::clipRect | ( | const DlRect & | rect,
|  | flutter::DlClipOp | clip_op,
|  | bool | is_aa
| ) |  |
| override

Definition at line 424 of file dl_dispatcher.cc.

426 {
427 AUTO_DEPTH_WATCHER(0u);
428
429 FillRectGeometry geom(rect);
430 GetCanvas().ClipGeometry(geom, ToClipOperation(clip_op), /*is_aa=*/is_aa);
431 }

References AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), GetCanvas(), and impeller::ToClipOperation().

## ◆ clipRoundRect()

void impeller::DlDispatcherBase::clipRoundRect | ( | const DlRoundRect & | rrect,
|  | flutter::DlClipOp | clip_op,
|  | bool | is_aa
| ) |  |
| override

Definition at line 444 of file dl_dispatcher.cc.

446 {
447 AUTO_DEPTH_WATCHER(0u);
448
449 auto clip_op = ToClipOperation(sk_op);
450 if (rrect.IsRect()) {
451 FillRectGeometry geom(rrect.GetBounds());
452 GetCanvas().ClipGeometry(geom, clip_op, /*is_aa=*/is_aa);
453 } else if (rrect.IsOval()) {
454 EllipseGeometry geom(rrect.GetBounds());
455 GetCanvas().ClipGeometry(geom, clip_op);
456 } else if (rrect.GetRadii().AreAllCornersSame()) {
457 RoundRectGeometry geom(rrect.GetBounds(), rrect.GetRadii().top_left);
458 GetCanvas().ClipGeometry(geom, clip_op);
459 } else {
460 FillRoundRectGeometry geom(rrect);
461 GetCanvas().ClipGeometry(geom, clip_op);
462 }
463 }

References AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), GetCanvas(), and impeller::ToClipOperation().

## ◆ clipRoundSuperellipse()

void impeller::DlDispatcherBase::clipRoundSuperellipse | ( | const DlRoundSuperellipse & | rse,
|  | flutter::DlClipOp | clip_op,
|  | bool | is_aa
| ) |  |
| override

Definition at line 466 of file dl_dispatcher.cc.

468 {
469 AUTO_DEPTH_WATCHER(0u);
470
471 auto clip_op = ToClipOperation(sk_op);
472 if (rse.IsRect()) {
473 FillRectGeometry geom(rse.GetBounds());
474 GetCanvas().ClipGeometry(geom, clip_op, /*is_aa=*/is_aa);
475 } else if (rse.IsOval()) {
476 EllipseGeometry geom(rse.GetBounds());
477 GetCanvas().ClipGeometry(geom, clip_op);
478 } else {
479 RoundSuperellipseGeometry geom(rse.GetBounds(), rse.GetRadii());
480 GetCanvas().ClipGeometry(geom, clip_op);
481 }
482 }

References AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), GetCanvas(), and impeller::ToClipOperation().

## ◆ drawArc()

void impeller::DlDispatcherBase::drawArc | ( | const DlRect & | oval_bounds,
|  | DlScalar | start_degrees,
|  | DlScalar | sweep_degrees,
|  | bool | use_center
| ) |  |
| override

Definition at line 630 of file dl_dispatcher.cc.

633 {
634 AUTO_DEPTH_WATCHER(1u);
635
636 GetCanvas().DrawArc(Arc(oval_bounds, Degrees(start_degrees),
637 Degrees(sweep_degrees), use_center),
638 paint_);
639 }
use_center
bool use_center
Definition: aiks_dl_basic_unittests.cc:830
impeller::Canvas::DrawArc
void DrawArc(const Arc &arc, const Paint &paint)
Definition: canvas.cc:873
impeller::DlDispatcherBase::paint_
Paint paint_
Definition: dl_dispatcher.h:255

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawArc(), GetCanvas(), paint_, and use_center.

## ◆ drawAtlas()

void impeller::DlDispatcherBase::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

Definition at line 750 of file dl_dispatcher.cc.

758 {
759 AUTO_DEPTH_WATCHER(1u);
760
761 auto geometry =
762 DlAtlasGeometry(atlas->impeller_texture(), //
763 xform, //
764 tex, //
765 colors, //
766 static_cast<size_t>(count), //
767 mode, //
768 skia_conversions::ToSamplerDescriptor(sampling), //
769 ToOptRect(cull_rect) //
770 );
771 auto atlas_contents = std::make_shared<AtlasContents>();
772 atlas_contents->SetGeometry(&geometry);
773
774 GetCanvas().DrawAtlas(atlas_contents, paint_);
775 }
impeller::Canvas::DrawAtlas
void DrawAtlas(const std::shared_ptr< AtlasContents > &atlas_contents, const Paint &paint)
Definition: canvas.cc:1317
impeller::skia_conversions::ToSamplerDescriptor
impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlImageSampling options)
Definition: skia_conversions.cc:24
impeller::ToOptRect
static std::optional< const Rect > ToOptRect(const flutter::DlRect *rect)
Definition: dl_dispatcher.cc:140

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawAtlas(), GetCanvas(), paint_, impeller::ToOptRect(), and impeller::skia_conversions::ToSamplerDescriptor().

## ◆ drawCircle()

void impeller::DlDispatcherBase::drawCircle | ( | const DlPoint & | center,
|  | DlScalar | radius
| ) |  |
| override

Definition at line 561 of file dl_dispatcher.cc.

561 {
562 AUTO_DEPTH_WATCHER(1u);
563
564 GetCanvas().DrawCircle(center, radius, paint_);
565 }
impeller::Canvas::DrawCircle
void DrawCircle(const Point &center, Scalar radius, const Paint &paint)
Definition: canvas.cc:995

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawCircle(), GetCanvas(), and paint_.

## ◆ drawColor()

void impeller::DlDispatcherBase::drawColor | ( | flutter::DlColor | color,
|  | flutter::DlBlendMode | mode
| ) |  |
| override

Definition at line 512 of file dl_dispatcher.cc.

513 {
514 AUTO_DEPTH_WATCHER(1u);
515
516 Paint paint;
517 paint.color = skia_conversions::ToColor(color);
518 paint.blend_mode = dl_mode;
519 GetCanvas().DrawPaint(paint);
520 }
impeller::Canvas::DrawPaint
void DrawPaint(const Paint &paint)
Definition: canvas.cc:433
impeller::skia_conversions::ToColor
Color ToColor(const flutter::DlColor &color)
Definition: skia_conversions.cc:13

References AUTO_DEPTH_WATCHER, impeller::Paint::blend_mode, impeller::Paint::color, impeller::Canvas::DrawPaint(), GetCanvas(), and impeller::skia_conversions::ToColor().

## ◆ drawDashedLine()

void impeller::DlDispatcherBase::drawDashedLine | ( | const DlPoint & | p0,
|  | const DlPoint & | p1,
|  | DlScalar | on_length,
|  | DlScalar | off_length
| ) |  |
| override

Definition at line 537 of file dl_dispatcher.cc.

540 {
541 AUTO_DEPTH_WATCHER(1u);
542
543 GetCanvas().DrawDashedLine(p0, p1, on_length, off_length, paint_);
544 }
impeller::Canvas::DrawDashedLine
void DrawDashedLine(const Point &p0, const Point &p1, Scalar on_length, Scalar off_length, const Paint &paint)
Definition: canvas.cc:785

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawDashedLine(), GetCanvas(), and paint_.

## ◆ drawDiffRoundRect()

void impeller::DlDispatcherBase::drawDiffRoundRect | ( | const DlRoundRect & | outer,
|  | const DlRoundRect & | inner
| ) |  |
| override

Definition at line 575 of file dl_dispatcher.cc.

576 {
577 AUTO_DEPTH_WATCHER(1u);
578
579 GetCanvas().DrawDiffRoundRect(outer, inner, paint_);
580 }
impeller::Canvas::DrawDiffRoundRect
void DrawDiffRoundRect(const RoundRect &outer, const RoundRect &inner, const Paint &paint)
Definition: canvas.cc:957

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawDiffRoundRect(), GetCanvas(), and paint_.

## ◆ drawDisplayList()

void impeller::DlDispatcherBase::drawDisplayList | ( | const sk_sp< flutter::DisplayList > | display_list,
|  | DlScalar | opacity
| ) |  |
| override

Definition at line 778 of file dl_dispatcher.cc.

780 {
781 AUTO_DEPTH_WATCHER(display_list->total_depth());
782
783 // Save all values that must remain untouched after the operation.
784 Paint saved_paint = paint_;
785 Matrix saved_initial_matrix = initial_matrix_;
786
787 // Establish a new baseline for interpreting the new DL.
788 // Matrix and clip are left untouched, the current
789 // transform is saved as the new base matrix, and paint
790 // values are reset to defaults.
791 initial_matrix_ = GetCanvas().GetCurrentTransform();
792 paint_ = Paint();
793
794 // Handle passed opacity in the most brute-force way by using
795 // a SaveLayer. If the display_list is able to inherit the
796 // opacity, this could also be handled by modulating all of its
797 // attribute settings (for example, color), by the indicated
798 // opacity.
799 int restore_count = GetCanvas().GetSaveCount();
800 if (opacity < SK_Scalar1) {
801 Paint save_paint;
802 save_paint.color = Color(0, 0, 0, opacity);
803 GetCanvas().SaveLayer(save_paint, display_list->GetBounds(), nullptr,
804 ContentBoundsPromise::kContainsContents,
805 display_list->total_depth(),
806 display_list->can_apply_group_opacity());
807 } else {
808 // The display list may alter the clip, which must be restored to the
809 // current clip at the end of playback.
810 GetCanvas().Save(display_list->total_depth());
811 }
812
813 // TODO(131445): Remove this restriction if we can correctly cull with
814 // perspective transforms.
815 if (display_list->has_rtree() && !initial_matrix_.HasPerspective()) {
816 // The canvas remembers the screen-space culling bounds clipped by
817 // the surface and the history of clip calls. DisplayList can cull
818 // the ops based on a rectangle expressed in its "destination bounds"
819 // so we need the canvas to transform those into the current local
820 // coordinate space into which the DisplayList will be rendered.
821 auto global_culling_bounds = GetCanvas().GetLocalCoverageLimit();
822 if (global_culling_bounds.has_value()) {
823 Rect cull_rect = global_culling_bounds->TransformBounds(
824 GetCanvas().GetCurrentTransform().Invert());
825 display_list->Dispatch(*this, cull_rect);
826 } else {
827 // If the culling bounds are empty, this display list can be skipped
828 // entirely.
829 }
830 } else {
831 display_list->Dispatch(*this);
832 }
833
834 // Restore all saved state back to what it was before we interpreted
835 // the display_list
836 AUTO_DEPTH_CHECK();
837 GetCanvas().RestoreToCount(restore_count);
838 initial_matrix_ = saved_initial_matrix;
839 paint_ = saved_paint;
840 }
impeller::Canvas::GetLocalCoverageLimit
std::optional< Rect > GetLocalCoverageLimit() const
Return the culling bounds of the current render target, or nullopt if there is no coverage.
Definition: canvas.cc:1402
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, std::optional< int64_t > backdrop_id=std::nullopt)
Definition: canvas.cc:1439
impeller::Canvas::GetCurrentTransform
const Matrix & GetCurrentTransform() const
Definition: canvas.cc:358
impeller::Canvas::RestoreToCount
void RestoreToCount(size_t count)
Definition: canvas.cc:405
impeller::Canvas::GetSaveCount
size_t GetSaveCount() const
Definition: canvas.cc:397
impeller::Canvas::Save
void Save(uint32_t total_content_depth=kMaxDepth)
Definition: canvas.cc:1385
impeller::DlDispatcherBase::initial_matrix_
Matrix initial_matrix_
Definition: dl_dispatcher.h:256
AUTO_DEPTH_CHECK
#define AUTO_DEPTH_CHECK()
Definition: dl_dispatcher.cc:115
impeller::Rect
TRect< Scalar > Rect
Definition: rect.h:788
impeller::ContentBoundsPromise::kContainsContents
@ kContainsContents
The caller claims the bounds are a reasonably tight estimate of the coverage of the contents and shou...
impeller::Matrix::HasPerspective
constexpr bool HasPerspective() const
Definition: matrix.h:418
impeller::TRect::TransformBounds
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
Definition: rect.h:472

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().

## ◆ drawImage()

void impeller::DlDispatcherBase::drawImage | ( | const sk_sp< flutter::DlImage > | image,
|  | const DlPoint & | point,
|  | flutter::DlImageSampling | sampling,
|  | bool | render_with_attributes
| ) |  |
| override

Definition at line 686 of file dl_dispatcher.cc.

689 {
690 AUTO_DEPTH_WATCHER(1u);
691
692 if (!image) {
693 return;
694 }
695
696 auto texture = image->impeller_texture();
697 if (!texture) {
698 return;
699 }
700
701 const auto size = texture->GetSize();
702 const auto src = DlRect::MakeWH(size.width, size.height);
703 const auto dest = DlRect::MakeXYWH(point.x, point.y, size.width, size.height);
704
705 drawImageRect(image, // image
706 src, // source rect
707 dest, // destination rect
708 sampling, // sampling options
709 render_with_attributes, // render with attributes
710 flutter::DlSrcRectConstraint::kStrict // constraint
711 );
712 }
impeller::DlDispatcherBase::drawImageRect
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
Definition: dl_dispatcher.cc:715

References AUTO_DEPTH_WATCHER, and drawImageRect().

## ◆ drawImageNine()

void impeller::DlDispatcherBase::drawImageNine | ( | const sk_sp< flutter::DlImage > | image,
|  | const DlIRect & | center,
|  | const DlRect & | dst,
|  | flutter::DlFilterMode | filter,
|  | bool | render_with_attributes
| ) |  |
| override

Definition at line 734 of file dl_dispatcher.cc.

738 {
739 AUTO_DEPTH_WATCHER(9u);
740
741 NinePatchConverter converter = {};
742 converter.DrawNinePatch(image->impeller_texture(),
743 Rect::MakeLTRB(center.GetLeft(), center.GetTop(),
744 center.GetRight(), center.GetBottom()),
745 dst, ToSamplerDescriptor(filter), &GetCanvas(),
746 &paint_);
747 }
impeller::ToSamplerDescriptor
static impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlFilterMode options)
Definition: dl_dispatcher.cc:122
impeller::TRect< Scalar >::MakeLTRB
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
Definition: rect.h:129

References AUTO_DEPTH_WATCHER, impeller::NinePatchConverter::DrawNinePatch(), GetCanvas(), impeller::TRect< Scalar >::MakeLTRB(), paint_, and impeller::ToSamplerDescriptor().

## ◆ drawImageRect()

void impeller::DlDispatcherBase::drawImageRect | ( | const sk_sp< flutter::DlImage > | image,
|  | const DlRect & | src,
|  | const DlRect & | dst,
|  | flutter::DlImageSampling | sampling,
|  | bool | render_with_attributes,
|  | flutter::DlSrcRectConstraint | constraint = `flutter::DlSrcRectConstraint::kFast`
| ) |  |
| override

Definition at line 715 of file dl_dispatcher.cc.

721 {
722 AUTO_DEPTH_WATCHER(1u);
723
724 GetCanvas().DrawImageRect(
725 image->impeller_texture(), // image
726 src, // source rect
727 dst, // destination rect
728 render_with_attributes ? paint_ : Paint(), // paint
729 skia_conversions::ToSamplerDescriptor(sampling) // sampling
730 );
731 }
impeller::Canvas::DrawImageRect
void DrawImageRect(const std::shared_ptr< Texture > &image, Rect source, Rect dest, const Paint &paint, const SamplerDescriptor &sampler={}, SourceRectConstraint src_rect_constraint=SourceRectConstraint::kFast)
Definition: canvas.cc:1138

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawImageRect(), GetCanvas(), paint_, and impeller::skia_conversions::ToSamplerDescriptor().

Referenced by drawImage().

## ◆ drawLine()

void impeller::DlDispatcherBase::drawLine | ( | const DlPoint & | p0,
|  | const DlPoint & | p1
| ) |  |
| override

Definition at line 530 of file dl_dispatcher.cc.

530 {
531 AUTO_DEPTH_WATCHER(1u);
532
533 GetCanvas().DrawLine(p0, p1, paint_);
534 }
impeller::Canvas::DrawLine
void DrawLine(const Point &p0, const Point &p1, const Paint &paint, bool reuse_depth=false)
Definition: canvas.cc:763

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawLine(), GetCanvas(), and paint_.

## ◆ drawOval()

void impeller::DlDispatcherBase::drawOval | ( | const DlRect & | bounds | ) |
| override

Definition at line 554 of file dl_dispatcher.cc.

554 {
555 AUTO_DEPTH_WATCHER(1u);
556
557 GetCanvas().DrawOval(bounds, paint_);
558 }
impeller::Canvas::DrawOval
void DrawOval(const Rect &rect, const Paint &paint)
Definition: canvas.cc:832

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawOval(), GetCanvas(), and paint_.

## ◆ drawPaint()

void impeller::DlDispatcherBase::drawPaint | ( |  | ) |
| override

Definition at line 523 of file dl_dispatcher.cc.

523 {
524 AUTO_DEPTH_WATCHER(1u);
525
526 GetCanvas().DrawPaint(paint_);
527 }

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawPaint(), GetCanvas(), and paint_.

## ◆ drawPath()

void impeller::DlDispatcherBase::drawPath | ( | const DlPath & | path | ) |
| override

Definition at line 590 of file dl_dispatcher.cc.

590 {
591 AUTO_DEPTH_WATCHER(1u);
592
593 SimplifyOrDrawPath(GetCanvas(), path, paint_);
594 }
impeller::DlDispatcherBase::SimplifyOrDrawPath
static void SimplifyOrDrawPath(Canvas &canvas, const DlPath &cache, const Paint &paint)
Definition: dl_dispatcher.cc:596

References AUTO_DEPTH_WATCHER, GetCanvas(), paint_, and SimplifyOrDrawPath().

## ◆ drawPoints()

void impeller::DlDispatcherBase::drawPoints | ( | flutter::DlPointMode | mode,
|  | uint32_t | count,
|  | const DlPoint | points[]
| ) |  |
| override

Definition at line 642 of file dl_dispatcher.cc.

644 {
645 AUTO_DEPTH_WATCHER(1u);
646
647 Paint paint = paint_;
648 paint.style = Paint::Style::kStroke;
649 switch (mode) {
650 case flutter::DlPointMode::kPoints: {
651 // Cap::kButt is also treated as a square.
652 PointStyle point_style = paint.stroke.cap == Cap::kRound
653 ? PointStyle::kRound
654 : PointStyle::kSquare;
655 Scalar radius = paint.stroke.width;
656 if (radius > 0) {
657 radius /= 2.0;
658 }
659 GetCanvas().DrawPoints(points, count, radius, paint, point_style);
660 } break;
661 case flutter::DlPointMode::kLines:
662 for (uint32_t i = 1; i < count; i += 2) {
663 Point p0 = points[i - 1];
664 Point p1 = points[i];
665 GetCanvas().DrawLine(p0, p1, paint, /*reuse_depth=*/i > 1);
666 }
667 break;
668 case flutter::DlPointMode::kPolygon:
669 if (count > 1) {
670 Point p0 = points[0];
671 for (uint32_t i = 1; i < count; i++) {
672 Point p1 = points[i];
673 GetCanvas().DrawLine(p0, p1, paint, /*reuse_depth=*/i > 1);
674 p0 = p1;
675 }
676 }
677 break;
678 }
679 }
impeller::Canvas::DrawPoints
void DrawPoints(const Point points[], uint32_t count, Scalar radius, const Paint &paint, PointStyle point_style)
Definition: canvas.cc:1106
impeller::Scalar
float Scalar
Definition: scalar.h:19
impeller::PointStyle
PointStyle
Definition: canvas.h:65
impeller::PointStyle::kRound
@ kRound
Points are drawn as squares.
impeller::PointStyle::kSquare
@ kSquare
Points are drawn as circles.
impeller::Point
TPoint< Scalar > Point
Definition: point.h:425
impeller::Cap::kRound
@ kRound
impeller::Paint::Style::kStroke
@ kStroke
impeller::Paint::style
Style style
Definition: paint.h:81
points
std::vector< Point > points
Definition: tessellator_libtess.cc:76

References AUTO_DEPTH_WATCHER, impeller::StrokeParameters::cap, impeller::Canvas::DrawLine(), impeller::Canvas::DrawPoints(), GetCanvas(), impeller::kRound, impeller::kSquare, impeller::Paint::kStroke, paint_, points, impeller::Paint::stroke, impeller::Paint::style, and impeller::StrokeParameters::width.

## ◆ drawRect()

void impeller::DlDispatcherBase::drawRect | ( | const DlRect & | rect | ) |
| override

Definition at line 547 of file dl_dispatcher.cc.

547 {
548 AUTO_DEPTH_WATCHER(1u);
549
550 GetCanvas().DrawRect(rect, paint_);
551 }
impeller::Canvas::DrawRect
void DrawRect(const Rect &rect, const Paint &paint)
Definition: canvas.cc:811

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawRect(), GetCanvas(), and paint_.

## ◆ drawRoundRect()

void impeller::DlDispatcherBase::drawRoundRect | ( | const DlRoundRect & | rrect | ) |
| override

Definition at line 568 of file dl_dispatcher.cc.

568 {
569 AUTO_DEPTH_WATCHER(1u);
570
571 GetCanvas().DrawRoundRect(rrect, paint_);
572 }
impeller::Canvas::DrawRoundRect
void DrawRoundRect(const RoundRect &rect, const Paint &paint)
Definition: canvas.cc:925

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawRoundRect(), GetCanvas(), and paint_.

## ◆ drawRoundSuperellipse()

void impeller::DlDispatcherBase::drawRoundSuperellipse | ( | const DlRoundSuperellipse & | rse | ) |
| override

Definition at line 583 of file dl_dispatcher.cc.

583 {
584 AUTO_DEPTH_WATCHER(1u);
585
586 GetCanvas().DrawRoundSuperellipse(rse, paint_);
587 }
impeller::Canvas::DrawRoundSuperellipse
void DrawRoundSuperellipse(const RoundSuperellipse &rse, const Paint &paint)
Definition: canvas.cc:973

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawRoundSuperellipse(), GetCanvas(), and paint_.

## ◆ drawShadow()

void impeller::DlDispatcherBase::drawShadow | ( | const DlPath & | path,
|  | const flutter::DlColor | color,
|  | const DlScalar | elevation,
|  | bool | transparent_occluder,
|  | DlScalar | dpr
| ) |  |
| override

Definition at line 860 of file dl_dispatcher.cc.

864 {
865 AUTO_DEPTH_WATCHER(1u);
866
867 Color spot_color = skia_conversions::ToColor(color);
868 spot_color.alpha *= 0.25;
869
870 // Compute the spot color -- ported from SkShadowUtils::ComputeTonalColors.
871 {
872 Scalar max =
873 std::max(std::max(spot_color.red, spot_color.green), spot_color.blue);
874 Scalar min =
875 std::min(std::min(spot_color.red, spot_color.green), spot_color.blue);
876 Scalar luminance = (min + max) * 0.5;
877
878 Scalar alpha_adjust =
879 (2.6f + (-2.66667f + 1.06667f * spot_color.alpha) * spot_color.alpha) *
880 spot_color.alpha;
881 Scalar color_alpha =
882 (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
883 luminance;
884 color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
885
886 Scalar greyscale_alpha =
887 std::clamp(spot_color.alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
888
889 Scalar color_scale = color_alpha * (1 - greyscale_alpha);
890 Scalar tonal_alpha = color_scale + greyscale_alpha;
891 Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
892 spot_color = Color(unpremul_scale * spot_color.red,
893 unpremul_scale * spot_color.green,
894 unpremul_scale * spot_color.blue, tonal_alpha);
895 }
896
897 Vector3 light_position(0, -1, 1);
898 Scalar occluder_z = dpr * elevation;
899
900 constexpr Scalar kLightRadius = 800 / 600; // Light radius / light height
901
902 Paint paint;
903 paint.style = Paint::Style::kFill;
904 paint.color = spot_color;
905 paint.mask_blur_descriptor = Paint::MaskBlurDescriptor{
906 .style = FilterContents::BlurStyle::kNormal,
907 .sigma = Radius{kLightRadius * occluder_z /
908 GetCanvas().GetCurrentTransform().GetScale().y},
909 };
910
911 GetCanvas().Save(1u);
912 GetCanvas().PreConcat(
913 Matrix::MakeTranslation(Vector2(0, -occluder_z * light_position.y)));
914
915 SimplifyOrDrawPath(GetCanvas(), path, paint);
916 AUTO_DEPTH_CHECK();
917
918 GetCanvas().Restore();
919 }
impeller::Canvas::Restore
bool Restore()
Definition: canvas.cc:1677
impeller::Canvas::PreConcat
void PreConcat(const Matrix &transform)
Definition: canvas.cc:346
impeller::FilterContents::BlurStyle::kNormal
@ kNormal
Blurred inside and outside.
impeller::Vector2
Point Vector2
Definition: point.h:429
impeller::Matrix::MakeTranslation
static constexpr Matrix MakeTranslation(const Vector3 &t)
Definition: matrix.h:95
impeller::Matrix::GetScale
Vector3 GetScale() const
Definition: matrix.h:394
impeller::Paint::Style::kFill
@ kFill
impeller::Vector3::y
Scalar y
Definition: vector.h:24

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.

## ◆ drawText()

void impeller::DlDispatcherBase::drawText | ( | const std::shared_ptr< flutter::DlText > & | text,
|  | DlScalar | x,
|  | DlScalar | y
| ) |  |
| override

Definition at line 843 of file dl_dispatcher.cc.

845 {
846 AUTO_DEPTH_WATCHER(1u);
847
848 auto text_frame = text->GetTextFrame();
849
850 // When running with Impeller enabled Skia text blobs are converted to
851 // Impeller text frames in paragraph_skia.cc
852 FML_CHECK(text_frame != nullptr);
853 GetCanvas().DrawTextFrame(text_frame, //
854 impeller::Point{x, y}, //
855 paint_ //
856 );
857 }
impeller::Canvas::DrawTextFrame
void DrawTextFrame(const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint)
Definition: canvas.cc:1869
x
int32_t x
Definition: dl_golden_unittests.cc:458
impeller::TPoint< Scalar >

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawTextFrame(), GetCanvas(), paint_, and x.

## ◆ drawVertices()

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

Definition at line 681 of file dl_dispatcher.cc.

683 {}

## ◆ GetCanvas()

virtual Canvas& impeller::DlDispatcherBase::GetCanvas | ( |  | ) |
| 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().

## ◆ restore()

void impeller::DlDispatcherBase::restore | ( |  | ) |
| override

Definition at line 337 of file dl_dispatcher.cc.

337 {
338 GetCanvas().Restore();
339 }

References GetCanvas(), and impeller::Canvas::Restore().

## ◆ rotate()

void impeller::DlDispatcherBase::rotate | ( | DlScalar | degrees | ) |
| override

Definition at line 356 of file dl_dispatcher.cc.

356 {
357 AUTO_DEPTH_WATCHER(0u);
358
359 GetCanvas().Rotate(Degrees{degrees});
360 }
impeller::Canvas::Rotate
void Rotate(Radians radians)
Definition: canvas.cc:378

References AUTO_DEPTH_WATCHER, GetCanvas(), and impeller::Canvas::Rotate().

## ◆ save()

void impeller::DlDispatcherBase::save | ( | uint32_t | total_content_depth | ) |
| override

Definition at line 301 of file dl_dispatcher.cc.

301 {
302 AUTO_DEPTH_WATCHER(1u);
303
304 GetCanvas().Save(total_content_depth);
305 }

References AUTO_DEPTH_WATCHER, GetCanvas(), and impeller::Canvas::Save().

## ◆ saveLayer()

void impeller::DlDispatcherBase::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

Definition at line 308 of file dl_dispatcher.cc.

313 {
314 AUTO_DEPTH_WATCHER(1u);
315
316 auto paint = options.renders_with_attributes() ? paint_ : Paint{};
317 auto promise = options.content_is_clipped()
318 ? ContentBoundsPromise::kMayClipContents
319 : ContentBoundsPromise::kContainsContents;
320 std::optional<Rect> impeller_bounds;
321 // If the content is unbounded but has developer specified bounds, we take
322 // the original bounds so that we clip the content as expected.
323 if (!options.content_is_unbounded() || options.bounds_from_caller()) {
324 impeller_bounds = bounds;
325 }
326
327 GetCanvas().SaveLayer(
328 paint, impeller_bounds, backdrop, promise, total_content_depth,
329 // Unbounded content can still have user specified bounds that require a
330 // saveLayer to be created to perform the clip.
331 options.can_distribute_opacity() && !options.content_is_unbounded(),
332 backdrop_id //
333 );
334 }
impeller::ContentBoundsPromise::kMayClipContents
@ kMayClipContents
The caller claims the bounds are a subset of an estimate of the reasonably tight bounds but likely cl...

References AUTO_DEPTH_WATCHER, GetCanvas(), impeller::kContainsContents, impeller::kMayClipContents, paint_, and impeller::Canvas::SaveLayer().

## ◆ scale()

void impeller::DlDispatcherBase::scale | ( | DlScalar | sx,
|  | DlScalar | sy
| ) |  |
| override

Definition at line 349 of file dl_dispatcher.cc.

349 {
350 AUTO_DEPTH_WATCHER(0u);
351
352 GetCanvas().Scale({sx, sy, 1.0});
353 }
impeller::Canvas::Scale
void Scale(const Vector2 &scale)
Definition: canvas.cc:366

References AUTO_DEPTH_WATCHER, GetCanvas(), and impeller::Canvas::Scale().

## ◆ setAntiAlias()

void impeller::DlDispatcherBase::setAntiAlias | ( | bool | aa | ) |
| override

Definition at line 148 of file dl_dispatcher.cc.

148 {
149 AUTO_DEPTH_WATCHER(0u);
150
151 // Nothing to do because AA is implicit.
152 }

References AUTO_DEPTH_WATCHER.

## ◆ setBlendMode()

void impeller::DlDispatcherBase::setBlendMode | ( | flutter::DlBlendMode | mode | ) |
| override

Definition at line 251 of file dl_dispatcher.cc.

251 {
252 AUTO_DEPTH_WATCHER(0u);
253
254 paint_.blend_mode = dl_mode;
255 }
impeller::Paint::blend_mode
BlendMode blend_mode
Definition: paint.h:82

References AUTO_DEPTH_WATCHER, impeller::Paint::blend_mode, and paint_.

## ◆ setColor()

void impeller::DlDispatcherBase::setColor | ( | flutter::DlColor | color | ) |
| override

Definition at line 175 of file dl_dispatcher.cc.

175 {
176 AUTO_DEPTH_WATCHER(0u);
177
178 paint_.color = skia_conversions::ToColor(color);
179 }
impeller::Paint::color
Color color
Definition: paint.h:75

References AUTO_DEPTH_WATCHER, impeller::Paint::color, paint_, and impeller::skia_conversions::ToColor().

## ◆ setColorFilter()

void impeller::DlDispatcherBase::setColorFilter | ( | const flutter::DlColorFilter * | filter | ) |
| override

Definition at line 237 of file dl_dispatcher.cc.

237 {
238 AUTO_DEPTH_WATCHER(0u);
239
240 paint_.color_filter = filter;
241 }
impeller::Paint::color_filter
const flutter::DlColorFilter * color_filter
Definition: paint.h:77

References AUTO_DEPTH_WATCHER, impeller::Paint::color_filter, and paint_.

## ◆ setColorSource()

void impeller::DlDispatcherBase::setColorSource | ( | const flutter::DlColorSource * | source | ) |
| override

Definition at line 230 of file dl_dispatcher.cc.

230 {
231 AUTO_DEPTH_WATCHER(0u);
232
233 paint_.color_source = source;
234 }
impeller::Paint::color_source
const flutter::DlColorSource * color_source
Definition: paint.h:76

References AUTO_DEPTH_WATCHER, impeller::Paint::color_source, and paint_.

## ◆ setDrawStyle()

void impeller::DlDispatcherBase::setDrawStyle | ( | flutter::DlDrawStyle | style | ) |
| override

Definition at line 168 of file dl_dispatcher.cc.

168 {
169 AUTO_DEPTH_WATCHER(0u);
170
171 paint_.style = ToStyle(style);
172 }
impeller::ToStyle
static Paint::Style ToStyle(flutter::DlDrawStyle style)
Definition: dl_dispatcher.cc:154

References AUTO_DEPTH_WATCHER, paint_, impeller::Paint::style, and impeller::ToStyle().

## ◆ setImageFilter()

void impeller::DlDispatcherBase::setImageFilter | ( | const flutter::DlImageFilter * | filter | ) |
| override

Definition at line 294 of file dl_dispatcher.cc.

294 {
295 AUTO_DEPTH_WATCHER(0u);
296
297 paint_.image_filter = filter;
298 }
impeller::Paint::image_filter
const flutter::DlImageFilter * image_filter
Definition: paint.h:78

References AUTO_DEPTH_WATCHER, impeller::Paint::image_filter, and paint_.

## ◆ setInvertColors()

void impeller::DlDispatcherBase::setInvertColors | ( | bool | invert | ) |
| override

Definition at line 244 of file dl_dispatcher.cc.

244 {
245 AUTO_DEPTH_WATCHER(0u);
246
247 paint_.invert_colors = invert;
248 }
impeller::Paint::invert_colors
bool invert_colors
Definition: paint.h:83

References AUTO_DEPTH_WATCHER, impeller::Paint::invert_colors, and paint_.

## ◆ setMaskFilter()

void impeller::DlDispatcherBase::setMaskFilter | ( | const flutter::DlMaskFilter * | filter | ) |
| override

Definition at line 271 of file dl_dispatcher.cc.

271 {
272 AUTO_DEPTH_WATCHER(0u);
273
274 // Needs https://github.com/flutter/flutter/issues/95434
275 if (filter == nullptr) {
276 paint_.mask_blur_descriptor = std::nullopt;
277 return;
278 }
279 switch (filter->type()) {
280 case flutter::DlMaskFilterType::kBlur: {
281 auto blur = filter->asBlur();
282
283 paint_.mask_blur_descriptor = {
284 .style = ToBlurStyle(blur->style()),
285 .sigma = Sigma(blur->sigma()),
286 .respect_ctm = blur->respectCTM(),
287 };
288 break;
289 }
290 }
291 }
impeller::ToBlurStyle
static FilterContents::BlurStyle ToBlurStyle(flutter::DlBlurStyle blur_style)
Definition: dl_dispatcher.cc:257
impeller::Paint::mask_blur_descriptor
std::optional< MaskBlurDescriptor > mask_blur_descriptor
Definition: paint.h:85

References AUTO_DEPTH_WATCHER, impeller::Paint::mask_blur_descriptor, paint_, and impeller::ToBlurStyle().

## ◆ setStrokeCap()

void impeller::DlDispatcherBase::setStrokeCap | ( | flutter::DlStrokeCap | cap | ) |
| override

Definition at line 196 of file dl_dispatcher.cc.

196 {
197 AUTO_DEPTH_WATCHER(0u);
198
199 switch (cap) {
200 case flutter::DlStrokeCap::kButt:
201 paint_.stroke.cap = Cap::kButt;
202 break;
203 case flutter::DlStrokeCap::kRound:
204 paint_.stroke.cap = Cap::kRound;
205 break;
206 case flutter::DlStrokeCap::kSquare:
207 paint_.stroke.cap = Cap::kSquare;
208 break;
209 }
210 }
impeller::Cap::kButt
@ kButt
impeller::Cap::kSquare
@ kSquare
impeller::Paint::stroke
StrokeParameters stroke
Definition: paint.h:80
impeller::StrokeParameters::cap
Cap cap
Definition: stroke_parameters.h:30

References AUTO_DEPTH_WATCHER, impeller::StrokeParameters::cap, impeller::kButt, impeller::kRound, impeller::kSquare, paint_, and impeller::Paint::stroke.

## ◆ setStrokeJoin()

void impeller::DlDispatcherBase::setStrokeJoin | ( | flutter::DlStrokeJoin | join | ) |
| override

Definition at line 213 of file dl_dispatcher.cc.

213 {
214 AUTO_DEPTH_WATCHER(0u);
215
216 switch (join) {
217 case flutter::DlStrokeJoin::kMiter:
218 paint_.stroke.join = Join::kMiter;
219 break;
220 case flutter::DlStrokeJoin::kRound:
221 paint_.stroke.join = Join::kRound;
222 break;
223 case flutter::DlStrokeJoin::kBevel:
224 paint_.stroke.join = Join::kBevel;
225 break;
226 }
227 }
impeller::Join::kRound
@ kRound
impeller::Join::kMiter
@ kMiter
impeller::Join::kBevel
@ kBevel
impeller::StrokeParameters::join
Join join
Definition: stroke_parameters.h:31

References AUTO_DEPTH_WATCHER, impeller::StrokeParameters::join, impeller::kBevel, impeller::kMiter, impeller::kRound, paint_, and impeller::Paint::stroke.

## ◆ setStrokeMiter()

void impeller::DlDispatcherBase::setStrokeMiter | ( | DlScalar | limit | ) |
| override

Definition at line 189 of file dl_dispatcher.cc.

189 {
190 AUTO_DEPTH_WATCHER(0u);
191
192 paint_.stroke.miter_limit = limit;
193 }
impeller::StrokeParameters::miter_limit
Scalar miter_limit
Definition: stroke_parameters.h:32

References AUTO_DEPTH_WATCHER, impeller::StrokeParameters::miter_limit, paint_, and impeller::Paint::stroke.

## ◆ setStrokeWidth()

void impeller::DlDispatcherBase::setStrokeWidth | ( | DlScalar | width | ) |
| override

Definition at line 182 of file dl_dispatcher.cc.

182 {
183 AUTO_DEPTH_WATCHER(0u);
184
185 paint_.stroke.width = width;
186 }
impeller::StrokeParameters::width
Scalar width
Definition: stroke_parameters.h:29

References AUTO_DEPTH_WATCHER, paint_, impeller::Paint::stroke, and impeller::StrokeParameters::width.

## ◆ SimplifyOrDrawPath()

void impeller::DlDispatcherBase::SimplifyOrDrawPath | ( | Canvas & | canvas,
|  | const DlPath & | cache,
|  | const Paint & | paint
| ) |  |
| static protected

Definition at line 596 of file dl_dispatcher.cc.

598 {
599 DlRect rect;
600
601 // We can't "optimize" a path into a rectangle if it's open.
602 bool closed;
603 if (path.IsRect(&rect, &closed) && closed) {
604 canvas.DrawRect(rect, paint);
605 return;
606 }
607
608 DlRoundRect rrect;
609 if (path.IsRoundRect(&rrect) && rrect.GetRadii().AreAllCornersSame()) {
610 canvas.DrawRoundRect(rrect, paint);
611 return;
612 }
613
614 if (path.IsOval(&rect)) {
615 canvas.DrawOval(rect, paint);
616 return;
617 }
618
619 DlPoint start;
620 DlPoint end;
621 if (path.IsLine(&start, &end)) {
622 canvas.DrawLine(start, end, paint);
623 return;
624 }
625
626 canvas.DrawPath(path, paint);
627 }
impeller::DlPoint
flutter::DlPoint DlPoint
Definition: dl_dispatcher.h:24
start
const size_t start
Definition: tessellator_libtess.cc:62
end
const size_t end
Definition: tessellator_libtess.cc:63

References impeller::Canvas::DrawLine(), impeller::Canvas::DrawOval(), impeller::Canvas::DrawPath(), impeller::Canvas::DrawRect(), impeller::Canvas::DrawRoundRect(), end, and start.

Referenced by drawPath(), and drawShadow().

## ◆ skew()

void impeller::DlDispatcherBase::skew | ( | DlScalar | sx,
|  | DlScalar | sy
| ) |  |
| override

Definition at line 363 of file dl_dispatcher.cc.

363 {
364 AUTO_DEPTH_WATCHER(0u);
365
366 GetCanvas().Skew(sx, sy);
367 }
impeller::Canvas::Skew
void Skew(Scalar sx, Scalar sy)
Definition: canvas.cc:374

References AUTO_DEPTH_WATCHER, GetCanvas(), and impeller::Canvas::Skew().

## ◆ transform2DAffine()

void impeller::DlDispatcherBase::transform2DAffine | ( | DlScalar | mxx,
|  | DlScalar | mxy,
|  | DlScalar | mxt,
|  | DlScalar | myx,
|  | DlScalar | myy,
|  | DlScalar | myt
| ) |  |
| override

Definition at line 371 of file dl_dispatcher.cc.

373 {
374 AUTO_DEPTH_WATCHER(0u);
375
376 transformFullPerspective(
377 mxx, mxy, 0, mxt,
378 myx, myy, 0, myt,
379 0 , 0, 1, 0,
380 0 , 0, 0, 1
381 );
382 }
impeller::DlDispatcherBase::transformFullPerspective
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
Definition: dl_dispatcher.cc:387

References AUTO_DEPTH_WATCHER, and transformFullPerspective().

## ◆ transformFullPerspective()

void impeller::DlDispatcherBase::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

Definition at line 387 of file dl_dispatcher.cc.

391 {
392 AUTO_DEPTH_WATCHER(0u);
393
394 // The order of arguments is row-major but Impeller matrices are
395 // column-major.
396 auto transform = Matrix{
397 mxx, myx, mzx, mwx,
398 mxy, myy, mzy, mwy,
399 mxz, myz, mzz, mwz,
400 mxt, myt, mzt, mwt
401 };
402 GetCanvas().Transform(transform);
403 }
impeller::Canvas::Transform
void Transform(const Matrix &transform)
Definition: canvas.cc:354
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:312

References AUTO_DEPTH_WATCHER, GetCanvas(), impeller::Canvas::Transform(), and transform.

Referenced by transform2DAffine().

## ◆ transformReset()

void impeller::DlDispatcherBase::transformReset | ( |  | ) |
| override

Definition at line 407 of file dl_dispatcher.cc.

407 {
408 AUTO_DEPTH_WATCHER(0u);
409
410 GetCanvas().ResetTransform();
411 GetCanvas().Transform(initial_matrix_);
412 }
impeller::Canvas::ResetTransform
void ResetTransform()
Definition: canvas.cc:350

References AUTO_DEPTH_WATCHER, GetCanvas(), initial_matrix_, impeller::Canvas::ResetTransform(), and impeller::Canvas::Transform().

## ◆ translate()

void impeller::DlDispatcherBase::translate | ( | DlScalar | tx,
|  | DlScalar | ty
| ) |  |
| override

Definition at line 342 of file dl_dispatcher.cc.

342 {
343 AUTO_DEPTH_WATCHER(0u);
344
345 GetCanvas().Translate({tx, ty, 0.0});
346 }
impeller::Canvas::Translate
void Translate(const Vector3 &offset)
Definition: canvas.cc:362

References AUTO_DEPTH_WATCHER, GetCanvas(), and impeller::Canvas::Translate().

## Member Data Documentation

## ◆ initial_matrix_

Matrix impeller::DlDispatcherBase::initial_matrix_
| protected

Definition at line 256 of file dl_dispatcher.h.

Referenced by drawDisplayList(), and transformReset().

## ◆ paint_

Paint impeller::DlDispatcherBase::paint_
| protected

Definition at line 255 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(), setBlendMode(), setColor(), setColorFilter(), setColorSource(), setDrawStyle(), setImageFilter(), setInvertColors(), setMaskFilter(), setStrokeCap(), setStrokeJoin(), setStrokeMiter(), and setStrokeWidth().

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

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