summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-03-25 10:18:35 -0400
committerCary Clark <cary@android.com>2010-03-25 10:18:35 -0400
commit61b9d85e2d3c063d1026e5cb59573d351187211e (patch)
tree4e6499f98a5ac577e1bf4cc589de8ddc50f468ca /WebKit/android/nav
parent6b3a78a9b31b2bf20a2a75fef79d9c943a461e74 (diff)
downloadexternal_webkit-61b9d85e2d3c063d1026e5cb59573d351187211e.zip
external_webkit-61b9d85e2d3c063d1026e5cb59573d351187211e.tar.gz
external_webkit-61b9d85e2d3c063d1026e5cb59573d351187211e.tar.bz2
don't track layer node twice
If a cache node is both in a layer and contains a layer, don't add it the second time. Change-Id: I45cc302e234565bfbc87649ca503f515b1f487e8 http://b/2543736
Diffstat (limited to 'WebKit/android/nav')
-rw-r--r--WebKit/android/nav/CacheBuilder.cpp9
-rw-r--r--WebKit/android/nav/CachedFrame.h4
2 files changed, 12 insertions, 1 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp
index a3aeede..7ee2a16 100644
--- a/WebKit/android/nav/CacheBuilder.cpp
+++ b/WebKit/android/nav/CacheBuilder.cpp
@@ -1044,10 +1044,17 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
absoluteBoundingBoxRect().location();
loc.move(globalOffsetX, globalOffsetY);
// if this is a child of a CachedNode, add a layer
+ size_t limit = cachedFrame->layerCount() == 0 ? 0 :
+ cachedFrame->lastLayer()->cachedNodeIndex();
for (size_t index = 1; index < tracker.size(); index++) {
const FocusTracker& cursorNode = tracker.at(index);
- DBG_NAV_LOGD("call add layer %d", id);
size_t index = cursorNode.mCachedNodeIndex;
+ if (index <= limit) { // already added?
+ DBG_NAV_LOGD("index=%d limit=%d id=%d", index,
+ limit, id);
+ continue;
+ }
+ DBG_NAV_LOGD("call add layer %d", id);
CachedNode* trackedNode = cachedFrame->getIndex(index);
trackedNode->setIsInLayer(true);
trackedNode->setIsUnclipped(true);
diff --git a/WebKit/android/nav/CachedFrame.h b/WebKit/android/nav/CachedFrame.h
index 826e1a7..f7276c1 100644
--- a/WebKit/android/nav/CachedFrame.h
+++ b/WebKit/android/nav/CachedFrame.h
@@ -108,10 +108,14 @@ public:
int indexInParent() const { return mIndexInParent; }
void init(const CachedRoot* root, int index, WebCore::Frame* frame);
const CachedFrame* lastChild() const { return &mCachedFrames.last(); }
+#if USE(ACCELERATED_COMPOSITING)
+ const CachedLayer* lastLayer() const { return &mCachedLayers.last(); }
+#endif
CachedNode* lastNode() { return &mCachedNodes.last(); }
CachedFrame* lastChild() { return &mCachedFrames.last(); }
#if USE(ACCELERATED_COMPOSITING)
const CachedLayer* layer(const CachedNode* ) const;
+ size_t layerCount() const { return mCachedLayers.size(); }
#endif
WebCore::IntRect localBounds(const CachedNode* ,
const WebCore::IntRect& ) const;