Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
impeller::DlDispatcherBase Class Referenceabstract

#include <dl_dispatcher.h>

Inheritance diagram for impeller::DlDispatcherBase:
flutter::DlOpReceiver impeller::DlDispatcher impeller::ExperimentalDlDispatcher

Public Member Functions

Picture EndRecordingAsPicture ()
 
bool PrefersImpellerPaths () const override
 
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 (uint32_t total_content_depth) override
 
void saveLayer (const SkRect &bounds, const flutter::SaveLayerOptions &options, uint32_t total_content_depth, 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 clipPath (const CacheablePath &cache, 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 drawPath (const CacheablePath &cache) 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
 
void drawShadow (const CacheablePath &cache, const flutter::DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr) override
 
virtual CanvasGetCanvas ()=0
 
- Public Member Functions inherited from flutter::DlOpReceiver
virtual void save ()=0
 
virtual void saveLayer (const SkRect &bounds, const SaveLayerOptions options, const DlImageFilter *backdrop=nullptr)=0
 
virtual void saveLayer (const SkRect *bounds, const SaveLayerOptions options, const DlImageFilter *backdrop=nullptr) final
 
virtual void drawTextFrame (const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y)=0
 

Additional Inherited Members

- Static Public Attributes inherited from flutter::DlOpReceiver
static constexpr int kMaxDrawPointsCount = ((1 << 29) - 1)
 
- Protected Types inherited from flutter::DlOpReceiver
using ClipOp = DlCanvas::ClipOp
 
using PointMode = DlCanvas::PointMode
 
using SrcRectConstraint = DlCanvas::SrcRectConstraint
 

Detailed Description

Definition at line 18 of file dl_dispatcher.h.

Member Function Documentation

◆ clipPath() [1/2]

void impeller::DlDispatcherBase::clipPath ( const CacheablePath cache,
ClipOp  clip_op,
bool  is_aa 
)
overridevirtual

Reimplemented from flutter::DlOpReceiver.

Definition at line 757 of file dl_dispatcher.cc.

759 {
760 auto clip_op = ToClipOperation(sk_op);
761
762 SkRect rect;
763 if (cache.sk_path.isRect(&rect)) {
765 } else if (cache.sk_path.isOval(&rect)) {
767 } else {
769 if (cache.sk_path.isRRect(&rrect) && rrect.isSimple()) {
772 clip_op);
773 } else {
774 GetCanvas().ClipPath(GetOrCachePath(cache), clip_op);
775 }
776 }
777}
SkVector getSimpleRadii() const
Definition SkRRect.h:111
const SkRect & rect() const
Definition SkRRect.h:264
bool isSimple() const
Definition SkRRect.h:86
void ClipPath(const Path &path, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition canvas.cc:587
void ClipRRect(const Rect &rect, const Size &corner_radii, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition canvas.cc:638
void ClipRect(const Rect &rect, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition canvas.cc:597
void ClipOval(const Rect &bounds, Entity::ClipOperation clip_op=Entity::ClipOperation::kIntersect)
Definition canvas.cc:618
virtual Canvas & GetCanvas()=0
SkRRect rrect
Definition SkRecords.h:232
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
Definition switches.h:191
Size ToSize(const SkPoint &point)
Rect ToRect(const SkRect &rect)
static Entity::ClipOperation ToClipOperation(flutter::DlCanvas::ClipOp clip_op)

◆ clipPath() [2/2]

void impeller::DlDispatcherBase::clipPath ( const SkPath path,
ClipOp  clip_op,
bool  is_aa 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 745 of file dl_dispatcher.cc.

745 {
747}
#define UNIMPLEMENTED

◆ clipRect()

void impeller::DlDispatcherBase::clipRect ( const SkRect rect,
ClipOp  clip_op,
bool  is_aa 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 719 of file dl_dispatcher.cc.

721 {
723 ToClipOperation(clip_op));
724}

◆ clipRRect()

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

Implements flutter::DlOpReceiver.

Definition at line 727 of file dl_dispatcher.cc.

729 {
730 auto clip_op = ToClipOperation(sk_op);
731 if (rrect.isRect()) {
733 } else if (rrect.isOval()) {
735 } else if (rrect.isSimple()) {
738 clip_op);
739 } else {
741 }
742}
bool isOval() const
Definition SkRRect.h:85
bool isRect() const
Definition SkRRect.h:84
Path ToPath(const SkPath &path, Point shift)

◆ drawArc()

void impeller::DlDispatcherBase::drawArc ( const SkRect oval_bounds,
SkScalar  start_degrees,
SkScalar  sweep_degrees,
bool  use_center 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 872 of file dl_dispatcher.cc.

875 {
876 PathBuilder builder;
877 builder.AddArc(skia_conversions::ToRect(oval_bounds), Degrees(start_degrees),
878 Degrees(sweep_degrees), use_center);
879 GetCanvas().DrawPath(builder.TakePath(), paint_);
880}
void DrawPath(const Path &path, const Paint &paint)
Definition canvas.cc:341

◆ drawAtlas()

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

Implements flutter::DlOpReceiver.

Definition at line 987 of file dl_dispatcher.cc.

995 {
996 GetCanvas().DrawAtlas(std::make_shared<Image>(atlas->impeller_texture()),
999 ToColors(colors, count), ToBlendMode(mode),
1000 ToSamplerDescriptor(sampling),
1001 skia_conversions::ToRect(cull_rect), paint_);
1002}
int count
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:1003
sk_sp< const SkImage > atlas
Definition SkRecords.h:331
std::vector< Rect > ToRects(const SkRect tex[], int count)
std::vector< Matrix > ToRSXForms(const SkRSXform xform[], int count)
static BlendMode ToBlendMode(flutter::DlBlendMode mode)
static impeller::SamplerDescriptor ToSamplerDescriptor(const flutter::DlImageSampling options)
static std::vector< Color > ToColors(const flutter::DlColor colors[], int count)

◆ drawCircle()

void impeller::DlDispatcherBase::drawCircle ( const SkPoint center,
SkScalar  radius 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 810 of file dl_dispatcher.cc.

810 {
812}
static SkScalar center(float pos0, float pos1)
void DrawCircle(const Point &center, Scalar radius, const Paint &paint)
Definition canvas.cc:564
Point ToPoint(const SkPoint &point)

◆ drawColor()

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

Implements flutter::DlOpReceiver.

Definition at line 780 of file dl_dispatcher.cc.

781 {
782 Paint paint;
784 paint.blend_mode = ToBlendMode(dl_mode);
786}
SkColor4f color
void DrawPaint(const Paint &paint)
Definition canvas.cc:350
const Paint & paint
Color ToColor(const flutter::DlColor &color)

◆ drawDisplayList()

void impeller::DlDispatcherBase::drawDisplayList ( const sk_sp< flutter::DisplayList display_list,
SkScalar  opacity 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 1005 of file dl_dispatcher.cc.

1007 {
1008 // Save all values that must remain untouched after the operation.
1009 Paint saved_paint = paint_;
1010 Matrix saved_initial_matrix = initial_matrix_;
1011
1012 // Establish a new baseline for interpreting the new DL.
1013 // Matrix and clip are left untouched, the current
1014 // transform is saved as the new base matrix, and paint
1015 // values are reset to defaults.
1016 initial_matrix_ = GetCanvas().GetCurrentTransform();
1017 paint_ = Paint();
1018
1019 // Handle passed opacity in the most brute-force way by using
1020 // a SaveLayer. If the display_list is able to inherit the
1021 // opacity, this could also be handled by modulating all of its
1022 // attribute settings (for example, color), by the indicated
1023 // opacity.
1024 int restore_count = GetCanvas().GetSaveCount();
1025 if (opacity < SK_Scalar1) {
1026 Paint save_paint;
1027 save_paint.color = Color(0, 0, 0, opacity);
1029 save_paint, skia_conversions::ToRect(display_list->bounds()), nullptr,
1031 } else {
1032 // The display list may alter the clip, which must be restored to the
1033 // current clip at the end of playback.
1034 GetCanvas().Save(display_list->total_depth());
1035 }
1036
1037 // TODO(131445): Remove this restriction if we can correctly cull with
1038 // perspective transforms.
1039 if (display_list->has_rtree() && !initial_matrix_.HasPerspective()) {
1040 // The canvas remembers the screen-space culling bounds clipped by
1041 // the surface and the history of clip calls. DisplayList can cull
1042 // the ops based on a rectangle expressed in its "destination bounds"
1043 // so we need the canvas to transform those into the current local
1044 // coordinate space into which the DisplayList will be rendered.
1045 auto cull_bounds = GetCanvas().GetCurrentLocalCullingBounds();
1046 if (cull_bounds.has_value()) {
1047 Rect cull_rect = cull_bounds.value();
1048 display_list->Dispatch(
1049 *this, SkRect::MakeLTRB(cull_rect.GetLeft(), cull_rect.GetTop(),
1050 cull_rect.GetRight(), cull_rect.GetBottom()));
1051 } else {
1052 display_list->Dispatch(*this);
1053 }
1054 } else {
1055 display_list->Dispatch(*this);
1056 }
1057
1058 // Restore all saved state back to what it was before we interpreted
1059 // the display_list
1060 GetCanvas().RestoreToCount(restore_count);
1061 initial_matrix_ = saved_initial_matrix;
1062 paint_ = saved_paint;
1063}
#define SK_Scalar1
Definition SkScalar.h:18
const SkRect & bounds() const
uint32_t total_depth() const
bool has_rtree() const
void Dispatch(DlOpReceiver &ctx) const
const Matrix & GetCurrentTransform() const
Definition canvas.cc:296
virtual void SaveLayer(const Paint &paint, std::optional< Rect > bounds=std::nullopt, const std::shared_ptr< ImageFilter > &backdrop_filter=nullptr, ContentBoundsPromise bounds_promise=ContentBoundsPromise::kUnknown, uint32_t total_content_depth=kMaxDepth)
Definition canvas.cc:839
void RestoreToCount(size_t count)
Definition canvas.cc:333
size_t GetSaveCount() const
Definition canvas.cc:329
const std::optional< Rect > GetCurrentLocalCullingBounds() const
Definition canvas.cc:300
virtual void Save(uint32_t total_content_depth=kMaxDepth)
Definition canvas.cc:184
TRect< Scalar > Rect
Definition rect.h:746
@ kContainsContents
The caller claims the bounds are a reasonably tight estimate of the coverage of the contents and shou...
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition SkRect.h:646
constexpr bool HasPerspective() const
Definition matrix.h:330

◆ drawDRRect()

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

Implements flutter::DlOpReceiver.

Definition at line 826 of file dl_dispatcher.cc.

826 {
827 PathBuilder builder;
828 builder.AddPath(skia_conversions::ToPath(outer));
829 builder.AddPath(skia_conversions::ToPath(inner));
830 GetCanvas().DrawPath(builder.TakePath(FillType::kOdd), paint_);
831}

◆ drawImage()

void impeller::DlDispatcherBase::drawImage ( const sk_sp< flutter::DlImage image,
const SkPoint  point,
flutter::DlImageSampling  sampling,
bool  render_with_attributes 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 928 of file dl_dispatcher.cc.

931 {
932 if (!image) {
933 return;
934 }
935
936 auto texture = image->impeller_texture();
937 if (!texture) {
938 return;
939 }
940
941 const auto size = texture->GetSize();
942 const auto src = SkRect::MakeWH(size.width, size.height);
943 const auto dest =
944 SkRect::MakeXYWH(point.fX, point.fY, size.width, size.height);
945
946 drawImageRect(image, // image
947 src, // source rect
948 dest, // destination rect
949 sampling, // sampling options
950 render_with_attributes, // render with attributes
951 SrcRectConstraint::kStrict // constraint
952 );
953}
void drawImageRect(const sk_sp< flutter::DlImage > image, const SkRect &src, const SkRect &dst, flutter::DlImageSampling sampling, bool render_with_attributes, SrcRectConstraint constraint) override
sk_sp< SkImage > image
Definition examples.cpp:29
FlTexture * texture
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259
dest
Definition zip.py:79
float fX
x-axis value
float fY
y-axis value
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition SkRect.h:659
static constexpr SkRect MakeWH(float w, float h)
Definition SkRect.h:609

◆ drawImageNine()

void impeller::DlDispatcherBase::drawImageNine ( const sk_sp< flutter::DlImage image,
const SkIRect center,
const SkRect dst,
flutter::DlFilterMode  filter,
bool  render_with_attributes 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 973 of file dl_dispatcher.cc.

977 {
978 NinePatchConverter converter = {};
979 converter.DrawNinePatch(
980 std::make_shared<Image>(image->impeller_texture()),
981 Rect::MakeLTRB(center.fLeft, center.fTop, center.fRight, center.fBottom),
983 &paint_);
984}
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
Definition rect.h:129

◆ drawImageRect()

void impeller::DlDispatcherBase::drawImageRect ( const sk_sp< flutter::DlImage image,
const SkRect src,
const SkRect dst,
flutter::DlImageSampling  sampling,
bool  render_with_attributes,
SrcRectConstraint  constraint = SrcRectConstraint::kFast 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 956 of file dl_dispatcher.cc.

962 {
964 std::make_shared<Image>(image->impeller_texture()), // image
965 skia_conversions::ToRect(src), // source rect
966 skia_conversions::ToRect(dst), // destination rect
967 render_with_attributes ? paint_ : Paint(), // paint
968 ToSamplerDescriptor(sampling) // sampling
969 );
970}
void DrawImageRect(const std::shared_ptr< Image > &image, Rect source, Rect dest, const Paint &paint, SamplerDescriptor sampler={}, SourceRectConstraint src_rect_constraint=SourceRectConstraint::kFast)
Definition canvas.cc:764
SkSamplingOptions sampling
Definition SkRecords.h:337

◆ drawLine()

void impeller::DlDispatcherBase::drawLine ( const SkPoint p0,
const SkPoint p1 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 794 of file dl_dispatcher.cc.

794 {
796 skia_conversions::ToPoint(p1), paint_);
797}
void DrawLine(const Point &p0, const Point &p1, const Paint &paint)
Definition canvas.cc:483

◆ drawOval()

void impeller::DlDispatcherBase::drawOval ( const SkRect bounds)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 805 of file dl_dispatcher.cc.

805 {
807}
void DrawOval(const Rect &rect, const Paint &paint)
Definition canvas.cc:512

◆ drawPaint()

void impeller::DlDispatcherBase::drawPaint ( )
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 789 of file dl_dispatcher.cc.

789 {
790 GetCanvas().DrawPaint(paint_);
791}

◆ drawPath() [1/2]

void impeller::DlDispatcherBase::drawPath ( const CacheablePath cache)
overridevirtual

Reimplemented from flutter::DlOpReceiver.

Definition at line 839 of file dl_dispatcher.cc.

839 {
840 SimplifyOrDrawPath(GetCanvas(), cache, paint_);
841}

◆ drawPath() [2/2]

void impeller::DlDispatcherBase::drawPath ( const SkPath path)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 834 of file dl_dispatcher.cc.

834 {
836}

◆ drawPoints()

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

Implements flutter::DlOpReceiver.

Definition at line 883 of file dl_dispatcher.cc.

885 {
886 Paint paint = paint_;
888 switch (mode) {
890 // Cap::kButt is also treated as a square.
891 auto point_style = paint.stroke_cap == Cap::kRound ? PointStyle::kRound
893 auto radius = paint.stroke_width;
894 if (radius > 0) {
895 radius /= 2.0;
896 }
898 paint, point_style);
899 } break;
901 for (uint32_t i = 1; i < count; i += 2) {
904 GetCanvas().DrawLine(p0, p1, paint);
905 }
906 break;
908 if (count > 1) {
910 for (uint32_t i = 1; i < count; i++) {
912 GetCanvas().DrawLine(p0, p1, paint);
913 p0 = p1;
914 }
915 }
916 break;
917 }
918}
static const int points[]
@ kLines
draw each separate pair of points as a line segment
@ kPolygon
draw each pair of overlapping points as a line segment
@ kPoints
draw each point separately
void DrawPoints(std::vector< Point > points, Scalar radius, const Paint &paint, PointStyle point_style)
Definition canvas.cc:731
std::vector< Point > ToPoints(const SkPoint points[], int count)
@ kRound
Points are drawn as squares.
@ kSquare
Points are drawn as circles.
TPoint< Scalar > Point
Definition point.h:316

◆ drawRect()

void impeller::DlDispatcherBase::drawRect ( const SkRect rect)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 800 of file dl_dispatcher.cc.

800 {
802}
void DrawRect(const Rect &rect, const Paint &paint)
Definition canvas.cc:493

◆ drawRRect()

void impeller::DlDispatcherBase::drawRRect ( const SkRRect rrect)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 815 of file dl_dispatcher.cc.

815 {
816 if (rrect.isSimple()) {
819 paint_);
820 } else {
822 }
823}
void DrawRRect(const Rect &rect, const Size &corner_radii, const Paint &paint)
Definition canvas.cc:538

◆ drawShadow() [1/2]

void impeller::DlDispatcherBase::drawShadow ( const CacheablePath cache,
const flutter::DlColor  color,
const SkScalar  elevation,
bool  transparent_occluder,
SkScalar  dpr 
)
overridevirtual

Reimplemented from flutter::DlOpReceiver.

Definition at line 1094 of file dl_dispatcher.cc.

1098 {
1099 Color spot_color = skia_conversions::ToColor(color);
1100 spot_color.alpha *= 0.25;
1101
1102 // Compute the spot color -- ported from SkShadowUtils::ComputeTonalColors.
1103 {
1104 Scalar max =
1105 std::max(std::max(spot_color.red, spot_color.green), spot_color.blue);
1106 Scalar min =
1107 std::min(std::min(spot_color.red, spot_color.green), spot_color.blue);
1108 Scalar luminance = (min + max) * 0.5;
1109
1110 Scalar alpha_adjust =
1111 (2.6f + (-2.66667f + 1.06667f * spot_color.alpha) * spot_color.alpha) *
1112 spot_color.alpha;
1113 Scalar color_alpha =
1114 (3.544762f + (-4.891428f + 2.3466f * luminance) * luminance) *
1115 luminance;
1116 color_alpha = std::clamp(alpha_adjust * color_alpha, 0.0f, 1.0f);
1117
1118 Scalar greyscale_alpha =
1119 std::clamp(spot_color.alpha * (1 - 0.4f * luminance), 0.0f, 1.0f);
1120
1121 Scalar color_scale = color_alpha * (1 - greyscale_alpha);
1122 Scalar tonal_alpha = color_scale + greyscale_alpha;
1123 Scalar unpremul_scale = tonal_alpha != 0 ? color_scale / tonal_alpha : 0;
1124 spot_color = Color(unpremul_scale * spot_color.red,
1125 unpremul_scale * spot_color.green,
1126 unpremul_scale * spot_color.blue, tonal_alpha);
1127 }
1128
1129 Vector3 light_position(0, -1, 1);
1130 Scalar occluder_z = dpr * elevation;
1131
1132 constexpr Scalar kLightRadius = 800 / 600; // Light radius / light height
1133
1134 Paint paint;
1135 paint.style = Paint::Style::kFill;
1136 paint.color = spot_color;
1137 paint.mask_blur_descriptor = Paint::MaskBlurDescriptor{
1139 .sigma = Radius{kLightRadius * occluder_z /
1141 };
1142
1143 GetCanvas().Save(1u);
1145 Matrix::MakeTranslation(Vector2(0, -occluder_z * light_position.y)));
1146
1147 SimplifyOrDrawPath(GetCanvas(), cache, paint);
1148
1149 GetCanvas().Restore();
1150}
virtual bool Restore()
Definition canvas.cc:257
void PreConcat(const Matrix &transform)
Definition canvas.cc:284
@ kNormal
Blurred inside and outside.
static float max(float r, float g, float b)
Definition hsl.cpp:49
static float min(float r, float g, float b)
Definition hsl.cpp:48
Point Vector2
Definition point.h:320
float Scalar
Definition scalar.h:18
static constexpr Matrix MakeTranslation(const Vector3 &t)
Definition matrix.h:95
constexpr Vector3 GetScale() const
Definition matrix.h:311

◆ drawShadow() [2/2]

void impeller::DlDispatcherBase::drawShadow ( const SkPath path,
const flutter::DlColor  color,
const SkScalar  elevation,
bool  transparent_occluder,
SkScalar  dpr 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 1085 of file dl_dispatcher.cc.

1089 {
1091}

◆ drawTextBlob()

void impeller::DlDispatcherBase::drawTextBlob ( const sk_sp< SkTextBlob blob,
SkScalar  x,
SkScalar  y 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 1066 of file dl_dispatcher.cc.

1068 {
1069 // When running with Impeller enabled Skia text blobs are converted to
1070 // Impeller text frames in paragraph_skia.cc
1072}

◆ drawTextFrame()

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

Definition at line 1074 of file dl_dispatcher.cc.

1077 {
1078 GetCanvas().DrawTextFrame(text_frame, //
1079 impeller::Point{x, y}, //
1080 paint_ //
1081 );
1082}
virtual void DrawTextFrame(const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint)
Definition canvas.cc:875
double y
double x

◆ drawVertices()

void impeller::DlDispatcherBase::drawVertices ( const flutter::DlVertices vertices,
flutter::DlBlendMode  dl_mode 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 921 of file dl_dispatcher.cc.

922 {
923 GetCanvas().DrawVertices(MakeVertices(vertices), ToBlendMode(dl_mode),
924 paint_);
925}
void DrawVertices(const std::shared_ptr< VerticesGeometry > &vertices, BlendMode blend_mode, const Paint &paint)
Definition canvas.cc:916
std::shared_ptr< impeller::VerticesGeometry > MakeVertices(const flutter::DlVertices *vertices)

◆ EndRecordingAsPicture()

Picture impeller::DlDispatcherBase::EndRecordingAsPicture ( )

Definition at line 1152 of file dl_dispatcher.cc.

1152 {
1153 TRACE_EVENT0("impeller", "DisplayListDispatcher::EndRecordingAsPicture");
1155}
Picture EndRecordingAsPicture()
Definition canvas.cc:802
#define TRACE_EVENT0(category_group, name)

◆ GetCanvas()

virtual Canvas & impeller::DlDispatcherBase::GetCanvas ( )
pure virtual

◆ PrefersImpellerPaths()

bool impeller::DlDispatcherBase::PrefersImpellerPaths ( ) const
inlineoverridevirtual

Reimplemented from flutter::DlOpReceiver.

Definition at line 23 of file dl_dispatcher.h.

23{ return true; }

◆ restore()

void impeller::DlDispatcherBase::restore ( )
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 631 of file dl_dispatcher.cc.

631 {
632 GetCanvas().Restore();
633}

◆ rotate()

void impeller::DlDispatcherBase::rotate ( SkScalar  degrees)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 646 of file dl_dispatcher.cc.

646 {
647 GetCanvas().Rotate(Degrees{degrees});
648}
void Rotate(Radians radians)
Definition canvas.cc:325

◆ save()

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

Reimplemented from flutter::DlOpReceiver.

Reimplemented in impeller::ExperimentalDlDispatcher.

Definition at line 613 of file dl_dispatcher.cc.

613 {
614 GetCanvas().Save(total_content_depth);
615}

◆ saveLayer()

void impeller::DlDispatcherBase::saveLayer ( const SkRect bounds,
const flutter::SaveLayerOptions options,
uint32_t  total_content_depth,
const flutter::DlImageFilter backdrop 
)
overridevirtual

Reimplemented from flutter::DlOpReceiver.

Reimplemented in impeller::ExperimentalDlDispatcher.

Definition at line 618 of file dl_dispatcher.cc.

621 {
622 auto paint = options.renders_with_attributes() ? paint_ : Paint{};
623 auto promise = options.content_is_clipped()
627 ToImageFilter(backdrop), promise, total_content_depth);
628}
const char * options
static std::shared_ptr< ImageFilter > ToImageFilter(const flutter::DlImageFilter *filter)
@ kMayClipContents
The caller claims the bounds are a subset of an estimate of the reasonably tight bounds but likely cl...

◆ scale()

void impeller::DlDispatcherBase::scale ( SkScalar  sx,
SkScalar  sy 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 641 of file dl_dispatcher.cc.

641 {
642 GetCanvas().Scale({sx, sy, 1.0});
643}
void Scale(const Vector2 &scale)
Definition canvas.cc:313

◆ setAntiAlias()

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

Implements flutter::DlOpReceiver.

Definition at line 170 of file dl_dispatcher.cc.

170 {
171 // Nothing to do because AA is implicit.
172}

◆ setBlendMode()

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

Implements flutter::DlOpReceiver.

Definition at line 474 of file dl_dispatcher.cc.

474 {
475 paint_.blend_mode = ToBlendMode(dl_mode);
476}
BlendMode blend_mode
Definition paint.h:64

◆ setColor()

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

Implements flutter::DlOpReceiver.

Definition at line 193 of file dl_dispatcher.cc.

193 {
194 paint_.color = {
195 color.getRedF(),
196 color.getGreenF(),
197 color.getBlueF(),
198 color.getAlphaF(),
199 };
200}
Color color
Definition paint.h:55

◆ setColorFilter()

void impeller::DlDispatcherBase::setColorFilter ( const flutter::DlColorFilter filter)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 464 of file dl_dispatcher.cc.

464 {
465 paint_.color_filter = ToColorFilter(filter);
466}
static std::shared_ptr< ColorFilter > ToColorFilter(const flutter::DlColorFilter *filter)
std::shared_ptr< ColorFilter > color_filter
Definition paint.h:68

◆ setColorSource()

void impeller::DlDispatcherBase::setColorSource ( const flutter::DlColorSource source)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 278 of file dl_dispatcher.cc.

278 {
279 if (!source) {
281 return;
282 }
283
284 std::optional<ColorSource::Type> type = ToColorSourceType(source->type());
285
286 if (!type.has_value()) {
287 FML_LOG(ERROR) << "Requested ColorSourceType::kUnknown";
289 return;
290 }
291
292 switch (type.value()) {
294 const flutter::DlColorColorSource* color = source->asColor();
295
297 setColor(color->color());
299 return;
300 }
303 source->asLinearGradient();
305 auto start_point = skia_conversions::ToPoint(linear->start_point());
306 auto end_point = skia_conversions::ToPoint(linear->end_point());
307 std::vector<Color> colors;
308 std::vector<float> stops;
310
311 auto tile_mode = ToTileMode(linear->tile_mode());
312 auto matrix = ToMatrix(linear->matrix());
313
315 start_point, end_point, std::move(colors), std::move(stops),
316 tile_mode, matrix);
317 return;
318 }
320 const flutter::DlConicalGradientColorSource* conical_gradient =
321 source->asConicalGradient();
322 FML_DCHECK(conical_gradient);
323 Point center = skia_conversions::ToPoint(conical_gradient->end_center());
324 SkScalar radius = conical_gradient->end_radius();
325 Point focus_center =
326 skia_conversions::ToPoint(conical_gradient->start_center());
327 SkScalar focus_radius = conical_gradient->start_radius();
328 std::vector<Color> colors;
329 std::vector<float> stops;
330 skia_conversions::ConvertStops(conical_gradient, colors, stops);
331
332 auto tile_mode = ToTileMode(conical_gradient->tile_mode());
333 auto matrix = ToMatrix(conical_gradient->matrix());
334
336 center, radius, std::move(colors), std::move(stops), focus_center,
337 focus_radius, tile_mode, matrix);
338 return;
339 }
341 const flutter::DlRadialGradientColorSource* radialGradient =
342 source->asRadialGradient();
343 FML_DCHECK(radialGradient);
344 auto center = skia_conversions::ToPoint(radialGradient->center());
345 auto radius = radialGradient->radius();
346 std::vector<Color> colors;
347 std::vector<float> stops;
348 skia_conversions::ConvertStops(radialGradient, colors, stops);
349
350 auto tile_mode = ToTileMode(radialGradient->tile_mode());
351 auto matrix = ToMatrix(radialGradient->matrix());
352 paint_.color_source =
353 ColorSource::MakeRadialGradient(center, radius, std::move(colors),
354 std::move(stops), tile_mode, matrix);
355 return;
356 }
358 const flutter::DlSweepGradientColorSource* sweepGradient =
359 source->asSweepGradient();
360 FML_DCHECK(sweepGradient);
361
362 auto center = skia_conversions::ToPoint(sweepGradient->center());
363 auto start_angle = Degrees(sweepGradient->start());
364 auto end_angle = Degrees(sweepGradient->end());
365 std::vector<Color> colors;
366 std::vector<float> stops;
367 skia_conversions::ConvertStops(sweepGradient, colors, stops);
368
369 auto tile_mode = ToTileMode(sweepGradient->tile_mode());
370 auto matrix = ToMatrix(sweepGradient->matrix());
372 center, start_angle, end_angle, std::move(colors), std::move(stops),
373 tile_mode, matrix);
374 return;
375 }
377 const flutter::DlImageColorSource* image_color_source = source->asImage();
378 FML_DCHECK(image_color_source &&
379 image_color_source->image()->impeller_texture());
380 auto texture = image_color_source->image()->impeller_texture();
381 auto x_tile_mode = ToTileMode(image_color_source->horizontal_tile_mode());
382 auto y_tile_mode = ToTileMode(image_color_source->vertical_tile_mode());
383 auto desc = ToSamplerDescriptor(image_color_source->sampling());
384 auto matrix = ToMatrix(image_color_source->matrix());
385 paint_.color_source = ColorSource::MakeImage(texture, x_tile_mode,
386 y_tile_mode, desc, matrix);
387 return;
388 }
390 const flutter::DlRuntimeEffectColorSource* runtime_effect_color_source =
391 source->asRuntimeEffect();
392 auto runtime_stage =
393 runtime_effect_color_source->runtime_effect()->runtime_stage();
394 auto uniform_data = runtime_effect_color_source->uniform_data();
395 auto samplers = runtime_effect_color_source->samplers();
396
397 std::vector<RuntimeEffectContents::TextureInput> texture_inputs;
398
399 for (auto& sampler : samplers) {
400 if (sampler == nullptr) {
401 return;
402 }
403 auto* image = sampler->asImage();
404 if (!sampler->asImage()) {
406 return;
407 }
408 FML_DCHECK(image->image()->impeller_texture());
409 texture_inputs.push_back({
410 .sampler_descriptor = ToSamplerDescriptor(image->sampling()),
411 .texture = image->image()->impeller_texture(),
412 });
413 }
414
416 runtime_stage, uniform_data, texture_inputs);
417 return;
418 }
420#ifdef IMPELLER_ENABLE_3D
421 const flutter::DlSceneColorSource* scene_color_source = source->asScene();
422 std::shared_ptr<scene::Node> scene_node =
423 scene_color_source->scene_node();
424 Matrix camera_transform = scene_color_source->camera_matrix();
425
426 paint_.color_source =
427 ColorSource::MakeScene(scene_node, camera_transform);
428#else // IMPELLER_ENABLE_3D
429 FML_LOG(ERROR) << "ColorSourceType::kScene can only be used if Impeller "
430 "Scene is enabled.";
431#endif // IMPELLER_ENABLE_3D
432 return;
433 }
434 }
435}
sk_sp< SkImage > asImage() const
Definition SkBitmap.cpp:645
DlImageSampling sampling() const
DlTileMode vertical_tile_mode() const
DlTileMode horizontal_tile_mode() const
sk_sp< const DlImage > image() const
const SkMatrix & matrix() const
const std::shared_ptr< std::vector< uint8_t > > uniform_data() const
const sk_sp< DlRuntimeEffect > runtime_effect() const
const std::vector< std::shared_ptr< DlColorSource > > samplers() const
static ColorSource MakeLinearGradient(Point start_point, Point end_point, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
static ColorSource MakeColor()
static ColorSource MakeRadialGradient(Point center, Scalar radius, std::vector< Color > colors, std::vector< Scalar > stops, Entity::TileMode tile_mode, Matrix effect_transform)
static ColorSource MakeImage(std::shared_ptr< Texture > texture, Entity::TileMode x_tile_mode, Entity::TileMode y_tile_mode, SamplerDescriptor sampler_descriptor, Matrix effect_transform)
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)
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)
static ColorSource MakeRuntimeEffect(std::shared_ptr< RuntimeStage > runtime_stage, std::shared_ptr< std::vector< uint8_t > > uniform_data, std::vector< RuntimeEffectContents::TextureInput > texture_inputs)
void setColor(flutter::DlColor color) override
SkBitmap source
Definition examples.cpp:28
float SkScalar
Definition extension.cpp:12
#define FML_LOG(severity)
Definition logging.h:82
#define FML_DCHECK(condition)
Definition logging.h:103
unsigned useCenter Optional< SkMatrix > matrix
Definition SkRecords.h:258
PODArray< SkColor > colors
Definition SkRecords.h:276
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...
static std::optional< ColorSource::Type > ToColorSourceType(flutter::DlColorSourceType type)
static Matrix ToMatrix(const SkMatrix &m)
static Entity::TileMode ToTileMode(flutter::DlTileMode tile_mode)
ColorSource color_source
Definition paint.h:56
#define ERROR(message)
static sk_sp< SkShader > linear(sk_sp< SkShader > shader)

