summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-08-08 12:05:00 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-08 12:05:00 -0700
commitbdeccf99cf5f7ca1106da76c202eb82859f753f6 (patch)
treea2fe2508b5bd03622119aca004f739edf9167d00 /Source
parent558151f0bd26b72dc76ffebc60cf3025e5f81ce8 (diff)
parentdb9378c1fab20d230f03456aa467c178cc2fbf7f (diff)
downloadexternal_webkit-bdeccf99cf5f7ca1106da76c202eb82859f753f6.zip
external_webkit-bdeccf99cf5f7ca1106da76c202eb82859f753f6.tar.gz
external_webkit-bdeccf99cf5f7ca1106da76c202eb82859f753f6.tar.bz2
Merge "Fix crashes on plus.google.com and reduce the number of necessary layers"
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index 8d066e9..2f344b9 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -79,6 +79,7 @@ struct CompositingState {
, m_subtreeIsCompositing(false)
#if ENABLE(COMPOSITED_FIXED_ELEMENTS)
, m_fixedSibling(false)
+ , m_hasFixedElement(false)
#endif
#if ENABLE(ANDROID_OVERFLOW_SCROLL)
, m_hasScrollableElement(false)
@@ -93,6 +94,7 @@ struct CompositingState {
bool m_subtreeIsCompositing;
#if ENABLE(COMPOSITED_FIXED_ELEMENTS)
bool m_fixedSibling;
+ bool m_hasFixedElement;
#endif
#if ENABLE(ANDROID_OVERFLOW_SCROLL)
bool m_hasScrollableElement;
@@ -625,9 +627,15 @@ bool RenderLayerCompositor::checkForFixedLayers(Vector<RenderLayer*>* list, bool
haveFixedLayer = j;
fixedSibling = true;
}
+ IntRect currentLayerBounds = currentLayer->renderer()->localToAbsoluteQuad(
+ FloatRect(currentLayer->localBoundingBox())).enclosingBoundingBox();
+ if ((currentLayerBounds.width() <= 1
+ || currentLayerBounds.height() <= 1)
+ && haveFixedLayer == j) {
+ haveFixedLayer = -1;
+ fixedSibling = false;
+ }
if (haveFixedLayer != -1 && haveFixedLayer != j) {
- IntRect currentLayerBounds = currentLayer->renderer()->localToAbsoluteQuad(
- FloatRect(currentLayer->localBoundingBox())).enclosingBoundingBox();
bool needComposite = true;
int stop = 0;
if (stopAtFixedLayer)
@@ -709,12 +717,16 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O
if (layer->hasOverflowScroll())
compositingState.m_hasScrollableElement = true;
#endif
+#if ENABLE(COMPOSITED_FIXED_ELEMENTS)
+ if (layer->isFixed())
+ compositingState.m_hasFixedElement = true;
+#endif
#if ENABLE(ANDROID_OVERFLOW_SCROLL)
// we don't want to signal that the subtree is compositing if the reason
// is because the layer is an overflow layer -- doing so would trigger
// all the above layers to be composited unnecessarily
- if (willBeComposited && !layer->hasOverflowScroll()) {
+ if (willBeComposited && !layer->hasOverflowScroll() && !layer->isFixed()) {
#else
if (willBeComposited) {
#endif
@@ -816,6 +828,10 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O
if (childState.m_subtreeIsCompositing)
compositingState.m_subtreeIsCompositing = true;
+#if ENABLE(COMPOSITED_FIXED_ELEMENTS)
+ if (childState.m_hasFixedElement)
+ compositingState.m_hasFixedElement = true;
+#endif
#if ENABLE(ANDROID_OVERFLOW_SCROLL)
if (childState.m_hasScrollableElement)
compositingState.m_hasScrollableElement = true;
@@ -837,7 +853,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O
#if ENABLE(ANDROID_OVERFLOW_SCROLL)
// We also need to check that we don't have a scrollable layer, as this
// would not have set the m_subtreeIsCompositing flag
- if (layer->isRootLayer() && !childState.m_subtreeIsCompositing && !childState.m_hasScrollableElement && !requiresCompositingLayer(layer) && !m_forceCompositingMode) {
+ if (layer->isRootLayer() && !childState.m_subtreeIsCompositing && !childState.m_hasScrollableElement && !childState.m_hasFixedElement && !requiresCompositingLayer(layer) && !m_forceCompositingMode) {
#else
if (layer->isRootLayer() && !childState.m_subtreeIsCompositing && !requiresCompositingLayer(layer) && !m_forceCompositingMode) {
#endif