| Flutter Impeller |

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

`#include <dl_builder.h>`

Inheritance diagram for impeller::interop::DisplayListBuilder:

## Public Member Functions
| DisplayListBuilder (const ImpellerRect *rect)
| ~DisplayListBuilder () override
| DisplayListBuilder (const DisplayListBuilder &)=delete
DisplayListBuilder & | operator= (const DisplayListBuilder &)=delete
void | Save ()
void | SaveLayer (const Rect &bounds, const Paint *paint, const ImageFilter *backdrop)
void | Restore ()
void | Scale (Size scale)
void | Rotate (Degrees angle)
void | Translate (Point translation)
Matrix | GetTransform () const
void | SetTransform (const Matrix &matrix)
void | ResetTransform ()
uint32_t | GetSaveCount () const
void | RestoreToCount (uint32_t count)
void | ClipRect (const Rect &rect, flutter::DlCanvas::ClipOp op)
void | ClipOval (const Rect &rect, flutter::DlCanvas::ClipOp op)
void | ClipRoundedRect (const Rect &rect, const impeller::PathBuilder::RoundingRadii &radii, flutter::DlCanvas::ClipOp op)
void | ClipPath (const Path &path, flutter::DlCanvas::ClipOp op)
void | DrawPaint (const Paint &paint)
void | DrawLine (const Point &from, const Point &to, const Paint &paint)
void | DrawDashedLine (const Point &from, const Point &to, Scalar on_length, Scalar off_length, const Paint &paint)
void | DrawRect (const Rect &rect, const Paint &paint)
void | DrawOval (const Rect &oval_bounds, const Paint &paint)
void | DrawRoundedRect (const Rect &rect, const impeller::PathBuilder::RoundingRadii &radii, const Paint &paint)
void | DrawRoundedRectDifference (const Rect &outer_rect, const impeller::PathBuilder::RoundingRadii &outer_radii, const Rect &inner_rect, const impeller::PathBuilder::RoundingRadii &inner_radii, const Paint &paint)
void | DrawPath (const Path &path, const Paint &paint)
void | DrawTexture (const Texture &texture, const Point &point, flutter::DlImageSampling sampling, const Paint *paint)
void | DrawTextureRect (const Texture &texture, const Rect &src_rect, const Rect &dst_rect, flutter::DlImageSampling sampling, const Paint *paint)
void | DrawDisplayList (const DisplayList &dl, Scalar opacity)
void | DrawParagraph (const Paragraph &paragraph, Point point)
ScopedObject< DisplayList > | Build ()
Public Member Functions inherited from impeller::interop::ObjectBase
| ObjectBase ()=default
virtual | ~ObjectBase ()=default
| ObjectBase (const ObjectBase &)=delete
| ObjectBase (ObjectBase &&)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
ObjectBase & | operator= (ObjectBase &&)=delete
void | Retain ()
void | Release ()
uint64_t | GetRefCountForTests () const

## Additional Inherited Members
Public Types inherited from impeller::interop::Object< DisplayListBuilder, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerDisplayListBuilder)>
using | InteropClass = DisplayListBuilder
using | InteropCSibling = IMPELLER_INTERNAL_HANDLE_NAME(ImpellerDisplayListBuilder)
Static Public Member Functions inherited from impeller::interop::ObjectBase
static void | SafeRetain (void *ptr)
static void | SafeRelease (void *ptr)

## Detailed Description

Definition at line 24 of file dl_builder.h.

## Constructor & Destructor Documentation

## ◆ DisplayListBuilder() [1/2]

impeller::interop::DisplayListBuilder::DisplayListBuilder | ( | const ImpellerRect * | rect | ) |
| explicit

Definition at line 11 of file dl_builder.cc.

12 : builder_(ToSkiaType(rect).value_or(
13 flutter::DisplayListBuilder::kMaxCullRect)) {}

## ◆ ~DisplayListBuilder()

impeller::interop::DisplayListBuilder::~DisplayListBuilder | ( |  | ) |
| overridedefault