◆ setDrawStyle()

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

Implements flutter::DlOpReceiver.

Definition at line 188 of file dl_dispatcher.cc.

188 {
189 paint_.style = ToStyle(style);
190}
static Paint::Style ToStyle(flutter::DlDrawStyle style)
Style style
Definition paint.h:63

◆ setImageFilter()

void impeller::DlDispatcherBase::setImageFilter ( const flutter::DlImageFilter filter)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 608 of file dl_dispatcher.cc.

608 {
609 paint_.image_filter = ToImageFilter(filter);
610}
std::shared_ptr< ImageFilter > image_filter
Definition paint.h:67

◆ setInvertColors()

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

Implements flutter::DlOpReceiver.

Definition at line 469 of file dl_dispatcher.cc.

469 {
470 paint_.invert_colors = invert;
471}
gboolean invert
bool invert_colors
Definition paint.h:65

◆ setMaskFilter()

void impeller::DlDispatcherBase::setMaskFilter ( const flutter::DlMaskFilter filter)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 498 of file dl_dispatcher.cc.

498 {
499 // Needs https://github.com/flutter/flutter/issues/95434
500 if (filter == nullptr) {
501 paint_.mask_blur_descriptor = std::nullopt;
502 return;
503 }
504 switch (filter->type()) {
506 auto blur = filter->asBlur();
507
508 paint_.mask_blur_descriptor = {
509 .style = ToBlurStyle(blur->style()),
510 .sigma = Sigma(blur->sigma()),
511 };
512 break;
513 }
514 }
515}
virtual T type() const =0
virtual const DlBlurMaskFilter * asBlur() const
static FilterContents::BlurStyle ToBlurStyle(flutter::DlBlurStyle blur_style)
std::optional< MaskBlurDescriptor > mask_blur_descriptor
Definition paint.h:69

