Flutter Impeller
impeller::DlDispatcherBase Class Referenceabstract

#include <dl_dispatcher.h>

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

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 &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
 
virtual const ContentContext & GetContentContext () const =0
 
std::shared_ptr< Texture > GetTexture (const sk_sp< flutter::DlImage > &image)
 

Static Protected Member Functions

static void SimplifyOrDrawPath (Canvas &canvas, const DlPath &cache, const Paint &paint)
 

Protected Attributes

Paint paint_
 
Matrix initial_matrix_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DlDispatcherBase()

impeller::DlDispatcherBase::DlDispatcherBase ( )
inlineexplicit

Definition at line 67 of file dl_dispatcher.h.

67 {}

◆ ~DlDispatcherBase()

virtual impeller::DlDispatcherBase::~DlDispatcherBase ( )
virtualdefault

Member Function Documentation

◆ clipOval()

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

Definition at line 435 of file dl_dispatcher.cc.

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

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 486 of file dl_dispatcher.cc.

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

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 425 of file dl_dispatcher.cc.

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

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 445 of file dl_dispatcher.cc.

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

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 467 of file dl_dispatcher.cc.

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

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 631 of file dl_dispatcher.cc.

634  {
635  AUTO_DEPTH_WATCHER(1u);
636 
637  GetCanvas().DrawArc(Arc(oval_bounds, Degrees(start_degrees),
638  Degrees(sweep_degrees), use_center),
639  paint_);
640 }
void DrawArc(const Arc &arc, const Paint &paint)
Definition: canvas.cc:1049

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 759 of file dl_dispatcher.cc.

767  {
768  AUTO_DEPTH_WATCHER(1u);
769 
770  auto geometry =
771  DlAtlasGeometry(GetTexture(atlas), //
772  xform, //
773  tex, //
774  colors, //
775  static_cast<size_t>(count), //
776  mode, //
778  ToOptRect(cull_rect) //
779  );
780  auto atlas_contents = std::make_shared<AtlasContents>();
781  atlas_contents->SetGeometry(&geometry);
782 
783  GetCanvas().DrawAtlas(atlas_contents, paint_);
784 }
void DrawAtlas(const std::shared_ptr< AtlasContents > &atlas_contents, const Paint &paint)
Definition: canvas.cc:1588
std::shared_ptr< Texture > GetTexture(const sk_sp< flutter::DlImage > &image)
impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlImageSampling options)
static std::optional< const Rect > ToOptRect(const flutter::DlRect *rect)

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

◆ drawCircle()

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

Definition at line 562 of file dl_dispatcher.cc.

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

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 513 of file dl_dispatcher.cc.

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

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 538 of file dl_dispatcher.cc.

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

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

◆ drawDiffRoundRect()

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

Definition at line 576 of file dl_dispatcher.cc.

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

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 787 of file dl_dispatcher.cc.

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

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 695 of file dl_dispatcher.cc.

698  {
699  AUTO_DEPTH_WATCHER(1u);
700 
701  if (!image) {
702  return;
703  }
704 
705  auto texture = GetTexture(image);
706  if (!texture) {
707  return;
708  }
709 
710  const auto size = texture->GetSize();
711  const auto src = DlRect::MakeWH(size.width, size.height);
712  const auto dest = DlRect::MakeXYWH(point.x, point.y, size.width, size.height);
713 
714  drawImageRect(image, // image
715  src, // source rect
716  dest, // destination rect
717  sampling, // sampling options
718  render_with_attributes, // render with attributes
719  flutter::DlSrcRectConstraint::kStrict // constraint
720  );
721 }
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

References AUTO_DEPTH_WATCHER, drawImageRect(), and GetTexture().

◆ 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 743 of file dl_dispatcher.cc.

747  {
748  AUTO_DEPTH_WATCHER(9u);
749 
750  NinePatchConverter converter = {};
751  converter.DrawNinePatch(GetTexture(image),
752  Rect::MakeLTRB(center.GetLeft(), center.GetTop(),
753  center.GetRight(), center.GetBottom()),
754  dst, ToSamplerDescriptor(filter), &GetCanvas(),
755  &paint_);
756 }
static impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlFilterMode options)
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
Definition: rect.h:129

