diff options
author | John Reck <jreck@google.com> | 2011-10-14 16:18:00 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-14 16:18:00 -0700 |
commit | 32ed6f0793dd80c69edf2c7613b58df55ce211f3 (patch) | |
tree | 6ae3cf702f9262fb59342a83bed7b1350816e866 | |
parent | 0515fb56d8312d907d9d90b005431b6f338915a8 (diff) | |
parent | e95b6bbb96a1667e7f5a65cdeb9e79a2714e4563 (diff) | |
download | external_webkit-32ed6f0793dd80c69edf2c7613b58df55ce211f3.zip external_webkit-32ed6f0793dd80c69edf2c7613b58df55ce211f3.tar.gz external_webkit-32ed6f0793dd80c69edf2c7613b58df55ce211f3.tar.bz2 |
Merge "Don't cache size of cursor rings array"
-rw-r--r-- | Source/WebKit/android/nav/CacheBuilder.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/android/nav/CachedNode.cpp | 15 | ||||
-rw-r--r-- | Source/WebKit/android/nav/CachedNode.h | 4 |
3 files changed, 8 insertions, 13 deletions
diff --git a/Source/WebKit/android/nav/CacheBuilder.cpp b/Source/WebKit/android/nav/CacheBuilder.cpp index a4bc758..623d2cb 100644 --- a/Source/WebKit/android/nav/CacheBuilder.cpp +++ b/Source/WebKit/android/nav/CacheBuilder.cpp @@ -1406,7 +1406,6 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame, else if (cachedNode.clip(clip) == false) continue; // skip this node if outside of the clip } - cachedNode.setNavableRects(); cachedNode.setColorIndex(colorIndex); cachedNode.setExport(exported); cachedNode.setHasCursorRing(hasCursorRing); @@ -1478,7 +1477,6 @@ bool CacheBuilder::CleanUpContainedNodes(CachedRoot* cachedRoot, lastNode->hasTagName(HTMLNames::formTag)) { lastCached->setBounds(IntRect(0, 0, 0, 0)); lastCached->mCursorRing.clear(); - lastCached->setNavableRects(); return false; } CachedNode* onlyChildCached = cachedFrame->lastNode(); diff --git a/Source/WebKit/android/nav/CachedNode.cpp b/Source/WebKit/android/nav/CachedNode.cpp index 86c2a38..e500875 100644 --- a/Source/WebKit/android/nav/CachedNode.cpp +++ b/Source/WebKit/android/nav/CachedNode.cpp @@ -92,10 +92,9 @@ void CachedNode::cursorRings(const CachedFrame* frame, WebCore::IntRect CachedNode::cursorRingBounds(const CachedFrame* frame) const { - int partMax = mNavableRects; - ASSERT(partMax > 0); - WebCore::IntRect bounds = mCursorRing[0]; - for (int partIndex = 1; partIndex < partMax; partIndex++) + int partMax = navableRects(); + WebCore::IntRect bounds; + for (int partIndex = 0; partIndex < partMax; partIndex++) bounds.unite(mCursorRing[partIndex]); bounds.inflate(CURSOR_RING_HIT_TEST_RADIUS); return mIsInLayer ? frame->adjustBounds(this, bounds) : bounds; @@ -116,7 +115,7 @@ void CachedNode::fixUpCursorRects(const CachedFrame* frame) mUseHitBounds = true; return; } - if (mNavableRects <= 1) + if (navableRects() <= 1) return; // if there is more than 1 rect, and the bounds doesn't intersect // any other cursor ring bounds, use it @@ -290,8 +289,8 @@ void CachedNode::move(int x, int y) bool CachedNode::partRectsContains(const CachedNode* other) const { int outerIndex = 0; - int outerMax = mNavableRects; - int innerMax = other->mNavableRects; + int outerMax = navableRects(); + int innerMax = other->navableRects(); do { const WebCore::IntRect& outerBounds = mCursorRing[outerIndex]; int innerIndex = 0; @@ -403,7 +402,7 @@ void CachedNode::Debug::print() const DUMP_NAV_LOGD("// void* mParentGroup=%p; // (%d) \n", b->mParentGroup, mParentGroupIndex); DUMP_NAV_LOGD("// int mDataIndex=%d;\n", b->mDataIndex); DUMP_NAV_LOGD("// int mIndex=%d;\n", b->mIndex); - DUMP_NAV_LOGD("// int mNavableRects=%d;\n", b->mNavableRects); + DUMP_NAV_LOGD("// int navableRects()=%d;\n", b->navableRects()); DUMP_NAV_LOGD("// int mParentIndex=%d;\n", b->mParentIndex); DUMP_NAV_LOGD("// int mTabIndex=%d;\n", b->mTabIndex); DUMP_NAV_LOGD("// int mColorIndex=%d;\n", b->mColorIndex); diff --git a/Source/WebKit/android/nav/CachedNode.h b/Source/WebKit/android/nav/CachedNode.h index 602dda6..321b7fd 100644 --- a/Source/WebKit/android/nav/CachedNode.h +++ b/Source/WebKit/android/nav/CachedNode.h @@ -136,7 +136,7 @@ public: WebCore::IntRect localHitBounds(const CachedFrame* ) const; WebCore::IntRect localRing(const CachedFrame* , size_t part) const; void move(int x, int y); - int navableRects() const { return mNavableRects; } + int navableRects() const { return mCursorRing.size(); } void* nodePointer() const { return mNode; } bool noSecondChance() const { return mCondition > SECOND_CHANCE_END; } const WebCore::IntRect& originalAbsoluteBounds() const { @@ -169,7 +169,6 @@ public: void setIsTransparent(bool isTransparent) { mIsTransparent = isTransparent; } void setIsUnclipped(bool unclipped) { mIsUnclipped = unclipped; } void setLast() { mLast = true; } - void setNavableRects() { mNavableRects = mCursorRing.size(); } void setParentGroup(void* group) { mParentGroup = group; } void setParentIndex(int parent) { mParentIndex = parent; } void setSingleImage(bool single) { mSingleImage = single; } @@ -195,7 +194,6 @@ private: void* mParentGroup; // WebCore::Node*, only used to match pointers int mDataIndex; // child frame if a frame; input data index; or -1 int mIndex; // index of itself, to find first in array (document) - int mNavableRects; // FIXME: could be bitfield once I limit max number of rects int mParentIndex; int mTabIndex; int mColorIndex; // index to ring color and other stylable properties |