Flutter Impeller
stroke_parameters.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_GEOMETRY_STROKE_PARAMETERS_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_STROKE_PARAMETERS_H_
7 
9 
10 namespace impeller {
11 
12 /// @brief An enum that describes ways to decorate the end of a path contour.
13 enum class Cap {
14  kButt,
15  kRound,
16  kSquare,
17 };
18 
19 /// @brief An enum that describes ways to join two segments of a path.
20 enum class Join {
21  kMiter,
22  kRound,
23  kBevel,
24 };
25 
26 /// @brief A structure to store all of the parameters related to stroking
27 /// a path or basic geometry object.
29  Scalar width = 0.0f;
33 
34  constexpr bool operator==(const StrokeParameters& parameters) const {
35  return parameters.width == width && parameters.cap == cap &&
36  parameters.join == join && parameters.miter_limit == miter_limit;
37  }
38 
39  constexpr bool operator!=(const StrokeParameters& parameters) const {
40  return !(*this == parameters);
41  }
42 };
43 
44 } // namespace impeller
45 
46 #endif // FLUTTER_IMPELLER_GEOMETRY_STROKE_PARAMETERS_H_
Join
An enum that describes ways to join two segments of a path.
float Scalar
Definition: scalar.h:19
Cap
An enum that describes ways to decorate the end of a path contour.
A structure to store all of the parameters related to stroking a path or basic geometry object.
constexpr bool operator!=(const StrokeParameters &parameters) const
constexpr bool operator==(const StrokeParameters &parameters) const