| Flutter Impeller |

Classes | Public Member Functions | Static Public Attributes | List of all members
impeller::PathBuilder Class Reference

`#include <path_builder.h>`

## Classes
struct | RoundingRadii

## Public Member Functions
| PathBuilder ()
| ~PathBuilder ()
Path | CopyPath (FillType fill=FillType::kNonZero) const
Path | TakePath (FillType fill=FillType::kNonZero)
void | Reserve (size_t point_size, size_t verb_size)
| Reserve [point_size] points and [verb_size] verbs in the underlying path buffer. More...
const Path & | GetCurrentPath () const
PathBuilder & | SetConvexity (Convexity value)
PathBuilder & | MoveTo (Point point, bool relative=false)
PathBuilder & | Close ()
PathBuilder & | LineTo (Point point, bool relative=false)
| Insert a line from the current position to `point`. More...
PathBuilder & | HorizontalLineTo (Scalar x, bool relative=false)
PathBuilder & | VerticalLineTo (Scalar y, bool relative=false)
PathBuilder & | QuadraticCurveTo (Point controlPoint, Point point, bool relative=false)
| Insert a quadradic curve from the current position to `point` using the control point `controlPoint`. More...
PathBuilder & | CubicCurveTo (Point controlPoint1, Point controlPoint2, Point point, bool relative=false)
| Insert a cubic curve from the curren position to `point` using the control points `controlPoint1` and `controlPoint2`. More...
PathBuilder & | AddRect (Rect rect)
PathBuilder & | AddCircle (const Point &center, Scalar radius)
PathBuilder & | AddArc (const Rect &oval_bounds, Radians start, Radians sweep, bool use_center=false)
PathBuilder & | AddOval (const Rect &rect)
PathBuilder & | AddLine (const Point &p1, const Point &p2)
| Move to point `p1`, then insert a line from `p1` to `p2`. More...
PathBuilder & | AddQuadraticCurve (Point p1, Point cp, Point p2)
| Move to point `p1`, then insert a quadradic curve from `p1` to `p2` with the control point `cp`. More...
PathBuilder & | AddCubicCurve (Point p1, Point cp1, Point cp2, Point p2)
| Move to point `p1`, then insert a cubic curve from `p1` to `p2` with control points `cp1` and `cp2`. More...
PathBuilder & | Shift (Point offset)
| Transform the existing path segments and contours by the given `offset`. More...
PathBuilder & | SetBounds (Rect bounds)
| Set the bounding box that will be used by `Path.GetBoundingBox` in place of performing the computation. More...
PathBuilder & | AddRoundedRect (Rect rect, RoundingRadii radii)
PathBuilder & | AddRoundedRect (Rect rect, Size radii)
PathBuilder & | AddRoundedRect (Rect rect, Scalar radius)
PathBuilder & | AddPath (const Path &path)

## Static Public Attributes
constexpr static const Scalar | kArcApproximationMagic = 0.551915024494f

## Detailed Description

Definition at line 14 of file path_builder.h.

## Constructor & Destructor Documentation

## ◆ PathBuilder()

impeller::PathBuilder::PathBuilder | ( |  | ) |
| default

## ◆ ~PathBuilder()

impeller::PathBuilder::~PathBuilder | ( |  | ) |
| default

## Member Function Documentation

## ◆ AddArc()

PathBuilder & impeller::PathBuilder::AddArc | ( | const Rect & | oval_bounds,
|  | Radians | start,
|  | Radians | sweep,
|  | bool | use_center = `false`
| ) |  |

Definition at line 264 of file path_builder.cc.