## ◆ DisplayListBuilder() [2/2]

impeller::interop::DisplayListBuilder::DisplayListBuilder | ( | const DisplayListBuilder & |  | ) |
| delete

## Member Function Documentation

## ◆ Build()

ScopedObject< DisplayList > impeller::interop::DisplayListBuilder::Build | ( |  | ) |

Definition at line 146 of file dl_builder.cc.

146 {
147 return Create<DisplayList>(builder_.Build());
148 }

## ◆ ClipOval()

void impeller::interop::DisplayListBuilder::ClipOval | ( | const Rect & | rect,
|  | flutter::DlCanvas::ClipOp | op
| ) |  |

Definition at line 75 of file dl_builder.cc.

76 {
77 builder_.ClipOval(ToSkiaType(rect), op);
78 }

References impeller::interop::ToSkiaType().

## ◆ ClipPath()

void impeller::interop::DisplayListBuilder::ClipPath | ( | const Path & | path,
|  | flutter::DlCanvas::ClipOp | op
| ) |  |

Definition at line 87 of file dl_builder.cc.

88 {
89 builder_.ClipPath(path.GetPath(), op);
90 }

References impeller::interop::Path::GetPath().

## ◆ ClipRect()

void impeller::interop::DisplayListBuilder::ClipRect | ( | const Rect & | rect,
|  | flutter::DlCanvas::ClipOp | op
| ) |  |

Definition at line 70 of file dl_builder.cc.

71 {
72 builder_.ClipRect(ToSkiaType(rect), op);
73 }

References impeller::interop::ToSkiaType().

## ◆ ClipRoundedRect()

void impeller::interop::DisplayListBuilder::ClipRoundedRect | ( | const Rect & | rect,
|  | const impeller::PathBuilder::RoundingRadii & | radii,
|  | flutter::DlCanvas::ClipOp | op
| ) |  |

Definition at line 80 of file dl_builder.cc.

83 {
84 builder_.ClipRRect(ToSkiaType(rect, radii), op);
85 }

References impeller::interop::ToSkiaType().

## ◆ DrawDashedLine()

void impeller::interop::DisplayListBuilder::DrawDashedLine | ( | const Point & | from,
|  | const Point & | to,
|  | Scalar | on_length,
|  | Scalar | off_length,
|  | const Paint & | paint
| ) |  |

Definition at line 133 of file dl_builder.cc.

137 {
138 builder_.DrawDashedLine(from, //
139 to, //
140 on_length, //
141 off_length, //
142 paint.GetPaint() //
143 );
144 }

References impeller::interop::Paint::GetPaint().

## ◆ DrawDisplayList()

void impeller::interop::DisplayListBuilder::DrawDisplayList | ( | const DisplayList & | dl,
|  | Scalar | opacity
| ) |  |

Definition at line 150 of file dl_builder.cc.

151 {
152 builder_.DrawDisplayList(dl.GetDisplayList(), opacity);
153 }

References impeller::interop::DisplayList::GetDisplayList().

## ◆ DrawLine()

void impeller::interop::DisplayListBuilder::DrawLine | ( | const Point & | from,
|  | const Point & | to,
|  | const Paint & | paint
| ) |  |

Definition at line 127 of file dl_builder.cc.

129 {
130 builder_.DrawLine(ToSkiaType(from), ToSkiaType(to), paint.GetPaint());
131 }

References impeller::interop::Paint::GetPaint(), and impeller::interop::ToSkiaType().

## ◆ DrawOval()

void impeller::interop::DisplayListBuilder::DrawOval | ( | const Rect & | oval_bounds,
|  | const Paint & | paint
| ) |  |

Definition at line 96 of file dl_builder.cc.

96 {
97 builder_.DrawOval(ToSkiaType(oval_bounds), paint.GetPaint());
98 }

References impeller::interop::Paint::GetPaint(), and impeller::interop::ToSkiaType().

## ◆ DrawPaint()

void impeller::interop::DisplayListBuilder::DrawPaint | ( | const Paint & | paint | ) |

