Flutter Impeller
impeller::DlDispatcherBase Class Referenceabstract

#include <dl_dispatcher.h>

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

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) 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
 
virtual CanvasGetCanvas ()=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 27 of file dl_dispatcher.h.

Member Function Documentation

◆ clipOval()

void impeller::DlDispatcherBase::clipOval ( const DlRect bounds,
ClipOp  clip_op,
bool  is_aa 
)
override

◆ clipPath()

void impeller::DlDispatcherBase::clipPath ( const DlPath path,
ClipOp  clip_op,
bool  is_aa 
)
override

Definition at line 473 of file dl_dispatcher.cc.

473  {
474  AUTO_DEPTH_WATCHER(0u);
475 
476  auto clip_op = ToClipOperation(sk_op);
477 
478  DlRect rect;
479  if (path.IsRect(&rect)) {
480  GetCanvas().ClipGeometry(Geometry::MakeRect(rect), clip_op);
481  } else if (path.IsOval(&rect)) {
482  GetCanvas().ClipGeometry(Geometry::MakeOval(rect), clip_op);
483  } else {
484  SkRRect rrect;
485  if (path.IsSkRRect(&rrect) && rrect.isSimple()) {
488  skia_conversions::ToRect(rrect.rect()),
489  skia_conversions::ToSize(rrect.getSimpleRadii())),
490  clip_op);
491  } else {
492  GetCanvas().ClipGeometry(Geometry::MakeFillPath(path.GetPath()), clip_op);
493  }
494  }
495 }

References AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), GetCanvas(), impeller::Geometry::MakeFillPath(), impeller::Geometry::MakeOval(), impeller::Geometry::MakeRect(), impeller::Geometry::MakeRoundRect(), impeller::ToClipOperation(), impeller::skia_conversions::ToRect(), and impeller::skia_conversions::ToSize().

◆ clipRect()

void impeller::DlDispatcherBase::clipRect ( const DlRect rect,
ClipOp  clip_op,
bool  is_aa 
)
override

◆ clipRRect()

void impeller::DlDispatcherBase::clipRRect ( const SkRRect &  rrect,
ClipOp  clip_op,
bool  is_aa 
)
override

Definition at line 448 of file dl_dispatcher.cc.

450  {
451  AUTO_DEPTH_WATCHER(0u);
452 
453  auto clip_op = ToClipOperation(sk_op);
454  if (rrect.isRect()) {
456  Geometry::MakeRect(skia_conversions::ToRect(rrect.rect())), clip_op);
457  } else if (rrect.isOval()) {
459  Geometry::MakeOval(skia_conversions::ToRect(rrect.rect())), clip_op);
460  } else if (rrect.isSimple()) {
463  skia_conversions::ToRect(rrect.rect()),
464  skia_conversions::ToSize(rrect.getSimpleRadii())),
465  clip_op);
466  } else {
469  }
470 }

References AUTO_DEPTH_WATCHER, impeller::Canvas::ClipGeometry(), GetCanvas(), impeller::Geometry::MakeFillPath(), impeller::Geometry::MakeOval(), impeller::Geometry::MakeRect(), impeller::Geometry::MakeRoundRect(), impeller::ToClipOperation(), impeller::skia_conversions::ToPath(), impeller::skia_conversions::ToRect(), and impeller::skia_conversions::ToSize().

◆ drawArc()

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

Definition at line 642 of file dl_dispatcher.cc.

645  {
646  AUTO_DEPTH_WATCHER(1u);
647 
648  PathBuilder builder;
649  builder.AddArc(oval_bounds, Degrees(start_degrees), Degrees(sweep_degrees),
650  use_center);
651  GetCanvas().DrawPath(builder.TakePath(), paint_);
652 }

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

◆ drawAtlas()

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

Definition at line 763 of file dl_dispatcher.cc.

771  {
772  AUTO_DEPTH_WATCHER(1u);
773 
774  auto geometry =
775  DlAtlasGeometry(atlas->impeller_texture(), //
776  xform, //
777  tex, //
778  colors, //
779  static_cast<size_t>(count), //
782  skia_conversions::ToRect(cull_rect) //
783  );
784  auto atlas_contents = std::make_shared<AtlasContents>();
785  atlas_contents->SetGeometry(&geometry);
786 
787  GetCanvas().DrawAtlas(atlas_contents, paint_);
788 }

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

◆ drawCircle()

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

Definition at line 578 of file dl_dispatcher.cc.

578  {
579  AUTO_DEPTH_WATCHER(1u);
580 
581  GetCanvas().DrawCircle(center, radius, paint_);
582 }

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

