| Flutter Impeller |

Public Member Functions | List of all members
impeller::DlDispatcher Class Referencefinal

`#include <dl_dispatcher.h>`

Inheritance diagram for impeller::DlDispatcher:

## Public Member Functions
| DlDispatcher ()
| DlDispatcher (Rect cull_rect)
| DlDispatcher (IRect cull_rect)
| ~DlDispatcher ()
Picture | EndRecordingAsPicture ()
void | setAntiAlias (bool aa) override
void | setDrawStyle (flutter::DlDrawStyle style) override
void | setColor (flutter::DlColor color) override
void | setStrokeWidth (SkScalar width) override
void | setStrokeMiter (SkScalar 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 | setPathEffect (const flutter::DlPathEffect *effect) override
void | setMaskFilter (const flutter::DlMaskFilter *filter) override
void | setImageFilter (const flutter::DlImageFilter *filter) override
void | save () override
void | saveLayer (const SkRect *bounds, const flutter::SaveLayerOptions options, const flutter::DlImageFilter *backdrop) override
void | restore () override
void | translate (SkScalar tx, SkScalar ty) override
void | scale (SkScalar sx, SkScalar sy) override
void | rotate (SkScalar degrees) override
void | skew (SkScalar sx, SkScalar sy) override
void | transform2DAffine (SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt) override
void | transformFullPerspective (SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt) override
void | transformReset () override
void | clipRect (const SkRect &rect, ClipOp clip_op, bool is_aa) override
void | clipRRect (const SkRRect &rrect, ClipOp clip_op, bool is_aa) override
void | clipPath (const SkPath &path, ClipOp clip_op, bool is_aa) override
void | drawColor (flutter::DlColor color, flutter::DlBlendMode mode) override
void | drawPaint () override
void | drawLine (const SkPoint &p0, const SkPoint &p1) override
void | drawRect (const SkRect &rect) override
void | drawOval (const SkRect &bounds) override
void | drawCircle (const SkPoint &center, SkScalar radius) override
void | drawRRect (const SkRRect &rrect) override
void | drawDRRect (const SkRRect &outer, const SkRRect &inner) override
void | drawPath (const SkPath &path) override
void | drawArc (const SkRect &oval_bounds, SkScalar start_degrees, SkScalar sweep_degrees, bool use_center) override
void | drawPoints (PointMode mode, uint32_t count, const SkPoint points[]) override
void | drawVertices (const flutter::DlVertices *vertices, flutter::DlBlendMode dl_mode) override
void | drawImage (const sk_sp< flutter::DlImage > image, const SkPoint point, flutter::DlImageSampling sampling, bool render_with_attributes) override
void | drawImageRect (const sk_sp< flutter::DlImage > image, const SkRect &src, const SkRect &dst, flutter::DlImageSampling sampling, bool render_with_attributes, SrcRectConstraint constraint) override
void | drawImageNine (const sk_sp< flutter::DlImage > image, const SkIRect &center, const SkRect &dst, flutter::DlFilterMode filter, bool render_with_attributes) override
void | drawAtlas (const sk_sp< flutter::DlImage > atlas, const SkRSXform xform[], const SkRect tex[], const flutter::DlColor colors[], int count, flutter::DlBlendMode mode, flutter::DlImageSampling sampling, const SkRect *cull_rect, bool render_with_attributes) override
void | drawDisplayList (const sk_sp< flutter::DisplayList > display_list, SkScalar opacity) override
void | drawTextBlob (const sk_sp< SkTextBlob > blob, SkScalar x, SkScalar y) override
void | drawTextFrame (const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y) override
void | drawShadow (const SkPath &path, const flutter::DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr) override

## Detailed Description

Definition at line 14 of file dl_dispatcher.h.

## Constructor & Destructor Documentation

## ◆ DlDispatcher() [1/3]

impeller::DlDispatcher::DlDispatcher | ( |  | ) |
| default

## ◆ DlDispatcher() [2/3]

impeller::DlDispatcher::DlDispatcher | ( | Rect | cull_rect | ) |
| explicit

Definition at line 41 of file dl_dispatcher.cc.

41 : canvas_(cull_rect) {}

## ◆ DlDispatcher() [3/3]

impeller::DlDispatcher::DlDispatcher | ( | IRect | cull_rect | ) |
| explicit

Definition at line 43 of file dl_dispatcher.cc.

43 : canvas_(cull_rect) {}

## ◆ ~DlDispatcher()

impeller::DlDispatcher::~DlDispatcher | ( |  | ) |
| default

## Member Function Documentation

## ◆ clipPath()

void impeller::DlDispatcher::clipPath | ( | const SkPath & | path,
|  | ClipOp | clip_op,
|  | bool | is_aa
| ) |  |
| override

Definition at line 744 of file dl_dispatcher.cc.

744 {
745 auto clip_op = ToClipOperation(sk_op);
746
747 SkRect rect;
748 if (path.isRect(&rect)) {
749 canvas_.ClipRect(skia_conversions::ToRect(rect), clip_op);
750 } else if (path.isOval(&rect)) {
751 canvas_.ClipOval(skia_conversions::ToRect(rect), clip_op);
752 } else {
753 SkRRect rrect;
754 if (path.isRRect(&rrect) && rrect.isSimple()) {
755 canvas_.ClipRRect(skia_conversions::ToRect(rrect.rect()),
756 skia_conversions::ToSize(rrect.getSimpleRadii()),
757 clip_op);
758 } else {
759 canvas_.ClipPath(skia_conversions::ToPath(path), clip_op);
760 }
761 }
762 }

References impeller::Canvas::ClipOval(), impeller::Canvas::ClipPath(), impeller::Canvas::ClipRect(), impeller::Canvas::ClipRRect(), impeller::ToClipOperation(), impeller::skia_conversions::ToPath(), impeller::skia_conversions::ToRect(), and impeller::skia_conversions::ToSize().

## ◆ clipRect()

void impeller::DlDispatcher::clipRect | ( | const SkRect & | rect,
|  | ClipOp | clip_op,
|  | bool | is_aa
| ) |  |
| override

Definition at line 723 of file dl_dispatcher.cc.

723 {
724 canvas_.ClipRect(skia_conversions::ToRect(rect), ToClipOperation(clip_op));
725 }

References impeller::Canvas::ClipRect(), impeller::ToClipOperation(), and impeller::skia_conversions::ToRect().

## ◆ clipRRect()

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

Definition at line 728 of file dl_dispatcher.cc.

728 {
729 auto clip_op = ToClipOperation(sk_op);
730 if (rrect.isRect()) {
731 canvas_.ClipRect(skia_conversions::ToRect(rrect.rect()), clip_op);
732 } else if (rrect.isOval()) {
733 canvas_.ClipOval(skia_conversions::ToRect(rrect.rect()), clip_op);
734 } else if (rrect.isSimple()) {
735 canvas_.ClipRRect(skia_conversions::ToRect(rrect.rect()),
736 skia_conversions::ToSize(rrect.getSimpleRadii()),
737 clip_op);
738 } else {
739 canvas_.ClipPath(skia_conversions::ToPath(rrect), clip_op);
740 }
741 }

References impeller::Canvas::ClipOval(), impeller::Canvas::ClipPath(), impeller::Canvas::ClipRect(), impeller::Canvas::ClipRRect(), impeller::ToClipOperation(), impeller::skia_conversions::ToPath(), impeller::skia_conversions::ToRect(), and impeller::skia_conversions::ToSize().

## ◆ drawArc()

void impeller::DlDispatcher::drawArc | ( | const SkRect & | oval_bounds,
|  | SkScalar | start_degrees,
|  | SkScalar | sweep_degrees,
|  | bool | use_center
| ) |  |
| override

Definition at line 851 of file dl_dispatcher.cc.

854 {
855 PathBuilder builder;
856 builder.AddArc(skia_conversions::ToRect(oval_bounds), Degrees(start_degrees),
857 Degrees(sweep_degrees), use_center);
858 canvas_.DrawPath(builder.TakePath(), paint_);
859 }

References impeller::PathBuilder::AddArc(), impeller::Canvas::DrawPath(), impeller::PathBuilder::TakePath(), and impeller::skia_conversions::ToRect().

## ◆ drawAtlas()

void impeller::DlDispatcher::drawAtlas | ( | const sk_sp< flutter::DlImage > | atlas,
|  | const SkRSXform | xform[],
|  | const SkRect | tex[],
|  | const flutter::DlColor | colors[],
|  | int | count,
|  | flutter::DlBlendMode | mode,
|  | flutter::DlImageSampling | sampling,
|  | const SkRect * | cull_rect,
|  | bool | render_with_attributes
| ) |  |
| override

Definition at line 965 of file dl_dispatcher.cc.

973 {
974 canvas_.DrawAtlas(std::make_shared<Image>(atlas->impeller_texture()),
975 skia_conversions::ToRSXForms(xform, count),
976 skia_conversions::ToRects(tex, count),
977 ToColors(colors, count), ToBlendMode(mode),
978 ToSamplerDescriptor(sampling),
979 skia_conversions::ToRect(cull_rect), paint_);
980 }

References impeller::Canvas::DrawAtlas(), impeller::ToBlendMode(), impeller::ToColors(), impeller::skia_conversions::ToRect(), impeller::skia_conversions::ToRects(), impeller::skia_conversions::ToRSXForms(), and impeller::ToSamplerDescriptor().

## ◆ drawCircle()

void impeller::DlDispatcher::drawCircle | ( | const SkPoint & | center,
|  | SkScalar | radius
| ) |  |
| override

Definition at line 795 of file dl_dispatcher.cc.

795 {
796 canvas_.DrawCircle(skia_conversions::ToPoint(center), radius, paint_);
797 }

References impeller::Canvas::DrawCircle(), and impeller::skia_conversions::ToPoint().

## ◆ drawColor()

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

Definition at line 765 of file dl_dispatcher.cc.

766 {
767 Paint paint;
768 paint.color = skia_conversions::ToColor(color);
769 paint.blend_mode = ToBlendMode(dl_mode);
770 canvas_.DrawPaint(paint);
771 }

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

## ◆ drawDisplayList()

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

Definition at line 983 of file dl_dispatcher.cc.

985 {
986 // Save all values that must remain untouched after the operation.
987 Paint saved_paint = paint_;
988 Matrix saved_initial_matrix = initial_matrix_;
989 int restore_count = canvas_.GetSaveCount();
990
991 // The display list may alter the clip, which must be restored to the current
992 // clip at the end of playback.
993 canvas_.Save();
994
995 // Establish a new baseline for interpreting the new DL.
996 // Matrix and clip are left untouched, the current
997 // transform is saved as the new base matrix, and paint
998 // values are reset to defaults.
999 initial_matrix_ = canvas_.GetCurrentTransform();
1000 paint_ = Paint();
1001
1002 // Handle passed opacity in the most brute-force way by using
1003 // a SaveLayer. If the display_list is able to inherit the
1004 // opacity, this could also be handled by modulating all of its
1005 // attribute settings (for example, color), by the indicated
1006 // opacity.
1007 if (opacity < SK_Scalar1) {
1008 Paint save_paint;
1009 save_paint.color = Color(0, 0, 0, opacity);
1010 canvas_.SaveLayer(save_paint);
1011 }
1012
1013 // TODO(131445): Remove this restriction if we can correctly cull with
1014 // perspective transforms.
1015 if (display_list->has_rtree() && !initial_matrix_.HasPerspective()) {
1016 // The canvas remembers the screen-space culling bounds clipped by
1017 // the surface and the history of clip calls. DisplayList can cull
1018 // the ops based on a rectangle expressed in its "destination bounds"
1019 // so we need the canvas to transform those into the current local
1020 // coordinate space into which the DisplayList will be rendered.
1021 auto cull_bounds = canvas_.GetCurrentLocalCullingBounds();
1022 if (cull_bounds.has_value()) {
1023 Rect cull_rect = cull_bounds.value();
1024 display_list->Dispatch(
1025 *this, SkRect::MakeLTRB(cull_rect.GetLeft(), cull_rect.GetTop(),
1026 cull_rect.GetRight(), cull_rect.GetBottom()));
1027 } else {
1028 display_list->Dispatch(*this);
1029 }
1030 } else {
1031 display_list->Dispatch(*this);
1032 }
1033
1034 // Restore all saved state back to what it was before we interpreted
1035 // the display_list
1036 canvas_.RestoreToCount(restore_count);
1037 initial_matrix_ = saved_initial_matrix;
1038 paint_ = saved_paint;
1039 }

References impeller::Paint::color, impeller::TRect< T >::GetBottom(), impeller::Canvas::GetCurrentLocalCullingBounds(), impeller::Canvas::GetCurrentTransform(), impeller::TRect< T >::GetLeft(), impeller::TRect< T >::GetRight(), impeller::Canvas::GetSaveCount(), impeller::TRect< T >::GetTop(), impeller::Matrix::HasPerspective(), impeller::Canvas::RestoreToCount(), impeller::Canvas::Save(), and impeller::Canvas::SaveLayer().

Referenced by impeller::testing::TEST_P().

## ◆ drawDRRect()

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

Definition at line 810 of file dl_dispatcher.cc.

810 {
811 PathBuilder builder;
812 builder.AddPath(skia_conversions::ToPath(outer));
813 builder.AddPath(skia_conversions::ToPath(inner));
814 canvas_.DrawPath(builder.TakePath(FillType::kOdd), paint_);
815 }

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

## ◆ drawImage()

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

Definition at line 906 of file dl_dispatcher.cc.

909 {
910 if (!image) {
911 return;
912 }
913
914 auto texture = image->impeller_texture();
915 if (!texture) {
916 return;
917 }
918
919 const auto size = texture->GetSize();
920 const auto src = SkRect::MakeWH(size.width, size.height);
921 const auto dest =
922 SkRect::MakeXYWH(point.fX, point.fY, size.width, size.height);
923
924 drawImageRect(image, // image
925 src, // source rect
926 dest, // destination rect
927 sampling, // sampling options
928 render_with_attributes, // render with attributes
929 SrcRectConstraint::kStrict // constraint
930 );
931 }

References drawImageRect().

## ◆ drawImageNine()

void impeller::DlDispatcher::drawImageNine | ( | const sk_sp< flutter::DlImage > | image,
|  | const SkIRect & | center,
|  | const SkRect & | dst,
|  | flutter::DlFilterMode | filter,
|  | bool | render_with_attributes
| ) |  |
| override

Definition at line 951 of file dl_dispatcher.cc.

955 {
956 NinePatchConverter converter = {};
957 converter.DrawNinePatch(
958 std::make_shared<Image>(image->impeller_texture()),
959 Rect::MakeLTRB(center.fLeft, center.fTop, center.fRight, center.fBottom),
960 skia_conversions::ToRect(dst), ToSamplerDescriptor(filter), &canvas_,
961 &paint_);
962 }

References impeller::NinePatchConverter::DrawNinePatch(), impeller::TRect< Scalar >::MakeLTRB(), impeller::skia_conversions::ToRect(), and impeller::ToSamplerDescriptor().

## ◆ drawImageRect()

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

Definition at line 934 of file dl_dispatcher.cc.

940 {
941 canvas_.DrawImageRect(
942 std::make_shared<Image>(image->impeller_texture()), // image
943 skia_conversions::ToRect(src), // source rect
944 skia_conversions::ToRect(dst), // destination rect
945 render_with_attributes ? paint_ : Paint(), // paint
946 ToSamplerDescriptor(sampling) // sampling
947 );
948 }

References impeller::Canvas::DrawImageRect(), impeller::skia_conversions::ToRect(), and impeller::ToSamplerDescriptor().

Referenced by drawImage().

## ◆ drawLine()

void impeller::DlDispatcher::drawLine | ( | const SkPoint & | p0,
|  | const SkPoint & | p1
| ) |  |
| override

Definition at line 779 of file dl_dispatcher.cc.

779 {
780 canvas_.DrawLine(skia_conversions::ToPoint(p0), skia_conversions::ToPoint(p1),
781 paint_);
782 }

References impeller::Canvas::DrawLine(), and impeller::skia_conversions::ToPoint().

## ◆ drawOval()

void impeller::DlDispatcher::drawOval | ( | const SkRect & | bounds | ) |
| override

Definition at line 790 of file dl_dispatcher.cc.

790 {
791 canvas_.DrawOval(skia_conversions::ToRect(bounds), paint_);
792 }

References impeller::Canvas::DrawOval(), and impeller::skia_conversions::ToRect().

## ◆ drawPaint()

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

Definition at line 774 of file dl_dispatcher.cc.

774 {
775 canvas_.DrawPaint(paint_);
776 }

References impeller::Canvas::DrawPaint().

## ◆ drawPath()

void impeller::DlDispatcher::drawPath | ( | const SkPath & | path | ) |
| override

Definition at line 818 of file dl_dispatcher.cc.

818 {
819 SimplifyOrDrawPath(canvas_, path, paint_);
820 }

## ◆ drawPoints()

void impeller::DlDispatcher::drawPoints | ( | PointMode | mode,
|  | uint32_t | count,
|  | const SkPoint | points[]
| ) |  |
| override

Definition at line 862 of file dl_dispatcher.cc.

864 {
865 Paint paint = paint_;
866 paint.style = Paint::Style::kStroke;
867 switch (mode) {
868 case flutter::DlCanvas::PointMode::kPoints: {
869 // Cap::kButt is also treated as a square.
870 auto point_style = paint.stroke_cap == Cap::kRound ? PointStyle::kRound
871 : PointStyle::kSquare;
872 auto radius = paint.stroke_width;
873 if (radius > 0) {
874 radius /= 2.0;
875 }
876 canvas_.DrawPoints(skia_conversions::ToPoints(points, count), radius,
877 paint, point_style);
878 } break;
879 case flutter::DlCanvas::PointMode::kLines:
880 for (uint32_t i = 1; i < count; i += 2) {
881 Point p0 = skia_conversions::ToPoint(points[i - 1]);
882 Point p1 = skia_conversions::ToPoint(points[i]);
883 canvas_.DrawLine(p0, p1, paint);
884 }
885 break;
886 case flutter::DlCanvas::PointMode::kPolygon:
887 if (count > 1) {
888 Point p0 = skia_conversions::ToPoint(points[0]);
889 for (uint32_t i = 1; i < count; i++) {
890 Point p1 = skia_conversions::ToPoint(points[i]);
891 canvas_.DrawLine(p0, p1, paint);
892 p0 = p1;
893 }
894 }
895 break;
896 }
897 }

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

## ◆ drawRect()

void impeller::DlDispatcher::drawRect | ( | const SkRect & | rect | ) |
| override

Definition at line 785 of file dl_dispatcher.cc.

785 {
786 canvas_.DrawRect(skia_conversions::ToRect(rect), paint_);
787 }

References impeller::Canvas::DrawRect(), and impeller::skia_conversions::ToRect().

## ◆ drawRRect()

void impeller::DlDispatcher::drawRRect | ( | const SkRRect & | rrect | ) |
| override

Definition at line 800 of file dl_dispatcher.cc.

800 {
801 if (rrect.isSimple()) {
802 canvas_.DrawRRect(skia_conversions::ToRect(rrect.rect()),
803 skia_conversions::ToSize(rrect.getSimpleRadii()), paint_);
804 } else {
805 canvas_.DrawPath(skia_conversions::ToPath(rrect), paint_);
806 }
807 }

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

## ◆ drawShadow()

void impeller::DlDispatcher::drawShadow | ( | const SkPath & | path,
|  | const flutter::DlColor | color,
|  | const SkScalar | elevation,
|  | bool | transparent_occluder,
|  | SkScalar | dpr
| ) |  |
| override

Definition at line 1060 of file dl_dispatcher.cc.

1064 {
1065 Color spot_color = skia_conversions::ToColor(color);
1066 spot_color.alpha *= 0.25;
1067
1068 // Compute the spot color -- ported from SkShadowUtils::ComputeTonalColors.
1069 {
1070 Scalar max =
1071 std::max(std::max(spot_color.red, spot_color.green), spot_color.blue);
1072 Scalar min =
1073 std::min(std::min(spot_color.red, spot_color.green), spot_color.blue);
1074 Scalar luminance = (min + max) * 0.5;
1075
1076 Scalar alpha_adjust =
1077 (2.6f + (-2.66667f + 1.06667f * spot_color.alpha) * spot_color.alpha) *
1078 spot_color.alpha;
1079 Scalar color_alpha =
1080 (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
1081 luminance;
1082 color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
1083
1084 Scalar greyscale_alpha =
1085 std::clamp(spot_color.alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
1086
1087 Scalar color_scale = color_alpha * (1 - greyscale_alpha);
1088 Scalar tonal_alpha = color_scale + greyscale_alpha;
1089 Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
1090 spot_color = Color(unpremul_scale * spot_color.red,
1091 unpremul_scale * spot_color.green,
1092 unpremul_scale * spot_color.blue, tonal_alpha);
1093 }
1094
1095 Vector3 light_position(0, -1, 1);
1096 Scalar occluder_z = dpr * elevation;
1097
1098 constexpr Scalar kLightRadius = 800 / 600; // Light radius / light height
1099
1100 Paint paint;
1101 paint.style = Paint::Style::kFill;
1102 paint.color = spot_color;
1103 paint.mask_blur_descriptor = Paint::MaskBlurDescriptor{
1104 .style = FilterContents::BlurStyle::kNormal,
1105 .sigma = Radius{kLightRadius * occluder_z /
1106 canvas_.GetCurrentTransform().GetScale().y},
1107 };
1108
1109 canvas_.Save();
1110 canvas_.PreConcat(
1111 Matrix::MakeTranslation(Vector2(0, -occluder_z * light_position.y)));
1112
1113 SimplifyOrDrawPath(canvas_, path, paint);
1114
1115 canvas_.Restore();
1116 }

References impeller::Color::alpha, impeller::Color::blue, impeller::Paint::color, 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(), impeller::Paint::MaskBlurDescriptor::style, impeller::Paint::style, impeller::skia_conversions::ToColor(), and impeller::Vector3::y.

Referenced by impeller::testing::TEST_P().

## ◆ drawTextBlob()

void impeller::DlDispatcher::drawTextBlob | ( | const sk_sp< SkTextBlob > | blob,
|  | SkScalar | x,
|  | SkScalar | y
| ) |  |
| override

Definition at line 1042 of file dl_dispatcher.cc.

1044 {
1045 // When running with Impeller enabled Skia text blobs are converted to
1046 // Impeller text frames in paragraph_skia.cc
1047 UNIMPLEMENTED;
1048 }

References UNIMPLEMENTED.

## ◆ drawTextFrame()

void impeller::DlDispatcher::drawTextFrame | ( | const std::shared_ptr< impeller::TextFrame > & | text_frame,
|  | SkScalar | x,
|  | SkScalar | y
| ) |  |
| override

Definition at line 1050 of file dl_dispatcher.cc.

1052 {
1053 canvas_.DrawTextFrame(text_frame, //
1054 impeller::Point{x, y}, //
1055 paint_ //
1056 );
1057 }

References impeller::Canvas::DrawTextFrame().

## ◆ drawVertices()

void impeller::DlDispatcher::drawVertices | ( | const flutter::DlVertices * | vertices,
|  | flutter::DlBlendMode | dl_mode
| ) |  |
| override

Definition at line 900 of file dl_dispatcher.cc.

901 {
902 canvas_.DrawVertices(MakeVertices(vertices), ToBlendMode(dl_mode), paint_);
903 }

References impeller::Canvas::DrawVertices(), impeller::MakeVertices(), and impeller::ToBlendMode().

## ◆ EndRecordingAsPicture()

Picture impeller::DlDispatcher::EndRecordingAsPicture | ( |  | ) |

Definition at line 1118 of file dl_dispatcher.cc.

1118 {
1119 TRACE_EVENT0("impeller", "DisplayListDispatcher::EndRecordingAsPicture");
1120 return canvas_.EndRecordingAsPicture();
1121 }

References impeller::Canvas::EndRecordingAsPicture().

Referenced by impeller::DlPlayground::OpenPlaygroundHere(), impeller::testing::TEST(), and impeller::testing::TEST_P().

## ◆ restore()

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

Definition at line 635 of file dl_dispatcher.cc.

635 {
636 canvas_.Restore();
637 }

References impeller::Canvas::Restore().

Referenced by impeller::testing::TEST_P().

## ◆ rotate()

void impeller::DlDispatcher::rotate | ( | SkScalar | degrees | ) |
| override

Definition at line 650 of file dl_dispatcher.cc.

650 {
651 canvas_.Rotate(Degrees{degrees});
652 }

References impeller::Canvas::Rotate().

## ◆ save()

void impeller::DlDispatcher::save | ( |  | ) |
| override

Definition at line 621 of file dl_dispatcher.cc.

621 {
622 canvas_.Save();
623 }

References impeller::Canvas::Save().

Referenced by impeller::testing::TEST_P().

## ◆ saveLayer()

void impeller::DlDispatcher::saveLayer | ( | const SkRect * | bounds,
|  | const flutter::SaveLayerOptions | options,
|  | const flutter::DlImageFilter * | backdrop
| ) |  |
| override

Definition at line 626 of file dl_dispatcher.cc.

628 {
629 auto paint = options.renders_with_attributes() ? paint_ : Paint{};
630 canvas_.SaveLayer(paint, skia_conversions::ToRect(bounds),
631 ToImageFilter(backdrop));
632 }

References impeller::Canvas::SaveLayer(), impeller::ToImageFilter(), and impeller::skia_conversions::ToRect().

## ◆ scale()

void impeller::DlDispatcher::scale | ( | SkScalar | sx,
|  | SkScalar | sy
| ) |  |
| override

Definition at line 645 of file dl_dispatcher.cc.

645 {
646 canvas_.Scale({sx, sy, 1.0});
647 }

References impeller::Canvas::Scale().

Referenced by impeller::testing::TEST_P().

## ◆ setAntiAlias()

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

Definition at line 178 of file dl_dispatcher.cc.

178 {
179 // Nothing to do because AA is implicit.
180 }

## ◆ setBlendMode()

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

Definition at line 482 of file dl_dispatcher.cc.

482 {
483 paint_.blend_mode = ToBlendMode(dl_mode);
484 }

References impeller::Paint::blend_mode, and impeller::ToBlendMode().

## ◆ setColor()

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

Definition at line 201 of file dl_dispatcher.cc.

201 {
202 paint_.color = {
203 color.getRedF(),
204 color.getGreenF(),
205 color.getBlueF(),
206 color.getAlphaF(),
207 };
208 }

References impeller::Paint::color.

Referenced by setColorSource().

## ◆ setColorFilter()

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

Definition at line 472 of file dl_dispatcher.cc.

472 {
473 paint_.color_filter = ToColorFilter(filter);
474 }

References impeller::Paint::color_filter, and impeller::ToColorFilter().

## ◆ setColorSource()

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

Definition at line 286 of file dl_dispatcher.cc.

286 {
287 if (!source) {
288 paint_.color_source = ColorSource::MakeColor();
289 return;
290 }
291
292 std::optional<ColorSource::Type> type = ToColorSourceType(source->type());
293
294 if (!type.has_value()) {
295 FML_LOG(ERROR) << "Requested ColorSourceType::kUnknown";
296 paint_.color_source = ColorSource::MakeColor();
297 return;
298 }
299
300 switch (type.value()) {
301 case ColorSource::Type::kColor: {
302 const flutter::DlColorColorSource* color = source->asColor();
303
304 paint_.color_source = ColorSource::MakeColor();
305 setColor(color->color());
306 FML_DCHECK(color);
307 return;
308 }
309 case ColorSource::Type::kLinearGradient: {
310 const flutter::DlLinearGradientColorSource* linear =
311 source->asLinearGradient();
312 FML_DCHECK(linear);
313 auto start_point = skia_conversions::ToPoint(linear->start_point());
314 auto end_point = skia_conversions::ToPoint(linear->end_point());
315 std::vector<Color> colors;
316 std::vector<float> stops;
317 skia_conversions::ConvertStops(linear, colors, stops);
318
319 auto tile_mode = ToTileMode(linear->tile_mode());
320 auto matrix = ToMatrix(linear->matrix());
321
322 paint_.color_source = ColorSource::MakeLinearGradient(
323 start_point, end_point, std::move(colors), std::move(stops),
324 tile_mode, matrix);
325 return;
326 }
327 case ColorSource::Type::kConicalGradient: {
328 const flutter::DlConicalGradientColorSource* conical_gradient =
329 source->asConicalGradient();
330 FML_DCHECK(conical_gradient);
331 Point center = skia_conversions::ToPoint(conical_gradient->end_center());
332 SkScalar radius = conical_gradient->end_radius();
333 Point focus_center =
334 skia_conversions::ToPoint(conical_gradient->start_center());
335 SkScalar focus_radius = conical_gradient->start_radius();
336 std::vector<Color> colors;
337 std::vector<float> stops;
338 skia_conversions::ConvertStops(conical_gradient, colors, stops);
339
340 auto tile_mode = ToTileMode(conical_gradient->tile_mode());
341 auto matrix = ToMatrix(conical_gradient->matrix());
342
343 paint_.color_source = ColorSource::MakeConicalGradient(
344 center, radius, std::move(colors), std::move(stops), focus_center,
345 focus_radius, tile_mode, matrix);
346 return;
347 }
348 case ColorSource::Type::kRadialGradient: {
349 const flutter::DlRadialGradientColorSource* radialGradient =
350 source->asRadialGradient();
351 FML_DCHECK(radialGradient);
352 auto center = skia_conversions::ToPoint(radialGradient->center());
353 auto radius = radialGradient->radius();
354 std::vector<Color> colors;
355 std::vector<float> stops;
356 skia_conversions::ConvertStops(radialGradient, colors, stops);
357
358 auto tile_mode = ToTileMode(radialGradient->tile_mode());
359 auto matrix = ToMatrix(radialGradient->matrix());
360 paint_.color_source =
361 ColorSource::MakeRadialGradient(center, radius, std::move(colors),
362 std::move(stops), tile_mode, matrix);
363 return;
364 }
365 case ColorSource::Type::kSweepGradient: {
366 const flutter::DlSweepGradientColorSource* sweepGradient =
367 source->asSweepGradient();
368 FML_DCHECK(sweepGradient);
369
370 auto center = skia_conversions::ToPoint(sweepGradient->center());
371 auto start_angle = Degrees(sweepGradient->start());
372 auto end_angle = Degrees(sweepGradient->end());
373 std::vector<Color> colors;
374 std::vector<float> stops;
375 skia_conversions::ConvertStops(sweepGradient, colors, stops);
376
377 auto tile_mode = ToTileMode(sweepGradient->tile_mode());
378 auto matrix = ToMatrix(sweepGradient->matrix());
379 paint_.color_source = ColorSource::MakeSweepGradient(
380 center, start_angle, end_angle, std::move(colors), std::move(stops),
381 tile_mode, matrix);
382 return;
383 }
384 case ColorSource::Type::kImage: {
385 const flutter::DlImageColorSource* image_color_source = source->asImage();
386 FML_DCHECK(image_color_source &&
387 image_color_source->image()->impeller_texture());
388 auto texture = image_color_source->image()->impeller_texture();
389 auto x_tile_mode = ToTileMode(image_color_source->horizontal_tile_mode());
390 auto y_tile_mode = ToTileMode(image_color_source->vertical_tile_mode());
391 auto desc = ToSamplerDescriptor(image_color_source->sampling());
392 auto matrix = ToMatrix(image_color_source->matrix());
393 paint_.color_source = ColorSource::MakeImage(texture, x_tile_mode,
394 y_tile_mode, desc, matrix);
395 return;
396 }
397 case ColorSource::Type::kRuntimeEffect: {
398 const flutter::DlRuntimeEffectColorSource* runtime_effect_color_source =
399 source->asRuntimeEffect();
400 auto runtime_stage =
401 runtime_effect_color_source->runtime_effect()->runtime_stage();
402 auto uniform_data = runtime_effect_color_source->uniform_data();
403 auto samplers = runtime_effect_color_source->samplers();
404
405 std::vector<RuntimeEffectContents::TextureInput> texture_inputs;
406
407 for (auto& sampler : samplers) {
408 if (sampler == nullptr) {
409 return;
410 }
411 auto* image = sampler->asImage();
412 if (!sampler->asImage()) {
413 UNIMPLEMENTED;
414 return;
415 }
416 FML_DCHECK(image->image()->impeller_texture());
417 texture_inputs.push_back({
418 .sampler_descriptor = ToSamplerDescriptor(image->sampling()),
419 .texture = image->image()->impeller_texture(),
420 });
421 }
422
423 paint_.color_source = ColorSource::MakeRuntimeEffect(
424 runtime_stage, uniform_data, texture_inputs);
425 return;
426 }
427 case ColorSource::Type::kScene: {
428 #ifdef IMPELLER_ENABLE_3D
429 const flutter::DlSceneColorSource* scene_color_source = source->asScene();
430 std::shared_ptr<scene::Node> scene_node =
431 scene_color_source->scene_node();
432 Matrix camera_transform = scene_color_source->camera_matrix();
433
434 paint_.color_source =
435 ColorSource::MakeScene(scene_node, camera_transform);
436 #else // IMPELLER_ENABLE_3D
437 FML_LOG(ERROR) << "ColorSourceType::kScene can only be used if Impeller "
438 "Scene is enabled.";
439 #endif // IMPELLER_ENABLE_3D
440 return;
441 }
442 }
443 }

References impeller::Paint::color_source, impeller::skia_conversions::ConvertStops(), impeller::ColorSource::kColor, impeller::ColorSource::kConicalGradient, impeller::ColorSource::kImage, impeller::ColorSource::kLinearGradient, impeller::ColorSource::kRadialGradient, impeller::ColorSource::kRuntimeEffect, impeller::ColorSource::kScene, impeller::ColorSource::kSweepGradient, impeller::ColorSource::MakeColor(), impeller::ColorSource::MakeConicalGradient(), impeller::ColorSource::MakeImage(), impeller::ColorSource::MakeLinearGradient(), impeller::ColorSource::MakeRadialGradient(), impeller::ColorSource::MakeRuntimeEffect(), impeller::ColorSource::MakeSweepGradient(), setColor(), impeller::ToColorSourceType(), impeller::ToMatrix(), impeller::skia_conversions::ToPoint(), impeller::ToSamplerDescriptor(), impeller::ToTileMode(), and UNIMPLEMENTED.

## ◆ setDrawStyle()

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

Definition at line 196 of file dl_dispatcher.cc.

196 {
197 paint_.style = ToStyle(style);
198 }

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

## ◆ setImageFilter()

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

Definition at line 616 of file dl_dispatcher.cc.

616 {
617 paint_.image_filter = ToImageFilter(filter);
618 }

References impeller::Paint::image_filter, and impeller::ToImageFilter().

## ◆ setInvertColors()

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

Definition at line 477 of file dl_dispatcher.cc.

477 {
478 paint_.invert_colors = invert;
479 }

References impeller::Paint::invert_colors.

## ◆ setMaskFilter()

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

Definition at line 506 of file dl_dispatcher.cc.

506 {
507 // Needs https://github.com/flutter/flutter/issues/95434
508 if (filter == nullptr) {
509 paint_.mask_blur_descriptor = std::nullopt;
510 return;
511 }
512 switch (filter->type()) {
513 case flutter::DlMaskFilterType::kBlur: {
514 auto blur = filter->asBlur();
515
516 paint_.mask_blur_descriptor = {
517 .style = ToBlurStyle(blur->style()),
518 .sigma = Sigma(blur->sigma()),
519 };
520 break;
521 }
522 }
523 }

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

## ◆ setPathEffect()

void impeller::DlDispatcher::setPathEffect | ( | const flutter::DlPathEffect * | effect | ) |
| override

Definition at line 487 of file dl_dispatcher.cc.

487 {
488 // Needs https://github.com/flutter/flutter/issues/95434
489 UNIMPLEMENTED;
490 }

References UNIMPLEMENTED.

## ◆ setStrokeCap()

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

Definition at line 221 of file dl_dispatcher.cc.

221 {
222 switch (cap) {
223 case flutter::DlStrokeCap::kButt:
224 paint_.stroke_cap = Cap::kButt;
225 break;
226 case flutter::DlStrokeCap::kRound:
227 paint_.stroke_cap = Cap::kRound;
228 break;
229 case flutter::DlStrokeCap::kSquare:
230 paint_.stroke_cap = Cap::kSquare;
231 break;
232 }
233 }

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

## ◆ setStrokeJoin()

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

Definition at line 236 of file dl_dispatcher.cc.

236 {
237 switch (join) {
238 case flutter::DlStrokeJoin::kMiter:
239 paint_.stroke_join = Join::kMiter;
240 break;
241 case flutter::DlStrokeJoin::kRound:
242 paint_.stroke_join = Join::kRound;
243 break;
244 case flutter::DlStrokeJoin::kBevel:
245 paint_.stroke_join = Join::kBevel;
246 break;
247 }
248 }

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

## ◆ setStrokeMiter()

void impeller::DlDispatcher::setStrokeMiter | ( | SkScalar | limit | ) |
| override

Definition at line 216 of file dl_dispatcher.cc.

216 {
217 paint_.stroke_miter = limit;
218 }

References impeller::Paint::stroke_miter.

## ◆ setStrokeWidth()

void impeller::DlDispatcher::setStrokeWidth | ( | SkScalar | width | ) |
| override

Definition at line 211 of file dl_dispatcher.cc.

211 {
212 paint_.stroke_width = width;
213 }

References impeller::Paint::stroke_width.

## ◆ skew()

void impeller::DlDispatcher::skew | ( | SkScalar | sx,
|  | SkScalar | sy
| ) |  |
| override

Definition at line 655 of file dl_dispatcher.cc.

655 {
656 canvas_.Skew(sx, sy);
657 }

References impeller::Canvas::Skew().

## ◆ transform2DAffine()

void impeller::DlDispatcher::transform2DAffine | ( | SkScalar | mxx,
|  | SkScalar | mxy,
|  | SkScalar | mxt,
|  | SkScalar | myx,
|  | SkScalar | myy,
|  | SkScalar | myt
| ) |  |
| override

Definition at line 660 of file dl_dispatcher.cc.

665 {
666 // clang-format off
667 transformFullPerspective(
668 mxx, mxy, 0, mxt,
669 myx, myy, 0, myt,
670 0 , 0, 1, 0,
671 0 , 0, 0, 1
672 );
673 // clang-format on
674 }

References transformFullPerspective().

## ◆ transformFullPerspective()

void impeller::DlDispatcher::transformFullPerspective | ( | SkScalar | mxx,
|  | SkScalar | mxy,
|  | SkScalar | mxz,
|  | SkScalar | mxt,
|  | SkScalar | myx,
|  | SkScalar | myy,
|  | SkScalar | myz,
|  | SkScalar | myt,
|  | SkScalar | mzx,
|  | SkScalar | mzy,
|  | SkScalar | mzz,
|  | SkScalar | mzt,
|  | SkScalar | mwx,
|  | SkScalar | mwy,
|  | SkScalar | mwz,
|  | SkScalar | mwt
| ) |  |
| override

Definition at line 677 of file dl_dispatcher.cc.

692 {
693 // The order of arguments is row-major but Impeller matrices are
694 // column-major.
695 // clang-format off
696 auto transform = Matrix{
697 mxx, myx, mzx, mwx,
698 mxy, myy, mzy, mwy,
699 mxz, myz, mzz, mwz,
700 mxt, myt, mzt, mwt
701 };
702 // clang-format on
703 canvas_.Transform(transform);
704 }

References impeller::Canvas::Transform().

Referenced by impeller::testing::TEST_P(), and transform2DAffine().

## ◆ transformReset()

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

Definition at line 707 of file dl_dispatcher.cc.

707 {
708 canvas_.ResetTransform();
709 canvas_.Transform(initial_matrix_);
710 }

References impeller::Canvas::ResetTransform(), and impeller::Canvas::Transform().

## ◆ translate()

void impeller::DlDispatcher::translate | ( | SkScalar | tx,
|  | SkScalar | ty
| ) |  |
| override

Definition at line 640 of file dl_dispatcher.cc.

640 {
641 canvas_.Translate({tx, ty, 0.0});
642 }

References impeller::Canvas::Translate().

Referenced by impeller::testing::TEST_P().

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

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

impeller::Paint::stroke_cap
Cap stroke_cap
Definition: paint.h:56
impeller::Matrix::HasPerspective
constexpr bool HasPerspective() const
Definition: matrix.h:318
impeller::Canvas::DrawPoints
void DrawPoints(std::vector< Point > points, Scalar radius, const Paint &paint, PointStyle point_style)
Definition: canvas.cc:563
impeller::Canvas::EndRecordingAsPicture
Picture EndRecordingAsPicture()
Definition: canvas.cc:657
impeller::Canvas::ClipOval
void ClipOval(const Rect &bounds, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition: canvas.cc:450
impeller::ColorSource::Type::kScene
@ kScene
impeller::ColorSource::Type::kLinearGradient
@ kLinearGradient
impeller::ToClipOperation
static Entity::ClipOperation ToClipOperation(flutter::DlCanvas::ClipOp clip_op)
Definition: dl_dispatcher.cc:712
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:368
impeller::DlDispatcher::drawImageRect
void drawImageRect(const sk_sp< flutter::DlImage > image, const SkRect &src, const SkRect &dst, flutter::DlImageSampling sampling, bool render_with_attributes, SrcRectConstraint constraint) override
Definition: dl_dispatcher.cc:934
impeller::skia_conversions::ToPoints
std::vector< Point > ToPoints(const SkPoint points[], int count)
Definition: skia_conversions.cc:31
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::Canvas::RestoreToCount
void RestoreToCount(size_t count)
Definition: canvas.cc:242
impeller::Canvas::DrawPath
void DrawPath(Path path, const Paint &paint)
Definition: canvas.cc:250
impeller::ColorSource::Type::kRadialGradient
@ kRadialGradient
impeller::Paint::Style::kStroke
@ kStroke
impeller::skia_conversions::ConvertStops
void ConvertStops(const flutter::DlGradientColorSourceBase *gradient, std::vector< Color > &colors, std::vector< float > &stops)
Convert display list colors + stops into impeller colors and stops, taking care to ensure that the st...
Definition: skia_conversions.cc:198
impeller::ColorSource::MakeLinearGradient
static ColorSource MakeLinearGradient(Point start_point, Point end_point, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
Definition: color_source.cc:45
impeller::FillType::kOdd
@ kOdd
impeller::skia_conversions::ToSize
Size ToSize(const SkPoint &point)
Definition: skia_conversions.cc:144
impeller::Canvas::Skew
void Skew(Scalar sx, Scalar sy)
Definition: canvas.cc:230
impeller::ToImageFilter
static std::shared_ptr< ImageFilter > ToImageFilter(const flutter::DlImageFilter *filter)
Definition: dl_dispatcher.cc:525
impeller::Paint::color
Color color
Definition: paint.h:51
impeller::Canvas::DrawTextFrame
void DrawTextFrame(const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint)
Definition: canvas.cc:702
impeller::PointStyle::kRound
@ kRound
Points are drawn as squares.
impeller::Vector2
Point Vector2
Definition: point.h:312
impeller::Canvas::ResetTransform
void ResetTransform()
Definition: canvas.cc:197
impeller::Canvas::DrawVertices
void DrawVertices(const std::shared_ptr< VerticesGeometry > &vertices, BlendMode blend_mode, const Paint &paint)
Definition: canvas.cc:746
impeller::DlDispatcher::transformFullPerspective
void transformFullPerspective(SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt) override
Definition: dl_dispatcher.cc:677
impeller::skia_conversions::ToRects
std::vector< Rect > ToRects(const SkRect tex[], int count)
Definition: skia_conversions.cc:23
impeller::MakeVertices
std::shared_ptr< impeller::VerticesGeometry > MakeVertices(const flutter::DlVertices *vertices)
Definition: dl_vertices_geometry.cc:31
impeller::skia_conversions::ToColor
Color ToColor(const flutter::DlColor &color)
Definition: skia_conversions.cc:148
impeller::ColorSource::MakeSweepGradient
static ColorSource MakeSweepGradient(Point center, Degrees start_angle, Degrees end_angle, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
Definition: color_source.cc:138
impeller::ColorSource::MakeColor
static ColorSource MakeColor()
Definition: color_source.cc:41
impeller::ColorSource::MakeImage
static ColorSource MakeImage(std::shared_ptr< Texture > texture, Entity::TileMode x_tile_mode, Entity::TileMode y_tile_mode, SamplerDescriptor sampler_descriptor, Matrix effect_transform)
Definition: color_source.cc:163
impeller::FilterContents::BlurStyle::kNormal
@ kNormal
Blurred inside and outside.
impeller::Canvas::SaveLayer
void SaveLayer(const Paint &paint, std::optional< Rect > bounds=std::nullopt, const std::shared_ptr< ImageFilter > &backdrop_filter=nullptr)
Definition: canvas.cc:676
impeller::Cap::kButt
@ kButt
impeller::Matrix::MakeTranslation
static constexpr Matrix MakeTranslation(const Vector3 &t)
Definition: matrix.h:95
impeller::Canvas::DrawLine
void DrawLine(const Point &p0, const Point &p1, const Paint &paint)
Definition: canvas.cc:310
impeller::Paint::color_source
ColorSource color_source
Definition: paint.h:52
impeller::Canvas::DrawRect
void DrawRect(const Rect &rect, const Paint &paint)
Definition: canvas.cc:321
impeller::Canvas::GetCurrentTransform
const Matrix & GetCurrentTransform() const
Definition: canvas.cc:205
UNIMPLEMENTED
#define UNIMPLEMENTED
Definition: dl_dispatcher.cc:36
impeller::ToTileMode
static Entity::TileMode ToTileMode(flutter::DlTileMode tile_mode)
Definition: dl_dispatcher.cc:111
impeller::Join::kMiter
@ kMiter
impeller::Paint::stroke_miter
Scalar stroke_miter
Definition: paint.h:58
impeller::ToMatrix
static Matrix ToMatrix(const SkMatrix &m)
Definition: dl_dispatcher.cc:166
impeller::ToColors
static std::vector< Color > ToColors(const flutter::DlColor colors[], int count)
Definition: dl_dispatcher.cc:250
impeller::skia_conversions::ToRect
Rect ToRect(const SkRect &rect)
Definition: skia_conversions.cc:12
impeller::Paint::color_filter
std::shared_ptr< ColorFilter > color_filter
Definition: paint.h:64
impeller::Canvas::DrawImageRect
void DrawImageRect(const std::shared_ptr< Image > &image, Rect source, Rect dest, const Paint &paint, SamplerDescriptor sampler={})
Definition: canvas.cc:626
impeller::PointStyle::kSquare
@ kSquare
Points are drawn as circles.
impeller::Point
TPoint< Scalar > Point
Definition: point.h:308
impeller::Canvas::Scale
void Scale(const Vector2 &scale)
Definition: canvas.cc:222
impeller::Matrix::GetScale
constexpr Vector3 GetScale() const
Definition: matrix.h:303
impeller::ColorSource::MakeConicalGradient
static ColorSource MakeConicalGradient(Point center, Scalar radius, std::vector< Color > colors, std::vector< Scalar > stops, Point focus_center, Scalar focus_radius, Entity::TileMode tile_mode, Matrix effect_transform)
Definition: color_source.cc:74
impeller::Canvas::Save
void Save()
Definition: canvas.cc:132
impeller::ColorSource::Type::kRuntimeEffect
@ kRuntimeEffect
impeller::Paint::style
Style style
Definition: paint.h:59
impeller::Paint::Style::kFill
@ kFill
impeller::ToColorSourceType
static std::optional< ColorSource::Type > ToColorSourceType(flutter::DlColorSourceType type)
Definition: dl_dispatcher.cc:261
impeller::Canvas::DrawCircle
void DrawCircle(const Point &center, Scalar radius, const Paint &paint)
Definition: canvas.cc:395
impeller::ToStyle
static Paint::Style ToStyle(flutter::DlDrawStyle style)
Definition: dl_dispatcher.cc:182
impeller::Canvas::Restore
bool Restore()
Definition: canvas.cc:168
impeller::Canvas::DrawAtlas
void DrawAtlas(const std::shared_ptr< Image > &atlas, std::vector< Matrix > transforms, std::vector< Rect > texture_coordinates, std::vector< Color > colors, BlendMode blend_mode, SamplerDescriptor sampler, std::optional< Rect > cull_rect, const Paint &paint)
Definition: canvas.cc:806
impeller::Canvas::DrawPaint
void DrawPaint(const Paint &paint)
Definition: canvas.cc:260
impeller::Rect
TRect< Scalar > Rect
Definition: rect.h:488
impeller::ToBlurStyle
static FilterContents::BlurStyle ToBlurStyle(flutter::DlBlurStyle blur_style)
Definition: dl_dispatcher.cc:492
impeller::Join::kRound
@ kRound
impeller::Canvas::GetSaveCount
size_t GetSaveCount() const
Definition: canvas.cc:238
impeller::Vector3::y
Scalar y
Definition: vector.h:24
impeller::skia_conversions::ToPoint
Point ToPoint(const SkPoint &point)
Definition: skia_conversions.cc:140
impeller::ColorSource::MakeRadialGradient
static ColorSource MakeRadialGradient(Point center, Scalar radius, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
Definition: color_source.cc:108
impeller::Canvas::ClipRRect
void ClipRRect(const Rect &rect, const Size &corner_radii, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition: canvas.cc:470
impeller::Canvas::PreConcat
void PreConcat(const Matrix &transform)
Definition: canvas.cc:193
impeller::Join::kBevel
@ kBevel
impeller::ColorSource::Type::kImage
@ kImage
impeller::ColorSource::MakeRuntimeEffect
static ColorSource MakeRuntimeEffect(std::shared_ptr< RuntimeStage > runtime_stage, std::shared_ptr< std::vector< uint8_t >> uniform_data, std::vector< RuntimeEffectContents::TextureInput > texture_inputs)
Definition: color_source.cc:193
impeller::Canvas::DrawOval
void DrawOval(const Rect &rect, const Paint &paint)
Definition: canvas.cc:341
impeller::Canvas::Rotate
void Rotate(Radians radians)
Definition: canvas.cc:234
impeller::ColorSource::Type::kConicalGradient
@ kConicalGradient
impeller::TPoint< Scalar >
impeller::Canvas::Transform
void Transform(const Matrix &transform)
Definition: canvas.cc:201
impeller::skia_conversions::ToRSXForms
std::vector< Matrix > ToRSXForms(const SkRSXform xform[], int count)
Definition: skia_conversions.cc:157
impeller::Paint::invert_colors
bool invert_colors
Definition: paint.h:61
impeller::DlDispatcher::setColor
void setColor(flutter::DlColor color) override
Definition: dl_dispatcher.cc:201
impeller::Canvas::GetCurrentLocalCullingBounds
const std::optional< Rect > GetCurrentLocalCullingBounds() const
Definition: canvas.cc:209
impeller::ToBlendMode
static BlendMode ToBlendMode(flutter::DlBlendMode mode)
Definition: dl_dispatcher.cc:47
impeller::Canvas::ClipRect
void ClipRect(const Rect &rect, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition: canvas.cc:429
impeller::ToSamplerDescriptor
static impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlImageSampling options)
Definition: dl_dispatcher.cc:124
impeller::TRect< Scalar >::MakeLTRB
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
Definition: rect.h:27
impeller::ToColorFilter
static std::shared_ptr< ColorFilter > ToColorFilter(const flutter::DlColorFilter *filter)
Definition: dl_dispatcher.cc:445
impeller::Canvas::ClipPath
void ClipPath(Path path, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition: canvas.cc:419
impeller::ColorSource::Type::kSweepGradient
@ kSweepGradient
impeller::Paint::mask_blur_descriptor
std::optional< MaskBlurDescriptor > mask_blur_descriptor
Definition: paint.h:65
impeller::Paint::stroke_width
Scalar stroke_width
Definition: paint.h:55
impeller::skia_conversions::ToPath
Path ToPath(const SkPath &path, Point shift)
Definition: skia_conversions.cc:49
impeller::ColorSource::Type::kColor
@ kColor
impeller::Paint::blend_mode
BlendMode blend_mode
Definition: paint.h:60
impeller::Paint::image_filter
std::shared_ptr< ImageFilter > image_filter
Definition: paint.h:63
impeller::Paint::stroke_join
Join stroke_join
Definition: paint.h:57
impeller::Canvas::Translate
void Translate(const Vector3 &offset)
Definition: canvas.cc:218