◆ setPathEffect()

void impeller::DlDispatcherBase::setPathEffect ( const flutter::DlPathEffect effect)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 479 of file dl_dispatcher.cc.

479 {
480 // Needs https://github.com/flutter/flutter/issues/95434
482}

◆ setStrokeCap()

void impeller::DlDispatcherBase::setStrokeCap ( flutter::DlStrokeCap  cap)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 213 of file dl_dispatcher.cc.

213 {
214 switch (cap) {
216 paint_.stroke_cap = Cap::kButt;
217 break;
219 paint_.stroke_cap = Cap::kRound;
220 break;
222 paint_.stroke_cap = Cap::kSquare;
223 break;
224 }
225}
@ kRound
adds circle
@ kButt
no stroke extension
@ kSquare
adds square
Cap stroke_cap
Definition paint.h:60

◆ setStrokeJoin()

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

Implements flutter::DlOpReceiver.

Definition at line 228 of file dl_dispatcher.cc.

228 {
229 switch (join) {
231 paint_.stroke_join = Join::kMiter;
232 break;
234 paint_.stroke_join = Join::kRound;
235 break;
237 paint_.stroke_join = Join::kBevel;
238 break;
239 }
240}
@ kMiter
extends to miter limit
@ kBevel
connects outside edges
Join stroke_join
Definition paint.h:61

