Searched defs:SkTMax (Results 1 - 6 of 6) sorted by relevance

/external/chromium_org/third_party/skia/experimental/Intersection/
H A DDataTypes.h20 template <typename T> inline T SkTMax(T a, T b) { function
283 double denom = SkTMax(fabs(x), SkTMax(fabs(y), SkTMax(fabs(a.x), fabs(a.y))));
292 double denom = SkTMax(fabs(x), SkTMax(fabs(y), SkTMax(fabs(a.fX), fabs(a.fY))));
301 double denom = SkTMax(fabs(x), SkTMax(fabs(y), SkTMax(fab
[all...]
/external/skia/experimental/Intersection/
H A DDataTypes.h20 template <typename T> inline T SkTMax(T a, T b) { function
283 double denom = SkTMax(fabs(x), SkTMax(fabs(y), SkTMax(fabs(a.x), fabs(a.y))));
292 double denom = SkTMax(fabs(x), SkTMax(fabs(y), SkTMax(fabs(a.fX), fabs(a.fY))));
301 double denom = SkTMax(fabs(x), SkTMax(fabs(y), SkTMax(fab
[all...]
/external/chromium_org/third_party/skia/include/core/
H A DSkTypes.h384 template <typename T> const T& SkTMax(const T& a, const T& b) { function
/external/chromium_org/third_party/skia/src/pathops/
H A DSkOpAngle.cpp249 int end = SkTMax(fSectorStart, fSectorEnd);
391 longest = SkTMax(longest, lenSq);
429 smallTs[index] = t = testAscends ? SkTMax(t, testT) : SkTMin(t, testT);
501 maxX = SkTMax(maxX, curve[idx2].fX);
502 maxY = SkTMax(maxY, curve[idx2].fY);
504 double maxWidth = SkTMax(maxX - minX, maxY - minY);
535 int angleEnd = SkTMax(angle->fSectorStart, angle->fSectorEnd);
548 int bestEnd = SkTMax(best->fSectorStart, best->fSectorEnd);
560 bestEnd = SkTMax(angle->fSectorStart, angle->fSectorEnd);
750 int lastEnd = SkTMax(fSectorStar
146 SkASSERT(trOrder < 0); SkDEBUGCODE(bool lrOpposite = lh.oppositePlanes(rh)); bool ltOpposite = lh.oppositePlanes(*this); SkASSERT(lrOpposite != ltOpposite); return COMPARE_RESULT(8, ltOpposite); } else if (ltOrder == 1 && trOrder == 0) { SkASSERT(lrOrder < 0); SkDEBUGCODE(bool ltOpposite = lh.oppositePlanes(*this)); bool trOpposite = oppositePlanes(rh); SkASSERT(ltOpposite != trOpposite); return COMPARE_RESULT(9, trOpposite); } else if (lrOrder == 1 && trOrder == 1) { SkASSERT(ltOrder < 0); SkDEBUGCODE(bool trOpposite = oppositePlanes(rh)); bool lrOpposite = lh.oppositePlanes(rh); SkASSERT(lrOpposite != trOpposite); return COMPARE_RESULT(10, lrOpposite); } if (lrOrder < 0) { if (ltOrder < 0) { return COMPARE_RESULT(11, trOrder); } return COMPARE_RESULT(12, ltOrder); } return COMPARE_RESULT(13, !lrOrder); } int SkOpAngle::allOnOneSide(const SkOpAngle& test) const { SkASSERT(!fIsCurve); SkASSERT(test.fIsCurve); const SkDPoint& origin = test.fCurvePart[0]; SkVector line; if (fSegment->verb() == SkPath::kLine_Verb) { const SkPoint* linePts = fSegment->pts(); int lineStart = fStart < fEnd ? 0 : 1; line = linePts[lineStart ^ 1] - linePts[lineStart]; } else { SkPoint shortPts[2] = { fCurvePart[0].asSkPoint(), fCurvePart[1].asSkPoint() }; line = shortPts[1] - shortPts[0]; } float crosses[3]; SkPath::Verb testVerb = test.fSegment->verb(); int iMax = SkPathOpsVerbToPoints(testVerb); const SkDCubic& testCurve = test.fCurvePart; for (int index = 1; index <= iMax; ++index) { float xy1 = (float) (line.fX * (testCurve[index].fY - origin.fY)); float xy2 = (float) (line.fY * (testCurve[index].fX - origin.fX)); crosses[index - 1] = AlmostEqualUlps(xy1, xy2) ? 0 : xy1 - xy2; } if (crosses[0] * crosses[1] < 0) { return -1; } if (SkPath::kCubic_Verb == testVerb) { if (crosses[0] * crosses[2] < 0 || crosses[1] * crosses[2] < 0) { return -1; } } if (crosses[0]) { return crosses[0] < 0; } if (crosses[1]) { return crosses[1] < 0; } if (SkPath::kCubic_Verb == testVerb && crosses[2]) { return crosses[2] < 0; } fUnorderable = true; return -1; } bool SkOpAngle::calcSlop(double x, double y, double rx, double ry, bool* result) const { double absX = fabs(x); double absY = fabs(y); double length = absX < absY ? absX / 2 + absY : absX + absY / 2; int exponent; (void) frexp(length, &exponent); double epsilon = ldexp(FLT_EPSILON, exponent); SkPath::Verb verb = fSegment->verb(); SkASSERT(verb == SkPath::kQuad_Verb || verb == SkPath::kCubic_Verb); double slop = verb == SkPath::kQuad_Verb ? 4 * epsilon : 512 * epsilon; double xSlop = slop; double ySlop = x * y < 0 ? -xSlop : xSlop; double x1 = x - xSlop; double y1 = y + ySlop; double x_ry1 = x1 * ry; double rx_y1 = rx * y1; *result = x_ry1 < rx_y1; double x2 = x + xSlop; double y2 = y - ySlop; double x_ry2 = x2 * ry; double rx_y2 = rx * y2; bool less2 = x_ry2 < rx_y2; return *result == less2; } bool SkOpAngle::checkCrossesZero() const { int start = SkTMin(fSectorStart, fSectorEnd); int end = SkTMax(fSectorStart, fSectorEnd); bool crossesZero = end - start > 16; return crossesZero; } bool SkOpAngle::checkParallel(const SkOpAngle& rh) const { SkDVector scratch[2]; const SkDVector* sweep, * tweep; if (!fUnorderedSweep) { sweep = fSweep; } else { scratch[0] = fCurvePart[1] - fCurvePart[0]; sweep = &scratch[0]; } if (!rh.fUnorderedSweep) { tweep = rh.fSweep; } else { scratch[1] = rh.fCurvePart[1] - rh.fCurvePart[0]; tweep = &scratch[1]; } double s0xt0 = sweep->crossCheck(*tweep); if (tangentsDiverge(rh, s0xt0)) { return s0xt0 < 0; } SkDVector m0 = fSegment->dPtAtT(midT()) - fCurvePart[0]; SkDVector m1 = rh.fSegment->dPtAtT(rh.midT()) - rh.fCurvePart[0]; double m0xm1 = m0.crossCheck(m1); if (m0xm1 == 0) { fUnorderable = true; rh.fUnorderable = true; return true; } return m0xm1 < 0; } bool SkOpAngle::computeSector() { if (fComputedSector) { return !fUnorderable; } fComputedSector = true; int step = fStart < fEnd ? 1 : -1; int limit = step > 0 ? fSegment->count() : -1; int checkEnd = fEnd; do { const SkOpSpan& span = fSegment->span(checkEnd); const SkOpSegment* other = span.fOther; int oCount = other->count(); for (int oIndex = 0; oIndex < oCount; ++oIndex) { const SkOpSpan& oSpan = other->span(oIndex); if (oSpan.fOther != fSegment) { continue; } if (oSpan.fOtherIndex == checkEnd) { continue; } if (!approximately_equal(oSpan.fOtherT, span.fT)) { continue; } goto recomputeSector; } checkEnd += step; } while (checkEnd != limit); recomputeSector: if (checkEnd == fEnd || checkEnd - step == fEnd) { fUnorderable = true; return false; } int saveEnd = fEnd; fComputedEnd = fEnd = checkEnd - step; setSpans(); setSector(); fEnd = saveEnd; return !fUnorderable; } int SkOpAngle::convexHullOverlaps(const SkOpAngle& rh) const { const SkDVector* sweep = fSweep; const SkDVector* tweep = rh.fSweep; double s0xs1 = sweep[0].crossCheck(sweep[1]); double s0xt0 = sweep[0].crossCheck(tweep[0]); double s1xt0 = sweep[1].crossCheck(tweep[0]); bool tBetweenS = s0xs1 > 0 ? s0xt0 > 0 && s1xt0 < 0 : s0xt0 < 0 && s1xt0 > 0; double s0xt1 = sweep[0].crossCheck(tweep[1]); double s1xt1 = sweep[1].crossCheck(tweep[1]); tBetweenS |= s0xs1 > 0 ? s0xt1 > 0 && s1xt1 < 0 : s0xt1 < 0 && s1xt1 > 0; double t0xt1 = tweep[0].crossCheck(tweep[1]); if (tBetweenS) { return -1; } if ((s0xt0 == 0 && s1xt1 == 0) || (s1xt0 == 0 && s0xt1 == 0)) { return -1; } bool sBetweenT = t0xt1 > 0 ? s0xt0 < 0 && s0xt1 > 0 : s0xt0 > 0 && s0xt1 < 0; sBetweenT |= t0xt1 > 0 ? s1xt0 < 0 && s1xt1 > 0 : s1xt0 > 0 && s1xt1 < 0; if (sBetweenT) { return -1; } if (s0xt0 >= 0 && s0xt1 >= 0 && s1xt0 >= 0 && s1xt1 >= 0) argument
[all...]
/external/skia/include/core/
H A DSkTypes.h378 template <typename T> const T& SkTMax(const T& a, const T& b) { function
/external/skia/src/pathops/
H A DSkOpAngle.cpp249 int end = SkTMax(fSectorStart, fSectorEnd);
394 longest = SkTMax(longest, lenSq);
432 smallTs[index] = t = testAscends ? SkTMax(t, testT) : SkTMin(t, testT);
504 maxX = SkTMax(maxX, curve[idx2].fX);
505 maxY = SkTMax(maxY, curve[idx2].fY);
507 double maxWidth = SkTMax(maxX - minX, maxY - minY);
538 int angleEnd = SkTMax(angle->fSectorStart, angle->fSectorEnd);
551 int bestEnd = SkTMax(best->fSectorStart, best->fSectorEnd);
563 bestEnd = SkTMax(angle->fSectorStart, angle->fSectorEnd);
753 int lastEnd = SkTMax(fSectorStar
146 SkASSERT(trOrder < 0); SkDEBUGCODE(bool lrOpposite = lh.oppositePlanes(rh)); bool ltOpposite = lh.oppositePlanes(*this); SkASSERT(lrOpposite != ltOpposite); return COMPARE_RESULT(8, ltOpposite); } else if (ltOrder == 1 && trOrder == 0) { SkASSERT(lrOrder < 0); SkDEBUGCODE(bool ltOpposite = lh.oppositePlanes(*this)); bool trOpposite = oppositePlanes(rh); SkASSERT(ltOpposite != trOpposite); return COMPARE_RESULT(9, trOpposite); } else if (lrOrder == 1 && trOrder == 1) { SkASSERT(ltOrder < 0); SkDEBUGCODE(bool trOpposite = oppositePlanes(rh)); bool lrOpposite = lh.oppositePlanes(rh); SkASSERT(lrOpposite != trOpposite); return COMPARE_RESULT(10, lrOpposite); } if (lrOrder < 0) { if (ltOrder < 0) { return COMPARE_RESULT(11, trOrder); } return COMPARE_RESULT(12, ltOrder); } return COMPARE_RESULT(13, !lrOrder); } int SkOpAngle::allOnOneSide(const SkOpAngle& test) const { SkASSERT(!fIsCurve); SkASSERT(test.fIsCurve); const SkDPoint& origin = test.fCurvePart[0]; SkVector line; if (fSegment->verb() == SkPath::kLine_Verb) { const SkPoint* linePts = fSegment->pts(); int lineStart = fStart < fEnd ? 0 : 1; line = linePts[lineStart ^ 1] - linePts[lineStart]; } else { SkPoint shortPts[2] = { fCurvePart[0].asSkPoint(), fCurvePart[1].asSkPoint() }; line = shortPts[1] - shortPts[0]; } float crosses[3]; SkPath::Verb testVerb = test.fSegment->verb(); int iMax = SkPathOpsVerbToPoints(testVerb); const SkDCubic& testCurve = test.fCurvePart; for (int index = 1; index <= iMax; ++index) { float xy1 = (float) (line.fX * (testCurve[index].fY - origin.fY)); float xy2 = (float) (line.fY * (testCurve[index].fX - origin.fX)); crosses[index - 1] = AlmostEqualUlps(xy1, xy2) ? 0 : xy1 - xy2; } if (crosses[0] * crosses[1] < 0) { return -1; } if (SkPath::kCubic_Verb == testVerb) { if (crosses[0] * crosses[2] < 0 || crosses[1] * crosses[2] < 0) { return -1; } } if (crosses[0]) { return crosses[0] < 0; } if (crosses[1]) { return crosses[1] < 0; } if (SkPath::kCubic_Verb == testVerb && crosses[2]) { return crosses[2] < 0; } fUnorderable = true; return -1; } bool SkOpAngle::calcSlop(double x, double y, double rx, double ry, bool* result) const { double absX = fabs(x); double absY = fabs(y); double length = absX < absY ? absX / 2 + absY : absX + absY / 2; int exponent; (void) frexp(length, &exponent); double epsilon = ldexp(FLT_EPSILON, exponent); SkPath::Verb verb = fSegment->verb(); SkASSERT(verb == SkPath::kQuad_Verb || verb == SkPath::kCubic_Verb); double slop = verb == SkPath::kQuad_Verb ? 4 * epsilon : 512 * epsilon; double xSlop = slop; double ySlop = x * y < 0 ? -xSlop : xSlop; double x1 = x - xSlop; double y1 = y + ySlop; double x_ry1 = x1 * ry; double rx_y1 = rx * y1; *result = x_ry1 < rx_y1; double x2 = x + xSlop; double y2 = y - ySlop; double x_ry2 = x2 * ry; double rx_y2 = rx * y2; bool less2 = x_ry2 < rx_y2; return *result == less2; } bool SkOpAngle::checkCrossesZero() const { int start = SkTMin(fSectorStart, fSectorEnd); int end = SkTMax(fSectorStart, fSectorEnd); bool crossesZero = end - start > 16; return crossesZero; } bool SkOpAngle::checkParallel(const SkOpAngle& rh) const { SkDVector scratch[2]; const SkDVector* sweep, * tweep; if (!fUnorderedSweep) { sweep = fSweep; } else { scratch[0] = fCurvePart[1] - fCurvePart[0]; sweep = &scratch[0]; } if (!rh.fUnorderedSweep) { tweep = rh.fSweep; } else { scratch[1] = rh.fCurvePart[1] - rh.fCurvePart[0]; tweep = &scratch[1]; } double s0xt0 = sweep->crossCheck(*tweep); if (tangentsDiverge(rh, s0xt0)) { return s0xt0 < 0; } SkDVector m0 = fSegment->dPtAtT(midT()) - fCurvePart[0]; SkDVector m1 = rh.fSegment->dPtAtT(rh.midT()) - rh.fCurvePart[0]; double m0xm1 = m0.crossCheck(m1); if (m0xm1 == 0) { fUnorderable = true; rh.fUnorderable = true; return true; } return m0xm1 < 0; } bool SkOpAngle::computeSector() { if (fComputedSector) { return !fUnorderable; } SkASSERT(fSegment->verb() != SkPath::kLine_Verb && small()); fComputedSector = true; int step = fStart < fEnd ? 1 : -1; int limit = step > 0 ? fSegment->count() : -1; int checkEnd = fEnd; do { const SkOpSpan& span = fSegment->span(checkEnd); const SkOpSegment* other = span.fOther; int oCount = other->count(); for (int oIndex = 0; oIndex < oCount; ++oIndex) { const SkOpSpan& oSpan = other->span(oIndex); if (oSpan.fOther != fSegment) { continue; } if (oSpan.fOtherIndex == checkEnd) { continue; } if (!approximately_equal(oSpan.fOtherT, span.fT)) { continue; } goto recomputeSector; } checkEnd += step; } while (checkEnd != limit); recomputeSector: if (checkEnd == fEnd || checkEnd - step == fEnd) { fUnorderable = true; return false; } int saveEnd = fEnd; fComputedEnd = fEnd = checkEnd - step; setSpans(); setSector(); fEnd = saveEnd; return !fUnorderable; } int SkOpAngle::convexHullOverlaps(const SkOpAngle& rh) const { const SkDVector* sweep = fSweep; const SkDVector* tweep = rh.fSweep; double s0xs1 = sweep[0].crossCheck(sweep[1]); double s0xt0 = sweep[0].crossCheck(tweep[0]); double s1xt0 = sweep[1].crossCheck(tweep[0]); bool tBetweenS = s0xs1 > 0 ? s0xt0 > 0 && s1xt0 < 0 : s0xt0 < 0 && s1xt0 > 0; double s0xt1 = sweep[0].crossCheck(tweep[1]); double s1xt1 = sweep[1].crossCheck(tweep[1]); tBetweenS |= s0xs1 > 0 ? s0xt1 > 0 && s1xt1 < 0 : s0xt1 < 0 && s1xt1 > 0; double t0xt1 = tweep[0].crossCheck(tweep[1]); if (tBetweenS) { return -1; } if ((s0xt0 == 0 && s1xt1 == 0) || (s1xt0 == 0 && s0xt1 == 0)) { return -1; } bool sBetweenT = t0xt1 > 0 ? s0xt0 < 0 && s0xt1 > 0 : s0xt0 > 0 && s0xt1 < 0; sBetweenT |= t0xt1 > 0 ? s1xt0 < 0 && s1xt1 > 0 : s1xt0 > 0 && s1xt1 < 0; if (sBetweenT) { return -1; } if (s0xt0 >= 0 && s0xt1 >= 0 && s1xt0 >= 0 && s1xt1 >= 0) argument
[all...]

Completed in 346 milliseconds