| Flutter Impeller |

path_builder.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_TOOLKIT_INTEROP_PATH_BUILDER_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_PATH_BUILDER_H_
7
8 #include "flutter/third_party/skia/include/core/SkPath.h"
9 #include "impeller/geometry/path_source.h"
10 #include "impeller/geometry/point.h"
11 #include "impeller/geometry/rect.h"
12 #include "impeller/geometry/rounding_radii.h"
13 #include "impeller/toolkit/interop/impeller.h"
14 #include "impeller/toolkit/interop/object.h"
15 #include "impeller/toolkit/interop/path.h"
16
17 namespace impeller::interop {
18
19 class PathBuilder final
20 : public Object<PathBuilder,
21 IMPELLER_INTERNAL_HANDLE_NAME(ImpellerPathBuilder)> {
22 public:
23 PathBuilder();
24
25 ~PathBuilder();
26
27 PathBuilder(const PathBuilder&) = delete;
28
29 PathBuilder& operator=(const PathBuilder&) = delete;
30
31 void MoveTo(const Point& point);
32
33 void LineTo(const Point& location);
34
35 void QuadraticCurveTo(const Point& control_point, const Point& end_point);
36
37 void CubicCurveTo(const Point& control_point_1,
38 const Point& control_point_2,
39 const Point& end_point);
40
41 void AddRect(const Rect& rect);
42
43 void AddArc(const Rect& oval_bounds, Degrees start_angle, Degrees end_angle);
44
45 void AddOval(const Rect& oval_bounds);
46
47 void AddRoundedRect(const Rect& rect, const RoundingRadii& radii);
48
49 void Close();
50
51 ScopedObject<Path> TakePath(FillType fill);
52
53 ScopedObject<Path> CopyPath(FillType fill);
54
55 private:
56 SkPath builder_;
57 };
58
59 } // namespace impeller::interop
60
61 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_PATH_BUILDER_H_
impeller::interop::Object
Definition: object.h:56
impeller::interop::PathBuilder
Definition: path_builder.h:21
impeller::interop::PathBuilder::CopyPath
ScopedObject< Path > CopyPath(FillType fill)
Definition: path_builder.cc:67
impeller::interop::PathBuilder::~PathBuilder
~PathBuilder()
impeller::interop::PathBuilder::AddArc
void AddArc(const Rect &oval_bounds, Degrees start_angle, Degrees end_angle)
Definition: path_builder.cc:41
impeller::interop::PathBuilder::MoveTo
void MoveTo(const Point &point)
Definition: path_builder.cc:15
impeller::interop::PathBuilder::LineTo
void LineTo(const Point &location)
Definition: path_builder.cc:19
impeller::interop::PathBuilder::AddOval
void AddOval(const Rect &oval_bounds)
Definition: path_builder.cc:50
impeller::interop::PathBuilder::AddRoundedRect
void AddRoundedRect(const Rect &rect, const RoundingRadii &radii)
Definition: path_builder.cc:54
impeller::interop::PathBuilder::operator=
PathBuilder & operator=(const PathBuilder &)=delete
impeller::interop::PathBuilder::QuadraticCurveTo
void QuadraticCurveTo(const Point &control_point, const Point &end_point)
Definition: path_builder.cc:23
impeller::interop::PathBuilder::Close
void Close()
Definition: path_builder.cc:58
impeller::interop::PathBuilder::PathBuilder
PathBuilder()
impeller::interop::PathBuilder::CubicCurveTo
void CubicCurveTo(const Point &control_point_1, const Point &control_point_2, const Point &end_point)
Definition: path_builder.cc:28
impeller::interop::PathBuilder::TakePath
ScopedObject< Path > TakePath(FillType fill)
Definition: path_builder.cc:62
impeller::interop::PathBuilder::PathBuilder
PathBuilder(const PathBuilder &)=delete
impeller::interop::PathBuilder::AddRect
void AddRect(const Rect &rect)
Definition: path_builder.cc:37
impeller::interop::ScopedObject
Definition: object.h:67
impeller.h
impeller::interop
Definition: context_gles.cc:12
impeller::FillType
FillType
Definition: path_source.h:13
object.h
path.h
path_source.h
point.h
rect.h
rounding_radii.h
impeller::Degrees
Definition: scalar.h:76
impeller::RoundingRadii
Definition: rounding_radii.h:14
impeller::TPoint< Scalar >
impeller::TRect< Scalar >