39constexpr static int kMaxChopsPerCurve = 128 *
49 : fTessellationPrecision(tessellationPrecision)
50 , fCullTest(viewport,
matrix)
61 void quadTo(
const SkPoint quad[3]) {
64 fPointStack.push_back_n(3, quad);
66 while (!fPointStack.empty()) {
67 const SkPoint*
p = fPointStack.end() - 3;
68 if (!fCullTest.areVisible3(
p)) {
75 fPointStack.pop_back_n(3);
76 fPointStack.push_back_n(3, chops+2);
77 fPointStack.push_back_n(3, chops);
83 fPointStack.pop_back_n(3);
91 fPointStack.push_back_n(3,
conic);
92 fWeightStack.push_back(weight);
94 while (!fPointStack.empty()) {
95 const SkPoint*
p = fPointStack.end() - 3;
96 float w = fWeightStack.back();
97 if (!fCullTest.areVisible3(
p)) {
108 fPointStack.pop_back_n(3);
109 fWeightStack.pop_back();
110 fPointStack.push_back_n(3, chops[1].
fPts);
111 fWeightStack.push_back(chops[1].fW);
112 fPointStack.push_back_n(3, chops[0].
fPts);
113 fWeightStack.push_back(chops[0].fW);
119 fPointStack.pop_back_n(3);
120 fWeightStack.pop_back();
128 fPointStack.push_back_n(4,
cubic);
130 while (!fPointStack.empty()) {
132 if (!fCullTest.areVisible4(
p)) {
139 fPointStack.pop_back_n(4);
140 fPointStack.push_back_n(4, chops+3);
141 fPointStack.push_back_n(4, chops);
147 fPointStack.pop_back_n(4);
152 const float fTessellationPrecision;
153 const CullTest fCullTest;
154 const wangs_formula::VectorXform fVectorXform;
173 tessellationPrecision,
176 PathChopper chopper(tessellationPrecision,
matrix, viewport);
180 chopper.moveTo(
p[0]);
189 chopper.conicTo(
p, *
w);
200 SkPath chopped = chopper.path();
215 constexpr static float kEpsilon = 1.f / (1 << 11);
217 constexpr static uint32_t kIEEE_one_minus_2_epsilon = (127 << 23) - 2 * (1 << (24 - 11));
222 float2 p0 = sk_bit_cast<float2>(pts[0]);
223 float2 p1 = sk_bit_cast<float2>(pts[1]);
224 float2 p2 = sk_bit_cast<float2>(pts[2]);
225 float2 p3 = sk_bit_cast<float2>(pts[3]);
252 float b_over_minus_2 = -.5f *
b;
253 float discr_over_4 = b_over_minus_2*b_over_minus_2 -
a*c;
259 cuspThreshold *= cuspThreshold;
261 if (discr_over_4 < -cuspThreshold) {
277 if (sk_bit_cast<uint32_t>(
root -
kEpsilon) < kIEEE_one_minus_2_epsilon) {
284 *areCusps = (discr_over_4 <= cuspThreshold);
287 if (
a != 0 || b_over_minus_2 != 0 || c != 0) {
291 if (sk_bit_cast<uint32_t>(
root -
kEpsilon) < kIEEE_one_minus_2_epsilon) {
310 b_over_minus_2 = -
dot(tan0,
B);
312 discr_over_4 =
std::max(b_over_minus_2*b_over_minus_2 -
a*c, 0.f);
317 float q = sqrtf(discr_over_4);
318 q = copysignf(q, b_over_minus_2);
319 q = q + b_over_minus_2;
static constexpr float sk_ieee_float_divide(float numer, float denom)
static constexpr double kEpsilon
void SkChopCubicAtHalf(const SkPoint src[4], SkPoint dst[7])
void SkChopQuadAtHalf(const SkPoint src[3], SkPoint dst[5])
@ kClose
SkPath::RawIter returns 0 points.
@ kCubic
SkPath::RawIter returns 4 points.
@ kConic
SkPath::RawIter returns 3 points + 1 weight.
@ kQuad
SkPath::RawIter returns 3 points.
@ kMove
SkPath::RawIter returns 1 point.
@ kLine
SkPath::RawIter returns 2 points.
SkPath & moveTo(SkScalar x, SkScalar y)
void setFillType(SkPathFillType ft)
SkPath & lineTo(SkScalar x, SkScalar y)
SkPath & setIsVolatile(bool isVolatile)
SkPath & quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
SkPath & conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
static float max(float r, float g, float b)
unsigned useCenter Optional< SkMatrix > matrix
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
int64_t cross(Point d0, Point d1)
static constexpr float kMaxSegmentsPerCurve_p4
SkPath PreChopPathCurves(float tessellationPrecision, const SkPath &path, const SkMatrix &matrix, const SkRect &viewport)
static constexpr float kMaxSegmentsPerCurve_p2
static constexpr float kMaxSegmentsPerCurve
int FindCubicConvex180Chops(const SkPoint pts[], float T[2], bool *areCusps)
SINT T dot(const Vec< N, T > &a, const Vec< N, T > &b)
SIT Vec< 1, T > if_then_else(const Vec< 1, M< T > > &cond, const Vec< 1, T > &t, const Vec< 1, T > &e)
constexpr float height() const
constexpr float width() const