Definition at line 123 of file dl_builder.cc.

123 {
124 builder_.DrawPaint(paint.GetPaint());
125 }

References impeller::interop::Paint::GetPaint().

## ◆ DrawParagraph()

void impeller::interop::DisplayListBuilder::DrawParagraph | ( | const Paragraph & | paragraph,
|  | Point | point
| ) |  |

Definition at line 179 of file dl_builder.cc.

180 {
181 const auto& handle = paragraph.GetHandle();
182 if (!handle) {
183 return;
184 }
185 handle->Paint(&builder_, point.x, point.y);
186 }

References impeller::interop::Paragraph::GetHandle(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

## ◆ DrawPath()

void impeller::interop::DisplayListBuilder::DrawPath | ( | const Path & | path,
|  | const Paint & | paint
| ) |  |

Definition at line 119 of file dl_builder.cc.

119 {
120 builder_.DrawPath(path.GetPath(), paint.GetPaint());
121 }

References impeller::interop::Paint::GetPaint(), and impeller::interop::Path::GetPath().

## ◆ DrawRect()

void impeller::interop::DisplayListBuilder::DrawRect | ( | const Rect & | rect,
|  | const Paint & | paint
| ) |  |

Definition at line 92 of file dl_builder.cc.

92 {
93 builder_.DrawRect(ToSkiaType(rect), paint.GetPaint());
94 }

References impeller::interop::Paint::GetPaint(), and impeller::interop::ToSkiaType().

## ◆ DrawRoundedRect()

void impeller::interop::DisplayListBuilder::DrawRoundedRect | ( | const Rect & | rect,
|  | const impeller::PathBuilder::RoundingRadii & | radii,
|  | const Paint & | paint
| ) |  |

Definition at line 100 of file dl_builder.cc.

103 {
104 builder_.DrawRRect(ToSkiaType(rect, radii), paint.GetPaint());
105 }

References impeller::interop::Paint::GetPaint(), and impeller::interop::ToSkiaType().

## ◆ DrawRoundedRectDifference()

void impeller::interop::DisplayListBuilder::DrawRoundedRectDifference | ( | const Rect & | outer_rect,
|  | const impeller::PathBuilder::RoundingRadii & | outer_radii,
|  | const Rect & | inner_rect,
|  | const impeller::PathBuilder::RoundingRadii & | inner_radii,
|  | const Paint & | paint
| ) |  |

Definition at line 107 of file dl_builder.cc.

112 {
113 builder_.DrawDRRect(ToSkiaType(outer_rect, outer_radii), //
114 ToSkiaType(inner_rect, inner_radii), //
115 paint.GetPaint() //
116 );
117 }

References impeller::interop::Paint::GetPaint(), and impeller::interop::ToSkiaType().

## ◆ DrawTexture()

void impeller::interop::DisplayListBuilder::DrawTexture | ( | const Texture & | texture,
|  | const Point & | point,
|  | flutter::DlImageSampling | sampling,
|  | const Paint * | paint
| ) |  |

Definition at line 155 of file dl_builder.cc.

158 {
159 builder_.DrawImage(texture.MakeImage(), //
160 ToSkiaType(point), //
161 sampling, //
162 paint == nullptr ? nullptr : &paint->GetPaint() //
163 );
164 }

References impeller::interop::Paint::GetPaint(), impeller::interop::Texture::MakeImage(), and impeller::interop::ToSkiaType().

## ◆ DrawTextureRect()

void impeller::interop::DisplayListBuilder::DrawTextureRect | ( | const Texture & | texture,
|  | const Rect & | src_rect,
|  | const Rect & | dst_rect,
|  | flutter::DlImageSampling | sampling,
|  | const Paint * | paint
| ) |  |

Definition at line 166 of file dl_builder.cc.

170 {
171 builder_.DrawImageRect(texture.MakeImage(), //
172 ToSkiaType(src_rect), //
173 ToSkiaType(dst_rect), //
174 sampling, //
175 paint == nullptr ? nullptr : &paint->GetPaint() //
176 );
177 }

References impeller::interop::Paint::GetPaint(), impeller::interop::Texture::MakeImage(), and impeller::interop::ToSkiaType().

## ◆ GetSaveCount()

uint32_t impeller::interop::DisplayListBuilder::GetSaveCount | ( |  | ) | const

Definition at line 62 of file dl_builder.cc.

62 {
63 return builder_.GetSaveCount();
64 }

## ◆ GetTransform()

Matrix impeller::interop::DisplayListBuilder::GetTransform | ( |  | ) | const

Definition at line 47 of file dl_builder.cc.

47 {
48 Matrix matrix;
49 builder_.GetTransformFullPerspective().getColMajor(matrix.m);
50 return matrix;
51 }

References impeller::Matrix::m.

## ◆ operator=()

DisplayListBuilder& impeller::interop::DisplayListBuilder::operator= | ( | const DisplayListBuilder & |  | ) |
| delete

## ◆ ResetTransform()

void impeller::interop::DisplayListBuilder::ResetTransform | ( |  | ) |

Definition at line 58 of file dl_builder.cc.

58 {
59 builder_.TransformReset();
60 }

## ◆ Restore()

void impeller::interop::DisplayListBuilder::Restore | ( |  | ) |

Definition at line 31 of file dl_builder.cc.

31 {
32 builder_.Restore();
33 }

## ◆ RestoreToCount()

void impeller::interop::DisplayListBuilder::RestoreToCount | ( | uint32_t | count | ) |

Definition at line 66 of file dl_builder.cc.

66 {
67 builder_.RestoreToCount(count);
68 }

## ◆ Rotate()

void impeller::interop::DisplayListBuilder::Rotate | ( | Degrees | angle | ) |

Definition at line 39 of file dl_builder.cc.

39 {
40 builder_.Rotate(angle.degrees);
41 }

References impeller::Degrees::degrees.

## ◆ Save()

void impeller::interop::DisplayListBuilder::Save | ( |  | ) |

Definition at line 17 of file dl_builder.cc.

17 {
18 builder_.Save();
19 }

## ◆ SaveLayer()

void impeller::interop::DisplayListBuilder::SaveLayer | ( | const Rect & | bounds,
|  | const Paint * | paint,
|  | const ImageFilter * | backdrop
| ) |  |

Definition at line 21 of file dl_builder.cc.

23 {
24 const auto sk_bounds = ToSkiaType(bounds);
25 builder_.SaveLayer(
26 &sk_bounds, //
27 paint == nullptr ? nullptr : &paint->GetPaint(), //
28 backdrop == nullptr ? nullptr : backdrop->GetImageFilter().get());
29 }

References impeller::interop::ImageFilter::GetImageFilter(), impeller::interop::Paint::GetPaint(), and impeller::interop::ToSkiaType().

## ◆ Scale()

void impeller::interop::DisplayListBuilder::Scale | ( | Size | scale | ) |

Definition at line 35 of file dl_builder.cc.

35 {
36 builder_.Scale(scale.width, scale.height);
37 }

References scale.

## ◆ SetTransform()

void impeller::interop::DisplayListBuilder::SetTransform | ( | const Matrix & | matrix | ) |

Definition at line 53 of file dl_builder.cc.

53 {
54 const auto sk_matrix = SkM44::ColMajor(matrix.m);
55 builder_.SetTransform(&sk_matrix);
56 }

References impeller::Matrix::m.

## ◆ Translate()

void impeller::interop::DisplayListBuilder::Translate | ( | Point | translation | ) |

Definition at line 43 of file dl_builder.cc.

43 {
44 builder_.Translate(translation.x, translation.y);
45 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

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

- impeller/toolkit/interop/dl_builder.h
- impeller/toolkit/interop/dl_builder.cc

impeller::interop::ToSkiaType
constexpr std::optional< SkRect > ToSkiaType(const ImpellerRect *rect)
Definition: formats.h:26
scale
const Scalar scale
Definition: stroke_path_geometry.cc:301