◆ drawColor()

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

◆ drawDashedLine()

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

Definition at line 522 of file dl_dispatcher.cc.

525  {
526  AUTO_DEPTH_WATCHER(1u);
527 
528  Scalar length = p0.GetDistance(p1);
529  // Reasons to defer to regular DrawLine:
530  // length is non-positive - drawLine will draw appropriate "dot"
531  // off_length is non-positive - no gaps, drawLine will draw it solid
532  // on_length is negative - invalid dashing
533  // Note that a 0 length "on" dash will draw "dot"s every "off" distance apart
534  if (length > 0.0f && on_length >= 0.0f && off_length > 0.0f) {
535  Point delta = (p1 - p0) / length; // length > 0 already tested
536  PathBuilder builder;
537 
538  Scalar consumed = 0.0f;
539  while (consumed < length) {
540  builder.MoveTo(p0 + delta * consumed);
541 
542  Scalar dash_end = consumed + on_length;
543  if (dash_end < length) {
544  builder.LineTo(p0 + delta * dash_end);
545  } else {
546  builder.LineTo(p1);
547  // Should happen anyway due to the math, but let's make it explicit
548  // in case of bit errors. We're done with this line.
549  break;
550  }
551 
552  consumed = dash_end + off_length;
553  }
554 
555  Paint stroke_paint = paint_;
556  stroke_paint.style = Paint::Style::kStroke;
557  GetCanvas().DrawPath(builder.TakePath(), stroke_paint);
558  } else {
559  drawLine(p0, p1);
560  }
561 }

References AUTO_DEPTH_WATCHER, drawLine(), impeller::Canvas::DrawPath(), GetCanvas(), impeller::Paint::kStroke, impeller::PathBuilder::LineTo(), impeller::PathBuilder::MoveTo(), paint_, impeller::Paint::style, and impeller::PathBuilder::TakePath().

◆ drawDisplayList()

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

Definition at line 791 of file dl_dispatcher.cc.

793  {
794  AUTO_DEPTH_WATCHER(display_list->total_depth());
795 
796  // Save all values that must remain untouched after the operation.
797  Paint saved_paint = paint_;
798  Matrix saved_initial_matrix = initial_matrix_;
799 
800  // Establish a new baseline for interpreting the new DL.
801  // Matrix and clip are left untouched, the current
802  // transform is saved as the new base matrix, and paint
803  // values are reset to defaults.
805  paint_ = Paint();
806 
807  // Handle passed opacity in the most brute-force way by using
808  // a SaveLayer. If the display_list is able to inherit the
809  // opacity, this could also be handled by modulating all of its
810  // attribute settings (for example, color), by the indicated
811  // opacity.
812  int restore_count = GetCanvas().GetSaveCount();
813  if (opacity < SK_Scalar1) {
814  Paint save_paint;
815  save_paint.color = Color(0, 0, 0, opacity);
817  save_paint, skia_conversions::ToRect(display_list->bounds()), nullptr,
818  ContentBoundsPromise::kContainsContents, display_list->total_depth(),
819  display_list->can_apply_group_opacity());
820  } else {
821  // The display list may alter the clip, which must be restored to the
822  // current clip at the end of playback.
823  GetCanvas().Save(display_list->total_depth());
824  }
825 
826  // TODO(131445): Remove this restriction if we can correctly cull with
827  // perspective transforms.
828  if (display_list->has_rtree() && !initial_matrix_.HasPerspective()) {
829  // The canvas remembers the screen-space culling bounds clipped by
830  // the surface and the history of clip calls. DisplayList can cull
831  // the ops based on a rectangle expressed in its "destination bounds"
832  // so we need the canvas to transform those into the current local
833  // coordinate space into which the DisplayList will be rendered.
834  auto global_culling_bounds = GetCanvas().GetLocalCoverageLimit();
835  if (global_culling_bounds.has_value()) {
836  Rect cull_rect = global_culling_bounds->TransformBounds(
837  GetCanvas().GetCurrentTransform().Invert());
838  display_list->Dispatch(
839  *this, SkRect::MakeLTRB(cull_rect.GetLeft(), cull_rect.GetTop(),
840  cull_rect.GetRight(), cull_rect.GetBottom()));
841  } else {
842  // If the culling bounds are empty, this display list can be skipped
843  // entirely.
844  }
845  } else {
846  display_list->Dispatch(*this);
847  }
848 
849  // Restore all saved state back to what it was before we interpreted
850  // the display_list
852  GetCanvas().RestoreToCount(restore_count);
853  initial_matrix_ = saved_initial_matrix;
854  paint_ = saved_paint;
855 }