◆ setStrokeMiter()

void impeller::DlDispatcherBase::setStrokeMiter ( SkScalar  limit)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 208 of file dl_dispatcher.cc.

208 {
209 paint_.stroke_miter = limit;
210}
Scalar stroke_miter
Definition paint.h:62

◆ setStrokeWidth()

void impeller::DlDispatcherBase::setStrokeWidth ( SkScalar  width)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 203 of file dl_dispatcher.cc.

203 {
204 paint_.stroke_width = width;
205}
int32_t width
Scalar stroke_width
Definition paint.h:59

◆ skew()

void impeller::DlDispatcherBase::skew ( SkScalar  sx,
SkScalar  sy 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 651 of file dl_dispatcher.cc.

651 {
652 GetCanvas().Skew(sx, sy);
653}
void Skew(Scalar sx, Scalar sy)
Definition canvas.cc:321

◆ transform2DAffine()

void impeller::DlDispatcherBase::transform2DAffine ( SkScalar  mxx,
SkScalar  mxy,
SkScalar  mxt,
SkScalar  myx,
SkScalar  myy,
SkScalar  myt 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 656 of file dl_dispatcher.cc.

661 {
662 // clang-format off
664 mxx, mxy, 0, mxt,
665 myx, myy, 0, myt,
666 0 , 0, 1, 0,
667 0 , 0, 0, 1
668 );
669 // clang-format on
670}
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

◆ transformFullPerspective()

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

Implements flutter::DlOpReceiver.

Definition at line 673 of file dl_dispatcher.cc.

688 {
689 // The order of arguments is row-major but Impeller matrices are
690 // column-major.
691 // clang-format off
692 auto transform = Matrix{
693 mxx, myx, mzx, mwx,
694 mxy, myy, mzy, mwy,
695 mxz, myz, mzz, mwz,
696 mxt, myt, mzt, mwt
697 };
698 // clang-format on
700}
void Transform(const Matrix &transform)
Definition canvas.cc:292
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition p3.cpp:47

◆ transformReset()

void impeller::DlDispatcherBase::transformReset ( )
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 703 of file dl_dispatcher.cc.

703 {
705 GetCanvas().Transform(initial_matrix_);
706}
void ResetTransform()
Definition canvas.cc:288

◆ translate()

void impeller::DlDispatcherBase::translate ( SkScalar  tx,
SkScalar  ty 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 636 of file dl_dispatcher.cc.

636 {
637 GetCanvas().Translate({tx, ty, 0.0});
638}
void Translate(const Vector3 &offset)
Definition canvas.cc:309

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