#include "src/gpu/ganesh/geometry/GrPathUtils.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkRect.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkFloatingPoint.h"
#include "src/core/SkGeometry.h"
#include "src/core/SkPathEnums.h"
#include "src/core/SkPointPriv.h"
#include "src/gpu/tessellate/WangsFormula.h"
#include <algorithm>
usingnamespaceskia_private;
static const SkScalar kMinCurveTol = …;
static float tolerance_to_wangs_precision(float srcTol) { … }
uint32_t max_bezier_vertices(uint32_t chopCount) { … }
SkScalar GrPathUtils::scaleToleranceToSrc(SkScalar devTol,
const SkMatrix& viewM,
const SkRect& pathBounds) { … }
uint32_t GrPathUtils::quadraticPointCount(const SkPoint points[], SkScalar tol) { … }
uint32_t GrPathUtils::generateQuadraticPoints(const SkPoint& p0,
const SkPoint& p1,
const SkPoint& p2,
SkScalar tolSqd,
SkPoint** points,
uint32_t pointsLeft) { … }
uint32_t GrPathUtils::cubicPointCount(const SkPoint points[], SkScalar tol) { … }
uint32_t GrPathUtils::generateCubicPoints(const SkPoint& p0,
const SkPoint& p1,
const SkPoint& p2,
const SkPoint& p3,
SkScalar tolSqd,
SkPoint** points,
uint32_t pointsLeft) { … }
void GrPathUtils::QuadUVMatrix::set(const SkPoint qPts[3]) { … }
void GrPathUtils::getConicKLM(const SkPoint p[3], const SkScalar weight, SkMatrix* out) { … }
namespace {
bool is_point_within_cubic_tangents(const SkPoint& a,
const SkVector& ab,
const SkVector& dc,
const SkPoint& d,
SkPathFirstDirection dir,
const SkPoint p) { … }
void convert_noninflect_cubic_to_quads(const SkPoint p[4],
SkScalar toleranceSqd,
TArray<SkPoint, true>* quads,
int sublevel = 0,
bool preserveFirstTangent = true,
bool preserveLastTangent = true) { … }
void convert_noninflect_cubic_to_quads_with_constraint(const SkPoint p[4],
SkScalar toleranceSqd,
SkPathFirstDirection dir,
TArray<SkPoint, true>* quads,
int sublevel = 0) { … }
}
void GrPathUtils::convertCubicToQuads(const SkPoint p[4],
SkScalar tolScale,
TArray<SkPoint, true>* quads) { … }
void GrPathUtils::convertCubicToQuadsConstrainToTangents(const SkPoint p[4],
SkScalar tolScale,
SkPathFirstDirection dir,
TArray<SkPoint, true>* quads) { … }