20 if (limit1 < limit0) {
29 }
else if (
value > limit1) {
43 double X0 =
src[0].fX;
44 double Y0 =
src[0].fY;
45 double X1 =
src[1].fX;
46 double Y1 =
src[1].fY;
47 double result = X0 + ((double)
Y - Y0) * (X1 - X0) / (Y1 - Y0);
64 double X0 =
src[0].fX;
65 double Y0 =
src[0].fY;
66 double X1 =
src[1].fX;
67 double Y1 =
src[1].fY;
68 double result = Y0 + ((double)
X - X0) * (Y1 - Y0) / (X1 - X0);
85 return a <=
b && (a < b || dim > 0);
118 if (
src[0].fY <
src[1].fY) {
127 memcpy(tmp,
src,
sizeof(tmp));
130 if (tmp[index0].fY <
clip.fTop) {
133 if (tmp[index1].fY >
clip.fBottom) {
137 if (tmp[0].fX < tmp[1].fX) {
146 if ((tmp[index1].fX <=
clip.fLeft || tmp[index0].
fX >=
clip.fRight)) {
149 if (tmp[0].fX != tmp[1].fX || tmp[0].fX <
clip.fLeft || tmp[0].
fX >
clip.fRight) {
154 if (tmp[index0].fX <
clip.fLeft) {
157 if (tmp[index1].fX >
clip.fRight) {
161 bounds.set(tmp[0], tmp[1]);
164 memcpy(
dst, tmp,
sizeof(tmp));
173 if (limit0 < limit1) {
182 bool canCullToTheRight) {
185 if (pts[0].fY < pts[1].fY) {
195 if (pts[index1].fY <=
clip.fTop) {
198 if (pts[index0].fY >=
clip.fBottom) {
205 memcpy(tmp, pts,
sizeof(tmp));
208 if (pts[index0].fY <
clip.fTop) {
210 SkASSERT(is_between_unsorted(tmp[index0].fX, pts[0].fX, pts[1].fX));
212 if (tmp[index1].fY >
clip.fBottom) {
214 SkASSERT(is_between_unsorted(tmp[index1].fX, pts[0].fX, pts[1].fX));
225 if (pts[0].fX < pts[1].fX) {
235 if (tmp[index1].fX <=
clip.fLeft) {
239 }
else if (tmp[index0].fX >=
clip.fRight) {
240 if (canCullToTheRight) {
243 tmp[0].
fX = tmp[1].
fX =
clip.fRight;
250 if (tmp[index0].fX <
clip.fLeft) {
260 if (tmp[index1].fX >
clip.fRight) {
275 for (
int i = 0;
i <= lineCount;
i++) {
static SkScalar sect_with_horizontal(const SkPoint src[2], SkScalar Y)
static bool nestedLT(SkScalar a, SkScalar b, SkScalar dim)
T pin_unsorted(T value, T limit0, T limit1)
static SkScalar sect_with_vertical(const SkPoint src[2], SkScalar X)
static SkScalar sect_clamp_with_vertical(const SkPoint src[2], SkScalar x)
static bool containsNoEmptyCheck(const SkRect &outer, const SkRect &inner)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
void swap(sk_sp< T > &a, sk_sp< T > &b)
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
#define SkScalarAve(a, b)
constexpr int SkToInt(S x)
static bool IntersectLine(const SkPoint src[2], const SkRect &clip, SkPoint dst[2])
static int ClipLine(const SkPoint pts[2], const SkRect &clip, SkPoint lines[kMaxPoints], bool canCullToTheRight)
Optional< SkRect > bounds
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
void set(float x, float y)
SkScalar fBottom
larger y-axis bounds
SkScalar fLeft
smaller x-axis bounds
SkScalar fRight
larger x-axis bounds
SkScalar fTop
smaller y-axis bounds