References AUTO_DEPTH_WATCHER, impeller::NinePatchConverter::DrawNinePatch(), GetCanvas(), GetTexture(), 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 724 of file dl_dispatcher.cc.

730  {
731  AUTO_DEPTH_WATCHER(1u);
732 
734  GetTexture(image), // image
735  src, // source rect
736  dst, // destination rect
737  render_with_attributes ? paint_ : Paint(), // paint
738  skia_conversions::ToSamplerDescriptor(sampling) // sampling
739  );
740 }
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:1406

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

Referenced by drawImage().

◆ drawLine()

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

Definition at line 531 of file dl_dispatcher.cc.

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

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

◆ drawOval()

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

Definition at line 555 of file dl_dispatcher.cc.

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

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

◆ drawPaint()

void impeller::DlDispatcherBase::drawPaint ( )
override

Definition at line 524 of file dl_dispatcher.cc.

524  {
525  AUTO_DEPTH_WATCHER(1u);
526 
528 }

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

◆ drawPath()

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

Definition at line 591 of file dl_dispatcher.cc.

591  {
592  AUTO_DEPTH_WATCHER(1u);
593 
594  GetCanvas().DrawPath(path, paint_);
595 }
void DrawPath(const flutter::DlPath &path, const Paint &paint)
Definition: canvas.cc:459

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

◆ drawPoints()

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

Definition at line 643 of file dl_dispatcher.cc.

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

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

◆ drawRect()

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

Definition at line 548 of file dl_dispatcher.cc.

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

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

◆ drawRoundRect()

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

Definition at line 569 of file dl_dispatcher.cc.

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

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

◆ drawRoundSuperellipse()

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

Definition at line 584 of file dl_dispatcher.cc.

584  {
585  AUTO_DEPTH_WATCHER(1u);
586 
588 }
void DrawRoundSuperellipse(const RoundSuperellipse &rse, const Paint &paint)
Definition: canvas.cc:1186

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 869 of file dl_dispatcher.cc.

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

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 852 of file dl_dispatcher.cc.

854  {
855  AUTO_DEPTH_WATCHER(1u);
856 
857  auto text_frame = text->GetTextFrame();
858 
859  // When running with Impeller enabled Skia text blobs are converted to
860  // Impeller text frames in paragraph_skia.cc
861  FML_CHECK(text_frame != nullptr);
862  GetCanvas().DrawTextFrame(text_frame, //
863  impeller::Point{x, y}, //
864  paint_ //
865  );
866 }
void DrawTextFrame(const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint)
Definition: canvas.cc:2132
int32_t x

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 690 of file dl_dispatcher.cc.

692  {}

◆ GetCanvas()

◆ GetContentContext()

virtual const ContentContext& impeller::DlDispatcherBase::GetContentContext ( ) const
pure virtual

Referenced by GetTexture().

◆ GetTexture()

std::shared_ptr< Texture > impeller::DlDispatcherBase::GetTexture ( const sk_sp< flutter::DlImage > &  image)

Definition at line 682 of file dl_dispatcher.cc.

683  {
684  if (!image) {
685  return nullptr;
686  }
687  return image->asImpellerImage()->GetCachedTexture(GetContentContext());
688 }
virtual const ContentContext & GetContentContext() const =0

References GetContentContext().

Referenced by drawAtlas(), drawImage(), drawImageNine(), and drawImageRect().

◆ restore()

void impeller::DlDispatcherBase::restore ( )
override

Definition at line 338 of file dl_dispatcher.cc.

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

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

◆ rotate()

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

Definition at line 357 of file dl_dispatcher.cc.

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

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

◆ save()

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

Definition at line 302 of file dl_dispatcher.cc.

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

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 309 of file dl_dispatcher.cc.