267 {
268 if (sweep.radians < 0) {
269 start.radians += sweep.radians;
270 sweep.radians *= -1;
271 }
272 sweep.radians = std::min(k2Pi, sweep.radians);
273 start.radians = std::fmod(start.radians, k2Pi);
274
275 const Point center = oval_bounds.GetCenter();
276 const Point radius = center - oval_bounds.GetOrigin();
277
278 Vector2 p1_unit(std::cos(start.radians), std::sin(start.radians));
279
280 if (use_center) {
281 MoveTo(center);
282 LineTo(center + p1_unit * radius);
283 } else {
284 MoveTo(center + p1_unit * radius);
285 }
286
287 while (sweep.radians > 0) {
288 Vector2 p2_unit;
289 Scalar quadrant_angle;
290 if (sweep.radians < kPiOver2) {
291 quadrant_angle = sweep.radians;
292 p2_unit = Vector2(std::cos(start.radians + quadrant_angle),
293 std::sin(start.radians + quadrant_angle));
294 } else {
295 quadrant_angle = kPiOver2;
296 p2_unit = Vector2(-p1_unit.y, p1_unit.x);
297 }
298
299 Vector2 arc_cp_lengths =
300 (quadrant_angle / kPiOver2) * kArcApproximationMagic * radius;
301
302 Point p1 = center + p1_unit * radius;
303 Point p2 = center + p2_unit * radius;
304 Point cp1 = p1 + Vector2(-p1_unit.y, p1_unit.x) * arc_cp_lengths;
305 Point cp2 = p2 + Vector2(p2_unit.y, -p2_unit.x) * arc_cp_lengths;
306
307 prototype_.AddCubicComponent(p1, cp1, cp2, p2);
308 current_ = p2;
309
310 start.radians += quadrant_angle;
311 sweep.radians -= quadrant_angle;
312 p1_unit = p2_unit;
313 }
314
315 if (use_center) {
316 Close();
317 }
318
319 return *this;
320 }

References Close(), impeller::TRect< T >::GetCenter(), impeller::TRect< T >::GetOrigin(), impeller::k2Pi, kArcApproximationMagic, impeller::kPiOver2, LineTo(), MoveTo(), impeller::Radians::radians, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

Referenced by impeller::DlDispatcher::drawArc(), and impeller::testing::TEST_P().

## ◆ AddCircle()

PathBuilder & impeller::PathBuilder::AddCircle | ( | const Point & | center,
|  | Scalar | radius
| ) |  |

Definition at line 134 of file path_builder.cc.

134 {
135 return AddOval(Rect::MakeXYWH(c.x - r, c.y - r, 2.0f * r, 2.0f * r));
136 }

