Lines Matching refs:bestData
107 bool CachedFrame::checkBetween(BestData* best, Direction direction)
110 BestData test;
159 int CachedFrame::compare(BestData& testData, const BestData& bestData) const
161 if (testData.mNode->tabIndex() != bestData.mNode->tabIndex()) {
162 if (testData.mNode->tabIndex() < bestData.mNode->tabIndex()
163 || (mRoot->mCursor && mRoot->mCursor->tabIndex() < bestData.mNode->tabIndex())) {
172 if (testData.mInNav != bestData.mInNav) {
173 if (bestData.mInNav) {
180 if (bestData.mMajorDelta < testData.mMajorDelta) {
184 if (testData.mMajorDelta < bestData.mMajorDelta)
187 if (testData.mMajorDelta < 0 && bestData.mMajorDelta >= 0) {
191 if ((testData.mMajorDelta ^ bestData.mMajorDelta) < 0) // one above, one below (or one left, one right)
193 bool bestInWorking = bestData.inOrSubsumesWorking();
199 if (testInWorking && bestData.mWorkingOutside && bestData.mNavOutside)
201 bool bestInNav = directionChange() && bestData.inOrSubsumesNav();
208 if (testInNav && bestData.mNavOutside)
212 if (testData.mCursorChild != bestData.mCursorChild) {
213 if (bestData.mCursorChild) {
221 bool testOverlap = bestTestIn || (testData.mWorkingOverlap != 0 && bestData.mWorkingOverlap == 0);
222 bool bestOverlap = bestTestIn || (testData.mWorkingOverlap == 0 && bestData.mWorkingOverlap != 0);
225 if (bestData.mMajorButt < 10 && testData.mMajorButt >= 40) {
229 if (testData.mMajorButt < 10 && bestData.mMajorButt >= 40)
233 if (bestOverlap && bestData.mMajorDelta < testData.mMajorDelta) { // choose closest major axis center
237 if (testOverlap && testData.mMajorDelta < bestData.mMajorDelta)
239 if (bestOverlap && bestData.mMajorDelta2 < testData.mMajorDelta2) {
243 if (testOverlap && testData.mMajorDelta2 < bestData.mMajorDelta2)
246 if (bestOverlap && ((bestData.mSideDistance <= 0 && testData.mSideDistance > 0) ||
247 abs(bestData.mSideDistance) < abs(testData.mSideDistance))) {
251 if (testOverlap && ((testData.mSideDistance <= 0 && bestData.mSideDistance > 0) ||
252 abs(testData.mSideDistance) < abs(bestData.mSideDistance)))
259 SkFixed bestMultiplier = bestData.mWorkingOverlap > bestData.mNavOverlap ?
260 bestData.mWorkingOverlap : bestData.mNavOverlap;
262 int bestDistance = bestData.mDistance;
277 int negative = side < 0 && bestData.mSideDistance > 0;
282 side = bestData.mSideDistance;
300 int best = bestData.mDistance + bestData.mSideDistance;
307 best = bestData.mSideDistance;
315 if (testData.mPreferred < bestData.mPreferred) {
319 if (testData.mPreferred > bestData.mPreferred)
387 BestData testData;
516 BestData testData;
550 void CachedFrame::findClosest(BestData* bestData, Direction originalDirection,
560 child->findClosest(bestData, originalDirection, direction, clip);
623 if (distance < bestData->mDistance) {
624 bestData->mNode = test;
625 bestData->mFrame = this;
626 bestData->mDistance = distance;
628 bestData->setMouseBounds(rect);
629 bestData->setNodeBounds(rect);
633 bestData->setLeftDirection(cachedHistory);
636 bestData->setRightDirection(cachedHistory);
639 bestData->setUpDirection(cachedHistory);
642 bestData->setDownDirection(cachedHistory);
668 const CachedNode* limit, BestData* bestData) const
670 BestData originalData = *bestData;
672 if (moveInFrame(&CachedFrame::frameDown, test, bestData))
674 BestData testData;
675 if (frameNodeCommon(testData, test, bestData, &originalData) == REJECT_TEST)
684 int result = framePartCommon(testData, test, bestData);
688 BestData innerData = testData;
691 *bestData = innerData;
696 *bestData = testData;
699 ASSERT(mRoot->mCursor == NULL || bestData->mNode != mRoot->mCursor);
704 return bestData->mNode;
708 const CachedNode* limit, BestData* bestData) const
710 BestData originalData = *bestData;
712 if (moveInFrame(&CachedFrame::frameLeft, test, bestData))
714 BestData testData;
715 if (frameNodeCommon(testData, test, bestData, &originalData) == REJECT_TEST)
724 int result = framePartCommon(testData, test, bestData);
728 BestData innerData = testData;
731 *bestData = innerData;
736 *bestData = testData;
739 ASSERT(mRoot->mCursor == NULL || bestData->mNode != mRoot->mCursor);
740 return bestData->mNode;
743 int CachedFrame::frameNodeCommon(BestData& testData, const CachedNode* test,
744 BestData* bestData, BestData* originalData) const
782 if (bestData->mNode == NULL)
784 if (mRoot->mCursor && testData.mNode->parentIndex() != bestData->mNode->parentIndex()) {
787 if (bestData->mNode->parentIndex() == cursorParentIndex)
793 if (testData.mNode->parent() == bestData->mNode) {
797 if (testData.mNode == bestData->mNode->parent())
799 int testInBest = testData.isContainer(bestData); /* -1 pick best over test, 0 no containership, 1 pick test over best */
801 if (test->isArea() || bestData->mNode->isArea())
803 bestData->mNode = NULL; // force part tests to be ignored, yet still set up remaining test data for later comparisons
820 int CachedFrame::framePartCommon(BestData& testData,
821 const CachedNode* test, BestData* bestData) const
830 if (bestData->mNode != NULL) {
831 int compared = compare(testData, *bestData);
832 if (compared == 0 && test->isArea() == false && bestData->mNode->isArea() == false)
842 const CachedNode* limit, BestData* bestData) const
844 BestData originalData = *bestData;
846 if (moveInFrame(&CachedFrame::frameRight, test, bestData))
848 BestData testData;
849 if (frameNodeCommon(testData, test, bestData, &originalData) == REJECT_TEST)
858 int result = framePartCommon(testData, test, bestData);
862 BestData innerData = testData;
865 *bestData = innerData;
870 *bestData = testData;
873 ASSERT(mRoot->mCursor == NULL || bestData->mNode != mRoot->mCursor);
874 return bestData->mNode;
878 const CachedNode* limit, BestData* bestData) const
880 BestData originalData = *bestData;
882 if (moveInFrame(&CachedFrame::frameUp, test, bestData))
884 BestData testData;
885 if (frameNodeCommon(testData, test, bestData, &originalData) == REJECT_TEST)
894 int result = framePartCommon(testData, test, bestData);
898 BestData innerData = testData;
901 *bestData = innerData;
906 *bestData = testData;
909 ASSERT(mRoot->mCursor == NULL || bestData->mNode != mRoot->mCursor);
910 return bestData->mNode;
1016 const CachedNode* test, BestData* bestData) const
1024 (frame->*moveInDirection)(childDoc, NULL, bestData);
1161 bool CachedFrame::BestData::canBeReachedByAnotherDirection()
1169 int CachedFrame::BestData::isContainer(CachedFrame::BestData* other)
1207 SkFixed CachedFrame::BestData::Overlap(int span, int left, int right)
1225 void CachedFrame::BestData::setDistances()
1244 bool CachedFrame::BestData::setDownDirection(const CachedHistory* history)
1284 bool CachedFrame::BestData::setLeftDirection(const CachedHistory* history)
1324 bool CachedFrame::BestData::setRightDirection(const CachedHistory* history)
1364 bool CachedFrame::BestData::setUpDirection(const CachedHistory* history)
1404 void CachedFrame::BestData::setNavInclusion(int left, int right)
1413 void CachedFrame::BestData::setNavOverlap(int span, int left, int right)
1420 void CachedFrame::BestData::setWorkingInclusion(int left, int right)
1427 void CachedFrame::BestData::setWorkingOverlap(int span, int left, int right)