314  {
315  AUTO_DEPTH_WATCHER(1u);
316 
317  auto paint = options.renders_with_attributes() ? paint_ : Paint{};
318  auto promise = options.content_is_clipped()
321  std::optional<Rect> impeller_bounds;
322  // If the content is unbounded but has developer specified bounds, we take
323  // the original bounds so that we clip the content as expected.
324  if (!options.content_is_unbounded() || options.bounds_from_caller()) {
325  impeller_bounds = bounds;
326  }
327 
329  paint, impeller_bounds, backdrop, promise, total_content_depth,
330  // Unbounded content can still have user specified bounds that require a
331  // saveLayer to be created to perform the clip.
332  options.can_distribute_opacity() && !options.content_is_unbounded(),
333  backdrop_id //
334  );
335 }
@ 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 350 of file dl_dispatcher.cc.

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

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

◆ setAntiAlias()

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

Definition at line 149 of file dl_dispatcher.cc.

149  {
150  AUTO_DEPTH_WATCHER(0u);
151 
152  paint_.anti_alias = aa;
153 }
bool anti_alias
Definition: paint.h:88

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

◆ setBlendMode()

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

Definition at line 252 of file dl_dispatcher.cc.

252  {
253  AUTO_DEPTH_WATCHER(0u);
254 
255  paint_.blend_mode = dl_mode;
256 }
BlendMode blend_mode
Definition: paint.h:86

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

◆ setColor()

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

Definition at line 176 of file dl_dispatcher.cc.

176  {
177  AUTO_DEPTH_WATCHER(0u);
178 
180 }
Color color
Definition: paint.h:79

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 238 of file dl_dispatcher.cc.

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

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

◆ setColorSource()

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

Definition at line 231 of file dl_dispatcher.cc.

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

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

◆ setDrawStyle()

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

Definition at line 169 of file dl_dispatcher.cc.

169  {
170  AUTO_DEPTH_WATCHER(0u);
171 
172  paint_.style = ToStyle(style);
173 }
static Paint::Style ToStyle(flutter::DlDrawStyle style)

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

◆ setImageFilter()

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

Definition at line 295 of file dl_dispatcher.cc.

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

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

◆ setInvertColors()

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

Definition at line 245 of file dl_dispatcher.cc.

245  {
246  AUTO_DEPTH_WATCHER(0u);
247 
248  paint_.invert_colors = invert;
249 }
bool invert_colors
Definition: paint.h:87

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

◆ setMaskFilter()

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

Definition at line 272 of file dl_dispatcher.cc.

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

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 197 of file dl_dispatcher.cc.

197  {
198  AUTO_DEPTH_WATCHER(0u);
199 
200  switch (cap) {
201  case flutter::DlStrokeCap::kButt:
203  break;
204  case flutter::DlStrokeCap::kRound:
206  break;
207  case flutter::DlStrokeCap::kSquare:
209  break;
210  }
211 }
StrokeParameters stroke
Definition: paint.h:84

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 214 of file dl_dispatcher.cc.

214  {
215  AUTO_DEPTH_WATCHER(0u);
216 
217  switch (join) {
218  case flutter::DlStrokeJoin::kMiter:
220  break;
221  case flutter::DlStrokeJoin::kRound:
223  break;
224  case flutter::DlStrokeJoin::kBevel:
226  break;
227  }
228 }

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

◆ setStrokeWidth()

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

Definition at line 183 of file dl_dispatcher.cc.

183  {
184  AUTO_DEPTH_WATCHER(0u);
185 
186  paint_.stroke.width = width;
187 }

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 
)
staticprotected

Definition at line 597 of file dl_dispatcher.cc.

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

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

Referenced by drawShadow().

◆ skew()

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

Definition at line 364 of file dl_dispatcher.cc.

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

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 372 of file dl_dispatcher.cc.

374  {
375  AUTO_DEPTH_WATCHER(0u);
376 
378  mxx, mxy, 0, mxt,
379  myx, myy, 0, myt,
380  0 , 0, 1, 0,
381  0 , 0, 0, 1
382  );
383 }
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

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 388 of file dl_dispatcher.cc.

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

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

Referenced by transform2DAffine().

◆ transformReset()

void impeller::DlDispatcherBase::transformReset ( )
override

◆ translate()

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

Definition at line 343 of file dl_dispatcher.cc.

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

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

Member Data Documentation

◆ initial_matrix_

Matrix impeller::DlDispatcherBase::initial_matrix_
protected

Definition at line 298 of file dl_dispatcher.h.

Referenced by drawDisplayList(), and transformReset().

◆ paint_


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