References AUTO_DEPTH_CHECK, AUTO_DEPTH_WATCHER, impeller::Paint::color, impeller::TRect< T >::GetBottom(), GetCanvas(), impeller::Canvas::GetCurrentTransform(), impeller::TRect< T >::GetLeft(), impeller::Canvas::GetLocalCoverageLimit(), impeller::TRect< T >::GetRight(), impeller::Canvas::GetSaveCount(), impeller::TRect< T >::GetTop(), impeller::Matrix::HasPerspective(), initial_matrix_, impeller::kContainsContents, paint_, impeller::Canvas::RestoreToCount(), impeller::Canvas::Save(), impeller::Canvas::SaveLayer(), impeller::skia_conversions::ToRect(), and impeller::TRect< T >::TransformBounds().

◆ drawDRRect()

void impeller::DlDispatcherBase::drawDRRect ( const SkRRect &  outer,
const SkRRect &  inner 
)
override

Definition at line 598 of file dl_dispatcher.cc.

598  {
599  AUTO_DEPTH_WATCHER(1u);
600 
601  PathBuilder builder;
602  builder.AddPath(skia_conversions::ToPath(outer));
603  builder.AddPath(skia_conversions::ToPath(inner));
604  GetCanvas().DrawPath(builder.TakePath(FillType::kOdd), paint_);
605 }

References impeller::PathBuilder::AddPath(), AUTO_DEPTH_WATCHER, impeller::Canvas::DrawPath(), GetCanvas(), impeller::kOdd, paint_, impeller::PathBuilder::TakePath(), and impeller::skia_conversions::ToPath().

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

702  {
703  AUTO_DEPTH_WATCHER(1u);
704 
705  if (!image) {
706  return;
707  }
708 
709  auto texture = image->impeller_texture();
710  if (!texture) {
711  return;
712  }
713 
714  const auto size = texture->GetSize();
715  const auto src = DlRect::MakeWH(size.width, size.height);
716  const auto dest = DlRect::MakeXYWH(point.x, point.y, size.width, size.height);
717 
718  drawImageRect(image, // image
719  src, // source rect
720  dest, // destination rect
721  sampling, // sampling options
722  render_with_attributes, // render with attributes
723  SrcRectConstraint::kStrict // constraint
724  );
725 }

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

751  {
752  AUTO_DEPTH_WATCHER(9u);
753 
754  NinePatchConverter converter = {};
755  converter.DrawNinePatch(image->impeller_texture(),
756  Rect::MakeLTRB(center.GetLeft(), center.GetTop(),
757  center.GetRight(), center.GetBottom()),
758  dst, ToSamplerDescriptor(filter), &GetCanvas(),
759  &paint_);
760 }

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,
SrcRectConstraint  constraint = SrcRectConstraint::kFast 
)
override

Definition at line 728 of file dl_dispatcher.cc.

734  {
735  AUTO_DEPTH_WATCHER(1u);
736 
738  image->impeller_texture(), // image
739  src, // source rect
740  dst, // destination rect
741  render_with_attributes ? paint_ : Paint(), // paint
742  skia_conversions::ToSamplerDescriptor(sampling) // sampling
743  );
744 }

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

516  {
517  AUTO_DEPTH_WATCHER(1u);
518 
519  GetCanvas().DrawLine(p0, p1, paint_);
520 }

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

Referenced by drawDashedLine().

◆ drawOval()

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

Definition at line 571 of file dl_dispatcher.cc.

571  {
572  AUTO_DEPTH_WATCHER(1u);
573 
574  GetCanvas().DrawOval(bounds, paint_);
575 }

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

◆ drawPaint()

void impeller::DlDispatcherBase::drawPaint ( )
override

Definition at line 509 of file dl_dispatcher.cc.

509  {
510  AUTO_DEPTH_WATCHER(1u);
511 
513 }

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

◆ drawPath()

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

Definition at line 608 of file dl_dispatcher.cc.

608  {
609  AUTO_DEPTH_WATCHER(1u);
610 
612 }

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

◆ drawPoints()

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

Definition at line 655 of file dl_dispatcher.cc.

