blob: dcd65b985a1b51ad287712fdb72fed465865aa09 [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_IMPELLER_GEOMETRY_STROKE_PARAMETERS_H_
#define FLUTTER_IMPELLER_GEOMETRY_STROKE_PARAMETERS_H_
#include "flutter/impeller/geometry/scalar.h"
namespace impeller {
/// @brief An enum that describes ways to decorate the end of a path contour.
enum class Cap {
kButt,
kRound,
kSquare,
};
/// @brief An enum that describes ways to join two segments of a path.
enum class Join {
kMiter,
kRound,
kBevel,
};
/// @brief A structure to store all of the parameters related to stroking
/// a path or basic geometry object.
struct StrokeParameters {
Scalar width = 0.0f;
Cap cap = Cap::kButt;
Join join = Join::kMiter;
Scalar miter_limit = 4.0f;
constexpr bool operator==(const StrokeParameters& parameters) const {
return parameters.width == width && parameters.cap == cap &&
parameters.join == join && parameters.miter_limit == miter_limit;
}
constexpr bool operator!=(const StrokeParameters& parameters) const {
return !(*this == parameters);
}
};
} // namespace impeller
#endif // FLUTTER_IMPELLER_GEOMETRY_STROKE_PARAMETERS_H_