diff options
author | Bart Sears <bsears@google.com> | 2012-01-04 13:46:46 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-01-04 13:46:46 -0800 |
commit | d13df54b67ff2373e79cf6c70bd2369e556ec9c0 (patch) | |
tree | ab516412bc9275f3bcf06daf2a007dac6494a9b5 /Source/WebCore/platform/graphics/android | |
parent | 08a2aede30839b296a2fad9d27939c4aaa6ccbb1 (diff) | |
parent | 61e0d189f2b74650bf72a6a2820f66a8b17c3d06 (diff) | |
download | external_webkit-d13df54b67ff2373e79cf6c70bd2369e556ec9c0.zip external_webkit-d13df54b67ff2373e79cf6c70bd2369e556ec9c0.tar.gz external_webkit-d13df54b67ff2373e79cf6c70bd2369e556ec9c0.tar.bz2 |
Merge "Fix crash with composited layers - DO NOT MERGE" into ics-mr1
Diffstat (limited to 'Source/WebCore/platform/graphics/android')
-rw-r--r-- | Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 34 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h | 2 |
2 files changed, 33 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 6990503..567b54b 100644 --- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -963,11 +963,31 @@ void GraphicsLayerAndroid::syncMask() } } -void GraphicsLayerAndroid::syncCompositingState() +void GraphicsLayerAndroid::gatherRootLayers(Vector<const RenderLayer*>& list) { - for (unsigned int i = 0; i < m_children.size(); i++) - m_children[i]->syncCompositingState(); + RenderLayer* renderLayer = renderLayerFromClient(m_client); + if (renderLayer) { + const RenderLayer* rootLayer = renderLayer->root(); + bool found = false; + for (unsigned int i = 0; i < list.size(); i++) { + const RenderLayer* current = list[i]; + if (current == rootLayer) { + found = true; + break; + } + } + if (!found) + list.append(rootLayer); + } + for (unsigned int i = 0; i < m_children.size(); i++) { + GraphicsLayerAndroid* layer = static_cast<GraphicsLayerAndroid*>(m_children[i]); + layer->gatherRootLayers(list); + } +} + +void GraphicsLayerAndroid::syncCompositingStateForThisLayerOnly() +{ updateScrollingLayers(); updateFixedPosition(); syncChildren(); @@ -977,6 +997,14 @@ void GraphicsLayerAndroid::syncCompositingState() repaint(); } +void GraphicsLayerAndroid::syncCompositingState() +{ + for (unsigned int i = 0; i < m_children.size(); i++) + m_children[i]->syncCompositingState(); + + syncCompositingStateForThisLayerOnly(); +} + void GraphicsLayerAndroid::notifyClientAnimationStarted() { for (unsigned int i = 0; i < m_children.size(); i++) diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h index 358f674..e6d75b0 100644 --- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h @@ -116,7 +116,9 @@ public: virtual void setZPosition(float); + void gatherRootLayers(Vector<const RenderLayer*>&); virtual void syncCompositingState(); + virtual void syncCompositingStateForThisLayerOnly(); void notifyClientAnimationStarted(); LayerAndroid* contentLayer() { return m_contentLayer; } |