657  {
658  AUTO_DEPTH_WATCHER(1u);
659 
660  Paint paint = paint_;
662  switch (mode) {
663  case flutter::DlCanvas::PointMode::kPoints: {
664  // Cap::kButt is also treated as a square.
665  auto point_style = paint.stroke_cap == Cap::kRound ? PointStyle::kRound
667  auto radius = paint.stroke_width;
668  if (radius > 0) {
669  radius /= 2.0;
670  }
671  GetCanvas().DrawPoints(skia_conversions::ToPoints(points, count), radius,
672  paint, point_style);
673  } break;
674  case flutter::DlCanvas::PointMode::kLines:
675  for (uint32_t i = 1; i < count; i += 2) {
676  Point p0 = points[i - 1];
677  Point p1 = points[i];
678  GetCanvas().DrawLine(p0, p1, paint, /*reuse_depth=*/i > 1);
679  }
680  break;
681  case flutter::DlCanvas::PointMode::kPolygon:
682  if (count > 1) {
683  Point p0 = points[0];
684  for (uint32_t i = 1; i < count; i++) {
685  Point p1 = points[i];
686  GetCanvas().DrawLine(p0, p1, paint, /*reuse_depth=*/i > 1);
687  p0 = p1;
688  }
689  }
690  break;
691  }
692 }

References AUTO_DEPTH_WATCHER, impeller::Canvas::DrawLine(), impeller::Canvas::DrawPoints(), GetCanvas(), impeller::kRound, impeller::kSquare, impeller::Paint::kStroke, paint_, impeller::Paint::stroke_cap, impeller::Paint::stroke_width, impeller::Paint::style, and impeller::skia_conversions::ToPoints().

◆ drawRect()

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

Definition at line 564 of file dl_dispatcher.cc.

564  {
565  AUTO_DEPTH_WATCHER(1u);
566 
567  GetCanvas().DrawRect(rect, paint_);
568 }

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

◆ drawRRect()

void impeller::DlDispatcherBase::drawRRect ( const SkRRect &  rrect)
override

◆ drawShadow()

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

Definition at line 880 of file dl_dispatcher.cc.

