#include "src/gpu/ganesh/geometry/GrQuadUtils.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkFloatingPoint.h"
#include "include/private/base/SkMacros.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/base/SkVx.h"
#include "src/core/SkPathPriv.h"
#include "src/gpu/ganesh/geometry/GrQuad.h"
#include <algorithm>
#include <cmath>
float4;
mask4;
#define AI …
static constexpr float kTolerance = …;
static constexpr float kDistTolerance = …;
static constexpr float kDist2Tolerance = …;
static constexpr float kInvDistTolerance = …;
template<typename T>
static AI skvx::Vec<4, T> next_cw(const skvx::Vec<4, T>& v) { … }
template<typename T>
static AI skvx::Vec<4, T> next_ccw(const skvx::Vec<4, T>& v) { … }
static AI float4 next_diag(const float4& v) { … }
static AI void correct_bad_edges(const mask4& bad, float4* e1, float4* e2, float4* e3) { … }
static AI void correct_bad_coords(const mask4& bad, float4* c1, float4* c2, float4* c3) { … }
static void interpolate_local(float alpha, int v0, int v1, int v2, int v3,
float lx[4], float ly[4], float lw[4]) { … }
static bool crop_rect_edge(const SkRect& clipDevRect, int v0, int v1, int v2, int v3,
float x[4], float y[4], float lx[4], float ly[4], float lw[4]) { … }
static GrQuadAAFlags crop_rect(const SkRect& clipDevRect, float x[4], float y[4],
float lx[4], float ly[4], float lw[4]) { … }
static GrQuadAAFlags crop_simple_rect(const SkRect& clipDevRect, float x[4], float y[4],
float lx[4], float ly[4]) { … }
static bool is_simple_rect(const GrQuad& quad) { … }
static bool barycentric_coords(float x0, float y0, float x1, float y1, float x2, float y2,
const float4& testX, const float4& testY,
float4* u, float4* v, float4* w) { … }
static mask4 inside_triangle(const float4& u, const float4& v, const float4& w) { … }
SkRect GrQuad::projectedBounds() const { … }
namespace GrQuadUtils {
void ResolveAAType(GrAAType requestedAAType, GrQuadAAFlags requestedEdgeFlags, const GrQuad& quad,
GrAAType* outAAType, GrQuadAAFlags* outEdgeFlags) { … }
int ClipToW0(DrawQuad* quad, DrawQuad* extraVertices) { … }
bool CropToRect(const SkRect& cropRect, GrAA cropAA, DrawQuad* quad, bool computeLocal) { … }
bool WillUseHairline(const GrQuad& quad, GrAAType aaType, GrQuadAAFlags edgeFlags) { … }
void TessellationHelper::EdgeVectors::reset(const skvx::Vec<4, float>& xs,
const skvx::Vec<4, float>& ys,
const skvx::Vec<4, float>& ws,
GrQuad::Type quadType) { … }
void TessellationHelper::EdgeEquations::reset(const EdgeVectors& edgeVectors) { … }
float4 TessellationHelper::EdgeEquations::estimateCoverage(const float4& x2d,
const float4& y2d) const { … }
bool TessellationHelper::EdgeEquations::isSubpixel(const float4& x2d, const float4& y2d) const { … }
int TessellationHelper::EdgeEquations::computeDegenerateQuad(const float4& signedEdgeDistances,
float4* x2d, float4* y2d,
mask4* aaMask) const { … }
void TessellationHelper::OutsetRequest::reset(const EdgeVectors& edgeVectors, GrQuad::Type quadType,
const skvx::Vec<4, float>& edgeDistances) { … }
void TessellationHelper::Vertices::reset(const GrQuad& deviceQuad, const GrQuad* localQuad) { … }
void TessellationHelper::Vertices::asGrQuads(GrQuad* deviceOut, GrQuad::Type deviceType,
GrQuad* localOut, GrQuad::Type localType) const { … }
void TessellationHelper::Vertices::moveAlong(const EdgeVectors& edgeVectors,
const float4& signedEdgeDistances) { … }
void TessellationHelper::Vertices::moveTo(const float4& x2d, const float4& y2d, const mask4& mask) { … }
void TessellationHelper::reset(const GrQuad& deviceQuad, const GrQuad* localQuad) { … }
float4 TessellationHelper::inset(const skvx::Vec<4, float>& edgeDistances,
GrQuad* deviceInset, GrQuad* localInset) { … }
void TessellationHelper::outset(const skvx::Vec<4, float>& edgeDistances,
GrQuad* deviceOutset, GrQuad* localOutset) { … }
void TessellationHelper::getEdgeEquations(skvx::Vec<4, float>* a,
skvx::Vec<4, float>* b,
skvx::Vec<4, float>* c) { … }
skvx::Vec<4, float> TessellationHelper::getEdgeLengths() { … }
const TessellationHelper::OutsetRequest& TessellationHelper::getOutsetRequest(
const skvx::Vec<4, float>& edgeDistances) { … }
bool TessellationHelper::isSubpixel() { … }
const TessellationHelper::EdgeEquations& TessellationHelper::getEdgeEquations() { … }
void TessellationHelper::adjustVertices(const skvx::Vec<4, float>& signedEdgeDistances,
Vertices* vertices) { … }
int TessellationHelper::adjustDegenerateVertices(const skvx::Vec<4, float>& signedEdgeDistances,
Vertices* vertices) { … }
}