#include "third_party/blink/renderer/platform/graphics/path.h"
#include <math.h>
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/graphics/stroke_data.h"
#include "third_party/blink/renderer/platform/transforms/affine_transform.h"
#include "third_party/blink/renderer/platform/wtf/math_extras.h"
#include "third_party/skia/include/pathops/SkPathOps.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/quad_f.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/skia_conversions.h"
namespace blink {
namespace {
bool PathQuadIntersection(const SkPath& path, const gfx::QuadF& quad) { … }
}
Path::Path() : … { … }
Path::Path(const Path& other) : … { … }
Path::Path(const SkPath& other) : … { … }
Path::~Path() = default;
Path& Path::operator=(const Path& other) { … }
Path& Path::operator=(const SkPath& other) { … }
bool Path::operator==(const Path& other) const { … }
bool Path::Contains(const gfx::PointF& point) const { … }
bool Path::Contains(const gfx::PointF& point, WindRule rule) const { … }
bool Path::Intersects(const gfx::QuadF& quad) const { … }
bool Path::Intersects(const gfx::QuadF& quad, WindRule rule) const { … }
SkPath Path::StrokePath(const StrokeData& stroke_data,
const AffineTransform& transform) const { … }
SkPath Path::StrokePath(const StrokeData& stroke_data,
float stroke_precision) const { … }
bool Path::StrokeContains(const gfx::PointF& point,
const StrokeData& stroke_data,
const AffineTransform& transform) const { … }
gfx::RectF Path::TightBoundingRect() const { … }
gfx::RectF Path::BoundingRect() const { … }
gfx::RectF Path::StrokeBoundingRect(const StrokeData& stroke_data) const { … }
static base::span<gfx::PointF> ConvertPathPoints(
std::array<gfx::PointF, 3>& dst,
base::span<const SkPoint> src) { … }
void Path::Apply(void* info, PathApplierFunction function) const { … }
Path& Path::Transform(const AffineTransform& xform) { … }
Path& Path::Transform(const gfx::Transform& transform) { … }
float Path::length() const { … }
gfx::PointF Path::PointAtLength(float length) const { … }
static std::optional<PointAndTangent> CalculatePointAndNormalOnPath(
SkPathMeasure& measure,
SkScalar& contour_start,
SkScalar length) { … }
PointAndTangent Path::PointAndNormalAtLength(float length) const { … }
Path::PositionCalculator::PositionCalculator(const Path& path)
: … { … }
PointAndTangent Path::PositionCalculator::PointAndNormalAtLength(float length) { … }
void Path::Clear() { … }
bool Path::IsEmpty() const { … }
bool Path::IsClosed() const { … }
bool Path::IsLine() const { … }
void Path::SetIsVolatile(bool is_volatile) { … }
bool Path::HasCurrentPoint() const { … }
gfx::PointF Path::CurrentPoint() const { … }
void Path::SetWindRule(const WindRule rule) { … }
void Path::MoveTo(const gfx::PointF& point) { … }
void Path::AddLineTo(const gfx::PointF& point) { … }
void Path::AddQuadCurveTo(const gfx::PointF& cp, const gfx::PointF& ep) { … }
void Path::AddBezierCurveTo(const gfx::PointF& p1,
const gfx::PointF& p2,
const gfx::PointF& ep) { … }
void Path::AddArcTo(const gfx::PointF& p1,
const gfx::PointF& p2,
float radius) { … }
void Path::AddArcTo(const gfx::PointF& p,
float radius_x,
float radius_y,
float x_rotate,
bool large_arc,
bool sweep) { … }
void Path::CloseSubpath() { … }
void Path::AddEllipse(const gfx::PointF& p,
float radius_x,
float radius_y,
float start_angle,
float end_angle) { … }
void Path::AddArc(const gfx::PointF& p,
float radius,
float start_angle,
float end_angle) { … }
void Path::AddRect(const gfx::RectF& rect) { … }
void Path::AddRect(const gfx::PointF& origin,
const gfx::PointF& opposite_point) { … }
void Path::AddEllipse(const gfx::PointF& p,
float radius_x,
float radius_y,
float rotation,
float start_angle,
float end_angle) { … }
void Path::AddEllipse(const gfx::PointF& center,
float radius_x,
float radius_y) { … }
void Path::AddRoundedRect(const FloatRoundedRect& rect, bool clockwise) { … }
void Path::AddPath(const Path& src, const AffineTransform& transform) { … }
void Path::Translate(const gfx::Vector2dF& offset) { … }
bool Path::SubtractPath(const Path& other) { … }
bool Path::UnionPath(const Path& other) { … }
bool EllipseIsRenderable(float start_angle, float end_angle) { … }
}