884  {
885  AUTO_DEPTH_WATCHER(1u);
886 
887  Color spot_color = skia_conversions::ToColor(color);
888  spot_color.alpha *= 0.25;
889 
890  // Compute the spot color -- ported from SkShadowUtils::ComputeTonalColors.
891  {
892  Scalar max =
893  std::max(std::max(spot_color.red, spot_color.green), spot_color.blue);
894  Scalar min =
895  std::min(std::min(spot_color.red, spot_color.green), spot_color.blue);
896  Scalar luminance = (min + max) * 0.5;
897 
898  Scalar alpha_adjust =
899  (2.6f + (-2.66667f + 1.06667f * spot_color.alpha) * spot_color.alpha) *
900  spot_color.alpha;
901  Scalar color_alpha =
902  (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
903  luminance;
904  color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
905 
906  Scalar greyscale_alpha =
907  std::clamp(spot_color.alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
908 
909  Scalar color_scale = color_alpha * (1 - greyscale_alpha);
910  Scalar tonal_alpha = color_scale + greyscale_alpha;
911  Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
912  spot_color = Color(unpremul_scale * spot_color.red,
913  unpremul_scale * spot_color.green,
914  unpremul_scale * spot_color.blue, tonal_alpha);
915  }
916 
917  Vector3 light_position(0, -1, 1);
918  Scalar occluder_z = dpr * elevation;
919 
920  constexpr Scalar kLightRadius = 800 / 600; // Light radius / light height
921 
922  Paint paint;
923  paint.style = Paint::Style::kFill;
924  paint.color = spot_color;
925  paint.mask_blur_descriptor = Paint::MaskBlurDescriptor{
927  .sigma = Radius{kLightRadius * occluder_z /
929  };
930 
931  GetCanvas().Save(1u);
933  Matrix::MakeTranslation(Vector2(0, -occluder_z * light_position.y)));
934 
935  SimplifyOrDrawPath(GetCanvas(), path, paint);
937 
938  GetCanvas().Restore();
939 }

References impeller::Color::alpha, AUTO_DEPTH_CHECK, AUTO_DEPTH_WATCHER, impeller::Color::blue, color, 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.

◆ drawTextBlob()

void impeller::DlDispatcherBase::drawTextBlob ( const sk_sp< SkTextBlob >  blob,
DlScalar  x,
DlScalar  y 
)
override

Definition at line 858 of file dl_dispatcher.cc.

860  {
861  // When running with Impeller enabled Skia text blobs are converted to
862  // Impeller text frames in paragraph_skia.cc
864 }

References UNIMPLEMENTED.

◆ drawTextFrame()

void impeller::DlDispatcherBase::drawTextFrame ( const std::shared_ptr< impeller::TextFrame > &  text_frame,
DlScalar  x,
DlScalar  y 
)
override

Definition at line 867 of file dl_dispatcher.cc.

870  {
871  AUTO_DEPTH_WATCHER(1u);
872 
873  GetCanvas().DrawTextFrame(text_frame, //
874  impeller::Point{x, y}, //
875  paint_ //
876  );
877 }

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

◆ drawVertices()

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

Definition at line 694 of file dl_dispatcher.cc.

696  {}

◆ GetCanvas()

◆ restore()

void impeller::DlDispatcherBase::restore ( )
override

Definition at line 327 of file dl_dispatcher.cc.

327  {
328  GetCanvas().Restore();
329 }

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

◆ rotate()

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

Definition at line 346 of file dl_dispatcher.cc.

346  {
347  AUTO_DEPTH_WATCHER(0u);
348 
349  GetCanvas().Rotate(Degrees{degrees});
350 }

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

◆ save()

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

Definition at line 294 of file dl_dispatcher.cc.

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

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

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

339  {
340  AUTO_DEPTH_WATCHER(0u);
341 
342  GetCanvas().Scale({sx, sy, 1.0});
343 }

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

◆ setAntiAlias()

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

Definition at line 137 of file dl_dispatcher.cc.

137  {
138  AUTO_DEPTH_WATCHER(0u);
139 
140  // Nothing to do because AA is implicit.
141 }

References AUTO_DEPTH_WATCHER.

◆ setBlendMode()

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

◆ setColor()

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

◆ setColorFilter()

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

Definition at line 230 of file dl_dispatcher.cc.

230  {
231  AUTO_DEPTH_WATCHER(0u);
232 
233  paint_.color_filter = filter;
234 }

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

◆ setColorSource()

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

Definition at line 219 of file dl_dispatcher.cc.

219  {
220  AUTO_DEPTH_WATCHER(0u);
221 
222  if (!source || source->type() == flutter::DlColorSourceType::kColor) {
223  paint_.color_source = nullptr;
224  } else {
225  paint_.color_source = source;
226  }
227 }

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

◆ setDrawStyle()

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

Definition at line 157 of file dl_dispatcher.cc.

157  {
158  AUTO_DEPTH_WATCHER(0u);
159 
160  paint_.style = ToStyle(style);
161 }

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

◆ setImageFilter()

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

Definition at line 287 of file dl_dispatcher.cc.

287  {
288  AUTO_DEPTH_WATCHER(0u);
289 
290  paint_.image_filter = filter;
291 }

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

◆ setInvertColors()

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

Definition at line 237 of file dl_dispatcher.cc.

237  {
238  AUTO_DEPTH_WATCHER(0u);
239 
240  paint_.invert_colors = invert;
241 }

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

◆ setMaskFilter()

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

Definition at line 264 of file dl_dispatcher.cc.

264  {
265  AUTO_DEPTH_WATCHER(0u);
266 
267  // Needs https://github.com/flutter/flutter/issues/95434
268  if (filter == nullptr) {
269  paint_.mask_blur_descriptor = std::nullopt;
270  return;
271  }
272  switch (filter->type()) {
273  case flutter::DlMaskFilterType::kBlur: {
274  auto blur = filter->asBlur();
275 
277  .style = ToBlurStyle(blur->style()),
278  .sigma = Sigma(blur->sigma()),
279  .respect_ctm = blur->respectCTM(),
280  };
281  break;
282  }
283  }
284 }

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

185  {
186  AUTO_DEPTH_WATCHER(0u);
187 
188  switch (cap) {
189  case flutter::DlStrokeCap::kButt:
191  break;
192  case flutter::DlStrokeCap::kRound:
194  break;
195  case flutter::DlStrokeCap::kSquare:
197  break;
198  }
199 }

References AUTO_DEPTH_WATCHER, impeller::kButt, impeller::kRound, impeller::kSquare, paint_, and impeller::Paint::stroke_cap.

◆ setStrokeJoin()

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

Definition at line 202 of file dl_dispatcher.cc.

202  {
203  AUTO_DEPTH_WATCHER(0u);
204 
205  switch (join) {
206  case flutter::DlStrokeJoin::kMiter:
208  break;
209  case flutter::DlStrokeJoin::kRound:
211  break;
212  case flutter::DlStrokeJoin::kBevel:
214  break;
215  }
216 }

References AUTO_DEPTH_WATCHER, impeller::kBevel, impeller::kMiter, impeller::kRound, paint_, and impeller::Paint::stroke_join.

◆ setStrokeMiter()

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

Definition at line 178 of file dl_dispatcher.cc.

178  {
179  AUTO_DEPTH_WATCHER(0u);
180 
181  paint_.stroke_miter = limit;
182 }

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

◆ setStrokeWidth()

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

Definition at line 171 of file dl_dispatcher.cc.

171  {
172  AUTO_DEPTH_WATCHER(0u);
173 
174  paint_.stroke_width = width;
175 }

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

◆ SimplifyOrDrawPath()

void impeller::DlDispatcherBase::SimplifyOrDrawPath ( Canvas canvas,
const DlPath cache,
const Paint paint 
)
staticprotected

Definition at line 614 of file dl_dispatcher.cc.

616  {
617  DlRect rect;
618 
619  // We can't "optimize" a path into a rectangle if it's open.
620  bool closed;
621  if (path.IsRect(&rect, &closed) && closed) {
622  canvas.DrawRect(rect, paint);
623  return;
624  }
625 
626  SkRRect rrect;
627  if (path.IsSkRRect(&rrect) && rrect.isSimple()) {
628  canvas.DrawRRect(skia_conversions::ToRect(rrect.rect()),
629  skia_conversions::ToSize(rrect.getSimpleRadii()), paint);
630  return;
631  }
632 
633  if (path.IsOval(&rect)) {
634  canvas.DrawOval(rect, paint);
635  return;
636  }
637 
638  canvas.DrawPath(path.GetPath(), paint);
639 }

References impeller::Canvas::DrawOval(), impeller::Canvas::DrawPath(), impeller::Canvas::DrawRect(), impeller::Canvas::DrawRRect(), impeller::skia_conversions::ToRect(), and impeller::skia_conversions::ToSize().

Referenced by drawPath(), and drawShadow().

◆ skew()

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

Definition at line 353 of file dl_dispatcher.cc.

353  {
354  AUTO_DEPTH_WATCHER(0u);
355 
356  GetCanvas().Skew(sx, sy);
357 }

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

365  {
366  AUTO_DEPTH_WATCHER(0u);
367 
368  // clang-format off
370  mxx, mxy, 0, mxt,
371  myx, myy, 0, myt,
372  0 , 0, 1, 0,
373  0 , 0, 0, 1
374  );
375  // clang-format on
376 }

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