References AddOval(), impeller::TRect< Scalar >::MakeXYWH(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

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

## ◆ AddCubicCurve()

PathBuilder & impeller::PathBuilder::AddCubicCurve | ( | Point | p1,
|  | Point | cp1,
|  | Point | cp2,
|  | Point | p2
| ) |  |

Move to point `p1`, then insert a cubic curve from `p1` to `p2` with control points `cp1` and `cp2`.

Definition at line 107 of file path_builder.cc.

110 {
111 MoveTo(p1);
112 prototype_.AddCubicComponent(p1, cp1, cp2, p2);
113 return *this;
114 }

References MoveTo().

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

## ◆ AddLine()

PathBuilder & impeller::PathBuilder::AddLine | ( | const Point & | p1,
|  | const Point & | p2
| ) |  |

Move to point `p1`, then insert a line from `p1` to `p2`.

Definition at line 370 of file path_builder.cc.

370 {
371 MoveTo(p1);
372 prototype_.AddLinearComponent(p1, p2);
373 return *this;
374 }

References MoveTo().

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

## ◆ AddOval()

PathBuilder & impeller::PathBuilder::AddOval | ( | const Rect & | rect | ) |

Definition at line 322 of file path_builder.cc.

322 {
323 const Point c = container.GetCenter();
324 const Point r = c - container.GetOrigin();
325 const Point m = r * kArcApproximationMagic;
326
327 MoveTo({c.x, c.y - r.y});
328
329 //----------------------------------------------------------------------------
330 // Top right arc.
331 //
332 prototype_.AddCubicComponent({c.x, c.y - r.y}, // p1
333 {c.x + m.x, c.y - r.y}, // cp1
334 {c.x + r.x, c.y - m.y}, // cp2
335 {c.x + r.x, c.y} // p2
336 );
337
338 //----------------------------------------------------------------------------
339 // Bottom right arc.
340 //
341 prototype_.AddCubicComponent({c.x + r.x, c.y}, // p1
342 {c.x + r.x, c.y + m.y}, // cp1
343 {c.x + m.x, c.y + r.y}, // cp2
344 {c.x, c.y + r.y} // p2
345 );
346
347 //----------------------------------------------------------------------------
348 // Bottom left arc.
349 //
350 prototype_.AddCubicComponent({c.x, c.y + r.y}, // p1
351 {c.x - m.x, c.y + r.y}, // cp1
352 {c.x - r.x, c.y + m.y}, // cp2
353 {c.x - r.x, c.y} // p2
354 );
355
356 //----------------------------------------------------------------------------
357 // Top left arc.
358 //
359 prototype_.AddCubicComponent({c.x - r.x, c.y}, // p1
360 {c.x - r.x, c.y - m.y}, // cp1
361 {c.x - m.x, c.y - r.y}, // cp2
362 {c.x, c.y - r.y} // p2
363 );
364
365 Close();
366
367 return *this;
368 }

References Close(), impeller::TRect< T >::GetCenter(), impeller::TRect< T >::GetOrigin(), kArcApproximationMagic, MoveTo(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

Referenced by AddCircle(), impeller::Canvas::DrawOval(), and impeller::testing::TEST().

## ◆ AddPath()

PathBuilder & impeller::PathBuilder::AddPath | ( | const Path & | path | ) |

Definition at line 380 of file path_builder.cc.

380 {
381 auto linear = [&](size_t index, const LinearPathComponent& l) {
382 prototype_.AddLinearComponent(l.p1, l.p2);
383 };
384 auto quadratic = [&](size_t index, const QuadraticPathComponent& q) {
385 prototype_.AddQuadraticComponent(q.p1, q.cp, q.p2);
386 };
387 auto cubic = [&](size_t index, const CubicPathComponent& c) {
388 prototype_.AddCubicComponent(c.p1, c.cp1, c.cp2, c.p2);
389 };
390 auto move = [&](size_t index, const ContourComponent& m) {
391 prototype_.AddContourComponent(m.destination);
392 };
393 path.EnumerateComponents(linear, quadratic, cubic, move);
394 return *this;
395 }

References impeller::Path::EnumerateComponents().

Referenced by impeller::DlDispatcher::drawDRRect().

## ◆ AddQuadraticCurve()

PathBuilder & impeller::PathBuilder::AddQuadraticCurve | ( | Point | p1,
|  | Point | cp,
|  | Point | p2
| ) |  |

Move to point `p1`, then insert a quadradic curve from `p1` to `p2` with the control point `cp`.

Definition at line 101 of file path_builder.cc.

101 {
102 MoveTo(p1);
103 prototype_.AddQuadraticComponent(p1, cp, p2);
104 return *this;
105 }

References MoveTo().

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

## ◆ AddRect()

PathBuilder & impeller::PathBuilder::AddRect | ( | Rect | rect | ) |

Definition at line 116 of file path_builder.cc.

116 {
117 auto origin = rect.GetOrigin();
118 auto size = rect.GetSize();
119
120 auto tl = origin;
121 auto bl = origin + Point{0.0, size.height};
122 auto br = origin + size;
123 auto tr = origin + Point{size.width, 0.0};
124
125 MoveTo(tl);
126 LineTo(tr);
127 LineTo(br);
128 LineTo(bl);
129 Close();
130
131 return *this;
132 }

References Close(), impeller::TRect< T >::GetOrigin(), impeller::TRect< T >::GetSize(), LineTo(), and MoveTo().

Referenced by AddRoundedRect(), impeller::testing::CreatePassWithRectPath(), impeller::Canvas::DrawRect(), impeller::testing::TEST(), and impeller::testing::TEST_P().

## ◆ AddRoundedRect() [1/3]

PathBuilder & impeller::PathBuilder::AddRoundedRect | ( | Rect | rect,
|  | RoundingRadii | radii
| ) |  |

Definition at line 149 of file path_builder.cc.

149 {
150 if (radii.AreAllZero()) {
151 return AddRect(rect);
152 }
153
154 auto rect_origin = rect.GetOrigin();
155 auto rect_size = rect.GetSize();
156
157 current_ = rect_origin + Point{radii.top_left.x, 0.0};
158
159 MoveTo({rect_origin.x + radii.top_left.x, rect_origin.y});
160
161 //----------------------------------------------------------------------------
162 // Top line.
163 //
164 prototype_.AddLinearComponent(
165 {rect_origin.x + radii.top_left.x, rect_origin.y},
166 {rect_origin.x + rect_size.width - radii.top_right.x, rect_origin.y});
167
168 //----------------------------------------------------------------------------
169 // Top right arc.
170 //
171 AddRoundedRectTopRight(rect, radii);
172
173 //----------------------------------------------------------------------------
174 // Right line.
175 //
176 prototype_.AddLinearComponent(
177 {rect_origin.x + rect_size.width, rect_origin.y + radii.top_right.y},
178 {rect_origin.x + rect_size.width,
179 rect_origin.y + rect_size.height - radii.bottom_right.y});
180
181 //----------------------------------------------------------------------------
182 // Bottom right arc.
183 //
184 AddRoundedRectBottomRight(rect, radii);
185
186 //----------------------------------------------------------------------------
187 // Bottom line.
188 //
189 prototype_.AddLinearComponent(
190 {rect_origin.x + rect_size.width - radii.bottom_right.x,
191 rect_origin.y + rect_size.height},
192 {rect_origin.x + radii.bottom_left.x, rect_origin.y + rect_size.height});
193
194 //----------------------------------------------------------------------------
195 // Bottom left arc.
196 //
197 AddRoundedRectBottomLeft(rect, radii);
198
199 //----------------------------------------------------------------------------
200 // Left line.
201 //
202 prototype_.AddLinearComponent(
203 {rect_origin.x, rect_origin.y + rect_size.height - radii.bottom_left.y},
204 {rect_origin.x, rect_origin.y + radii.top_left.y});
205
206 //----------------------------------------------------------------------------
207 // Top left arc.
208 //
209 AddRoundedRectTopLeft(rect, radii);
210
211 Close();
212
213 return *this;
214 }

References AddRect(), impeller::PathBuilder::RoundingRadii::AreAllZero(), impeller::PathBuilder::RoundingRadii::bottom_left, impeller::PathBuilder::RoundingRadii::bottom_right, Close(), impeller::TRect< T >::GetOrigin(), impeller::TRect< T >::GetSize(), MoveTo(), impeller::PathBuilder::RoundingRadii::top_left, impeller::PathBuilder::RoundingRadii::top_right, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

Referenced by AddRoundedRect(), impeller::Canvas::DrawRRect(), impeller::testing::TEST(), impeller::testing::TEST_P(), and impeller::skia_conversions::ToPath().

## ◆ AddRoundedRect() [2/3]

PathBuilder & impeller::PathBuilder::AddRoundedRect | ( | Rect | rect,
|  | Scalar | radius
| ) |  |

Definition at line 138 of file path_builder.cc.

138 {
139 return radius <= 0.0 ? AddRect(rect)
140 : AddRoundedRect(rect, RoundingRadii(radius));
141 }

References AddRect(), and AddRoundedRect().

## ◆ AddRoundedRect() [3/3]

PathBuilder & impeller::PathBuilder::AddRoundedRect | ( | Rect | rect,
|  | Size | radii
| ) |  |

Definition at line 143 of file path_builder.cc.

143 {
144 return radii.width <= 0 || radii.height <= 0
145 ? AddRect(rect)
146 : AddRoundedRect(rect, RoundingRadii(radii));
147 }

References AddRect(), AddRoundedRect(), impeller::TSize< T >::height, and impeller::TSize< T >::width.

## ◆ Close()

PathBuilder & impeller::PathBuilder::Close | ( |  | ) |

Definition at line 44 of file path_builder.cc.

44 {
45 LineTo(subpath_start_);
46 prototype_.SetContourClosed(true);
47 prototype_.AddContourComponent(current_);
48 return *this;
49 }

References LineTo().

Referenced by AddArc(), AddOval(), AddRect(), AddRoundedRect(), impeller::Close(), impeller::testing::TEST(), impeller::testing::TEST_P(), and impeller::skia_conversions::ToPath().

## ◆ CopyPath()

Path impeller::PathBuilder::CopyPath | ( | FillType | fill = `FillType::kNonZero` | ) | const

Definition at line 15 of file path_builder.cc.

15 {
16 auto path = prototype_.Clone();
17 path.SetFillType(fill);
18 return path;
19 }

References impeller::Path::Clone().

Referenced by impeller::Tessellate().

## ◆ CubicCurveTo()

PathBuilder & impeller::PathBuilder::CubicCurveTo | ( | Point | controlPoint1,
|  | Point | controlPoint2,
|  | Point | point,
|  | bool | relative = `false`
| ) |  |

Insert a cubic curve from the curren position to `point` using the control points `controlPoint1` and `controlPoint2`.

If `relative` is true the `point`, `controlPoint1`, and `controlPoint2` are relative to current location.

Definition at line 89 of file path_builder.cc.

92 {
93 controlPoint1 = relative ? current_ + controlPoint1 : controlPoint1;
94 controlPoint2 = relative ? current_ + controlPoint2 : controlPoint2;
95 point = relative ? current_ + point : point;
96 prototype_.AddCubicComponent(current_, controlPoint1, controlPoint2, point);
97 current_ = point;
98 return *this;
99 }

Referenced by impeller::CubicTo(), impeller::testing::TEST(), and impeller::skia_conversions::ToPath().

## ◆ GetCurrentPath()

const Path & impeller::PathBuilder::GetCurrentPath | ( |  | ) | const

Definition at line 376 of file path_builder.cc.

376 {
377 return prototype_;
378 }

## ◆ HorizontalLineTo()

PathBuilder & impeller::PathBuilder::HorizontalLineTo | ( | Scalar | x,
|  | bool | relative = `false`
| ) |  |

Definition at line 58 of file path_builder.cc.

58 {
59 Point endpoint =
60 relative ? Point{current_.x + x, current_.y} : Point{x, current_.y};
61 prototype_.AddLinearComponent(current_, endpoint);
62 current_ = endpoint;
63 return *this;
64 }

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

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

## ◆ LineTo()

PathBuilder & impeller::PathBuilder::LineTo | ( | Point | point,
|  | bool | relative = `false`
| ) |  |

Insert a line from the current position to `point`.

If `relative` is true, then `point` is relative to the current location.

Definition at line 51 of file path_builder.cc.

51 {
52 point = relative ? current_ + point : point;
53 prototype_.AddLinearComponent(current_, point);
54 current_ = point;
55 return *this;
56 }

Referenced by AddArc(), AddRect(), Close(), impeller::LineTo(), impeller::testing::TEST(), impeller::testing::TEST_P(), and impeller::skia_conversions::ToPath().

## ◆ MoveTo()

PathBuilder & impeller::PathBuilder::MoveTo | ( | Point | point,
|  | bool | relative = `false`
| ) |  |

Definition at line 37 of file path_builder.cc.

37 {
38 current_ = relative ? current_ + point : point;
39 subpath_start_ = current_;
40 prototype_.AddContourComponent(current_);
41 return *this;
42 }

Referenced by AddArc(), AddCubicCurve(), AddLine(), AddOval(), AddQuadraticCurve(), AddRect(), AddRoundedRect(), impeller::MoveTo(), impeller::testing::TEST(), impeller::testing::TEST_P(), and impeller::skia_conversions::ToPath().

## ◆ QuadraticCurveTo()

PathBuilder & impeller::PathBuilder::QuadraticCurveTo | ( | Point | controlPoint,
|  | Point | point,
|  | bool | relative = `false`
| ) |  |

Insert a quadradic curve from the current position to `point` using the control point `controlPoint`.

If `relative` is true the `point` and `controlPoint` are relative to current location.

Definition at line 74 of file path_builder.cc.

76 {
77 point = relative ? current_ + point : point;
78 controlPoint = relative ? current_ + controlPoint : controlPoint;
79 prototype_.AddQuadraticComponent(current_, controlPoint, point);
80 current_ = point;
81 return *this;
82 }

Referenced by impeller::testing::TEST(), and impeller::skia_conversions::ToPath().

## ◆ Reserve()

void impeller::PathBuilder::Reserve | ( | size_t | point_size,
|  | size_t | verb_size
| ) |  |

Reserve [point_size] points and [verb_size] verbs in the underlying path buffer.

Definition at line 32 of file path_builder.cc.

32 {
33 prototype_.points_.reserve(point_size);
34 prototype_.points_.reserve(verb_size);
35 }

Referenced by impeller::skia_conversions::ToPath().

## ◆ SetBounds()

PathBuilder & impeller::PathBuilder::SetBounds | ( | Rect | bounds | ) |

Set the bounding box that will be used by `Path.GetBoundingBox` in place of performing the computation.

       When Impeller recieves Skia Path objects, many of these already
       have computed bounds. This method is used to avoid needlessly
       recomputing these bounds.

Definition at line 402 of file path_builder.cc.

402 {
403 prototype_.SetBounds(bounds);
404 did_compute_bounds_ = true;
405 return *this;
406 }

Referenced by impeller::Canvas::DrawRRect(), impeller::testing::TEST(), and impeller::skia_conversions::ToPath().

## ◆ SetConvexity()

PathBuilder & impeller::PathBuilder::SetConvexity | ( | Convexity | value | ) |

Definition at line 84 of file path_builder.cc.

84 {
85 convexity_ = value;
86 return *this;
87 }

Referenced by impeller::Canvas::DrawRRect(), impeller::testing::TEST(), impeller::testing::TEST_P(), and impeller::skia_conversions::ToPath().

## ◆ Shift()

PathBuilder & impeller::PathBuilder::Shift | ( | Point | offset | ) |

Transform the existing path segments and contours by the given `offset`.

Definition at line 397 of file path_builder.cc.

397 {
398 prototype_.Shift(offset);
399 return *this;
400 }

Referenced by impeller::testing::TEST(), and impeller::skia_conversions::ToPath().

## ◆ TakePath()

Path impeller::PathBuilder::TakePath | ( | FillType | fill = `FillType::kNonZero` | ) |

Definition at line 21 of file path_builder.cc.

21 {
22 auto path = std::move(prototype_);
23 path.SetFillType(fill);
24 path.SetConvexity(convexity_);
25 if (!did_compute_bounds_) {
26 path.ComputeBounds();
27 }
28 did_compute_bounds_ = false;
29 return path;
30 }

Referenced by impeller::DlDispatcher::drawArc(), impeller::DlDispatcher::drawDRRect(), impeller::Canvas::DrawRRect(), impeller::testing::TEST(), impeller::testing::TEST_P(), and impeller::skia_conversions::ToPath().

## ◆ VerticalLineTo()

PathBuilder & impeller::PathBuilder::VerticalLineTo | ( | Scalar | y,
|  | bool | relative = `false`
| ) |  |

Definition at line 66 of file path_builder.cc.

66 {
67 Point endpoint =
68 relative ? Point{current_.x, current_.y + y} : Point{current_.x, y};
69 prototype_.AddLinearComponent(current_, endpoint);
70 current_ = endpoint;
71 return *this;
72 }

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

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

## Member Data Documentation

## ◆ kArcApproximationMagic

constexpr static const Scalar impeller::PathBuilder::kArcApproximationMagic = 0.551915024494f
| static constexpr

Used for approximating quarter circle arcs with cubic curves. This is the control point distance which results in the smallest possible unit circle integration for a right angle arc. It can be used to approximate arcs less than 90 degrees to great effect by simply reducing it proportionally to the angle. However, accuracy rapidly diminishes if magnified for obtuse angle arcs, and so multiple cubic curves should be used when approximating arcs greater than 90 degrees.

Definition at line 23 of file path_builder.h.

Referenced by AddArc(), and AddOval().

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

- impeller/geometry/path_builder.h
- impeller/geometry/path_builder.cc

impeller::TPoint::y
Type y
Definition: point.h:26
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::Path::Clone
Path Clone() const
Deeply clone this path and all data associated with it.
Definition: path.cc:76
impeller::TRect< Scalar >::MakeXYWH
constexpr static TRect MakeXYWH(Type x, Type y, Type width, Type height)
Definition: rect.h:34
impeller::Vector2
Point Vector2
Definition: point.h:312
impeller::PathBuilder::AddRoundedRect
PathBuilder & AddRoundedRect(Rect rect, RoundingRadii radii)
Definition: path_builder.cc:149
impeller::PathBuilder::kArcApproximationMagic
constexpr static const Scalar kArcApproximationMagic
Definition: path_builder.h:23
impeller::PathBuilder::AddRect
PathBuilder & AddRect(Rect rect)
Definition: path_builder.cc:116
impeller::kPiOver2
constexpr float kPiOver2
Definition: constants.h:32
impeller::Point
TPoint< Scalar > Point
Definition: point.h:308
impeller::k2Pi
constexpr float k2Pi
Definition: constants.h:29
impeller::Path::EnumerateComponents
void EnumerateComponents(const Applier< LinearPathComponent > &linear_applier, const Applier< QuadraticPathComponent > &quad_applier, const Applier< CubicPathComponent > &cubic_applier, const Applier< ContourComponent > &contour_applier) const
Definition: path.cc:129
impeller::PathBuilder::LineTo
PathBuilder & LineTo(Point point, bool relative=false)
Insert a line from the current position to point.
Definition: path_builder.cc:51
impeller::TPoint::x
Type x
Definition: point.h:25
impeller::PathBuilder::Close
PathBuilder & Close()
Definition: path_builder.cc:44
impeller::PathBuilder::MoveTo
PathBuilder & MoveTo(Point point, bool relative=false)
Definition: path_builder.cc:37
impeller::PathBuilder::AddOval
PathBuilder & AddOval(const Rect &rect)
Definition: path_builder.cc:322