394  {
395  AUTO_DEPTH_WATCHER(0u);
396 
397  // The order of arguments is row-major but Impeller matrices are
398  // column-major.
399  // clang-format off
400  auto transform = Matrix{
401  mxx, myx, mzx, mwx,
402  mxy, myy, mzy, mwy,
403  mxz, myz, mzz, mwz,
404  mxt, myt, mzt, mwt
405  };
406  // clang-format on
408 }

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

332  {
333  AUTO_DEPTH_WATCHER(0u);
334 
335  GetCanvas().Translate({tx, ty, 0.0});
336 }

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

Member Data Documentation

◆ initial_matrix_

Matrix impeller::DlDispatcherBase::initial_matrix_
protected

Definition at line 239 of file dl_dispatcher.h.

Referenced by drawDisplayList(), and transformReset().

◆ paint_


The documentation for this class was generated from the following files:
AUTO_DEPTH_WATCHER
#define AUTO_DEPTH_WATCHER(d)
Definition: dl_dispatcher.cc:110
impeller::Paint::stroke_cap
Cap stroke_cap
Definition: paint.h:80
impeller::Matrix::HasPerspective
constexpr bool HasPerspective() const
Definition: matrix.h:335
impeller::Canvas::DrawPoints
void DrawPoints(std::vector< Point > points, Scalar radius, const Paint &paint, PointStyle point_style)
Definition: canvas.cc:685
impeller::ToClipOperation
static Entity::ClipOperation ToClipOperation(flutter::DlCanvas::ClipOp clip_op)
Definition: dl_dispatcher.cc:418
impeller::Cap::kRound
@ kRound
impeller::Cap::kSquare
@ kSquare
impeller::Canvas::DrawRRect
void DrawRRect(const Rect &rect, const Size &corner_radii, const Paint &paint)
Definition: canvas.cc:607
impeller::skia_conversions::ToPoints
std::vector< Point > ToPoints(const SkPoint points[], int count)
Definition: skia_conversions.cc:64
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::Canvas::RestoreToCount
void RestoreToCount(size_t count)
Definition: canvas.cc:378
impeller::ContentBoundsPromise::kMayClipContents
@ kMayClipContents
The caller claims the bounds are a subset of an estimate of the reasonably tight bounds but likely cl...
impeller::skia_conversions::IsNearlySimpleRRect
bool IsNearlySimpleRRect(const SkRRect &rr)
Like SkRRect.isSimple, but allows the corners to differ by kEhCloseEnough.
Definition: skia_conversions.cc:21
impeller::DlDispatcherBase::drawImageRect
void drawImageRect(const sk_sp< flutter::DlImage > image, const DlRect &src, const DlRect &dst, flutter::DlImageSampling sampling, bool render_with_attributes, SrcRectConstraint constraint) override
Definition: dl_dispatcher.cc:728
impeller::Paint::Style::kStroke
@ kStroke
impeller::FillType::kOdd
@ kOdd
impeller::skia_conversions::ToSize
Size ToSize(const SkPoint &point)
Definition: skia_conversions.cc:102
impeller::Canvas::Skew
void Skew(Scalar sx, Scalar sy)
Definition: canvas.cc:347
impeller::skia_conversions::ToSamplerDescriptor
impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlImageSampling options)
Definition: skia_conversions.cc:169
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:986
impeller::Paint::color
Color color
Definition: paint.h:74
impeller::Canvas::DrawTextFrame
void DrawTextFrame(const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint)
Definition: canvas.cc:1313
impeller::TRect::TransformBounds
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
Definition: rect.h:466
impeller::PointStyle::kRound
@ kRound
Points are drawn as squares.
impeller::Vector2
Point Vector2
Definition: point.h:331
impeller::Canvas::ResetTransform
void ResetTransform()
Definition: canvas.cc:323
impeller::skia_conversions::ToColor
Color ToColor(const flutter::DlColor &color)
Definition: skia_conversions.cc:106
impeller::Geometry::MakeOval
static std::unique_ptr< Geometry > MakeOval(const Rect &rect)
Definition: geometry.cc:93
impeller::FilterContents::BlurStyle::kNormal
@ kNormal
Blurred inside and outside.
impeller::Paint::color_filter
const flutter::DlColorFilter * color_filter
Definition: paint.h:76
impeller::Cap::kButt
@ kButt
impeller::Matrix::MakeTranslation
static constexpr Matrix MakeTranslation(const Vector3 &t)
Definition: matrix.h:95
AUTO_DEPTH_CHECK
#define AUTO_DEPTH_CHECK()
Definition: dl_dispatcher.cc:111
impeller::Canvas::DrawRect
void DrawRect(const Rect &rect, const Paint &paint)
Definition: canvas.cc:559
impeller::Canvas::GetCurrentTransform
const Matrix & GetCurrentTransform() const
Definition: canvas.cc:331
UNIMPLEMENTED
#define UNIMPLEMENTED
Definition: dl_dispatcher.cc:115
impeller::skia_conversions::ToBlendMode
BlendMode ToBlendMode(flutter::DlBlendMode mode)
Definition: skia_conversions.cc:204
impeller::DlDispatcherBase::drawLine
void drawLine(const DlPoint &p0, const DlPoint &p1) override
Definition: dl_dispatcher.cc:516
impeller::Join::kMiter
@ kMiter
impeller::Paint::stroke_miter
Scalar stroke_miter
Definition: paint.h:82
impeller::skia_conversions::ToRect
Rect ToRect(const SkRect &rect)
Definition: skia_conversions.cc:30
impeller::ToSamplerDescriptor
static impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlFilterMode options)
Definition: dl_dispatcher.cc:118
impeller::PointStyle::kSquare
@ kSquare
Points are drawn as circles.
impeller::Point
TPoint< Scalar > Point
Definition: point.h:327
impeller::Canvas::Scale
void Scale(const Vector2 &scale)
Definition: canvas.cc:339
impeller::Matrix::GetScale
constexpr Vector3 GetScale() const
Definition: matrix.h:316
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:955
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:213
impeller::Paint::style
Style style
Definition: paint.h:83
impeller::Paint::Style::kFill
@ kFill
impeller::DlRect
flutter::DlRect DlRect
Definition: dl_dispatcher.h:23
impeller::Canvas::DrawCircle
void DrawCircle(const Point &center, Scalar radius, const Paint &paint)
Definition: canvas.cc:632
impeller::ToStyle
static Paint::Style ToStyle(flutter::DlDrawStyle style)
Definition: dl_dispatcher.cc:143
impeller::Paint::color_source
const flutter::DlColorSource * color_source
Definition: paint.h:75
impeller::Canvas::Restore
bool Restore()
Definition: canvas.cc:1138
impeller::Paint::image_filter
const flutter::DlImageFilter * image_filter
Definition: paint.h:77
impeller::Canvas::DrawPath
void DrawPath(const Path &path, const Paint &paint)
Definition: canvas.cc:386
impeller::Canvas::DrawPaint
void DrawPaint(const Paint &paint)
Definition: canvas.cc:401
impeller::Rect
TRect< Scalar > Rect
Definition: rect.h:776
impeller::ToBlurStyle
static FilterContents::BlurStyle ToBlurStyle(flutter::DlBlurStyle blur_style)
Definition: dl_dispatcher.cc:250
impeller::Join::kRound
@ kRound
impeller::Canvas::GetSaveCount
size_t GetSaveCount() const
Definition: canvas.cc:370
impeller::Canvas::DrawImageRect
void DrawImageRect(const std::shared_ptr< Texture > &image, Rect source, Rect dest, const Paint &paint, SamplerDescriptor sampler={}, SourceRectConstraint src_rect_constraint=SourceRectConstraint::kFast)
Definition: canvas.cc:716
impeller::Vector3::y
Scalar y
Definition: vector.h:24
impeller::Geometry::MakeRoundRect
static std::unique_ptr< Geometry > MakeRoundRect(const Rect &rect, const Size &radii)
Definition: geometry.cc:115
impeller::DlDispatcherBase::GetCanvas
virtual Canvas & GetCanvas()=0
impeller::Canvas::DrawAtlas
void DrawAtlas(const std::shared_ptr< AtlasContents > &atlas_contents, const Paint &paint)
Definition: canvas.cc:872
impeller::Canvas::ClipGeometry
void ClipGeometry(std::unique_ptr< Geometry > geometry, Entity::ClipOperation clip_op)
Definition: canvas.cc:655
impeller::DlDispatcherBase::SimplifyOrDrawPath
static void SimplifyOrDrawPath(Canvas &canvas, const DlPath &cache, const Paint &paint)
Definition: dl_dispatcher.cc:614
impeller::Canvas::PreConcat
void PreConcat(const Matrix &transform)
Definition: canvas.cc:319
impeller::Geometry::MakeRect
static std::unique_ptr< Geometry > MakeRect(const Rect &rect)
Definition: geometry.cc:89
impeller::Join::kBevel
@ kBevel
impeller::Canvas::DrawOval
void DrawOval(const Rect &rect, const Paint &paint)
Definition: canvas.cc:577
impeller::Canvas::Rotate
void Rotate(Radians radians)
Definition: canvas.cc:351
impeller::TPoint< Scalar >
impeller::Canvas::Transform
void Transform(const Matrix &transform)
Definition: canvas.cc:327
impeller::DlDispatcherBase::paint_
Paint paint_
Definition: dl_dispatcher.h:238
impeller::Canvas::DrawLine
void DrawLine(const Point &p0, const Point &p1, const Paint &paint, bool reuse_depth=false)
Definition: canvas.cc:546
impeller::Geometry::MakeFillPath
static std::unique_ptr< Geometry > MakeFillPath(const Path &path, std::optional< Rect > inner_rect=std::nullopt)
Definition: geometry.cc:60
impeller::Paint::invert_colors
bool invert_colors
Definition: paint.h:85
impeller::Canvas::Save
void Save(uint32_t total_content_depth=kMaxDepth)
Definition: canvas.cc:938
color
DlColor color
Definition: dl_golden_blur_unittests.cc:24
impeller::skia_conversions::ToPath
Path ToPath(const SkRRect &rrect)
Definition: skia_conversions.cc:90
impeller::TRect< Scalar >::MakeLTRB
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
Definition: rect.h:129
impeller::DlDispatcherBase::initial_matrix_
Matrix initial_matrix_
Definition: dl_dispatcher.h:239
impeller::ContentBoundsPromise::kContainsContents
@ kContainsContents
The caller claims the bounds are a reasonably tight estimate of the coverage of the contents and shou...
impeller::Paint::mask_blur_descriptor
std::optional< MaskBlurDescriptor > mask_blur_descriptor
Definition: paint.h:87
impeller::Paint::stroke_width
Scalar stroke_width
Definition: paint.h:79
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:379
impeller::Paint::blend_mode
BlendMode blend_mode
Definition: paint.h:84
impeller::Paint::stroke_join
Join stroke_join
Definition: paint.h:81
impeller::Canvas::Translate
void Translate(const Vector3 &offset)
Definition: canvas.cc:335