summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2011-04-13 17:48:48 -0700
committerNicolas Roard <nicolas@android.com>2011-04-13 17:51:30 -0700
commit08fb9dc0955f1869177a441507dc12a09433f2f2 (patch)
treed0b0b7f1db71a9e595ed9e99084fb90dcb95ef88
parenta0ae9cb27434c3597e55d3d294a876504005a895 (diff)
downloadexternal_webkit-08fb9dc0955f1869177a441507dc12a09433f2f2.zip
external_webkit-08fb9dc0955f1869177a441507dc12a09433f2f2.tar.gz
external_webkit-08fb9dc0955f1869177a441507dc12a09433f2f2.tar.bz2
Limit the number of layers created for fixed position.
Change-Id: If7093770b420b37fbb0b073c85f96e781abc55c2
-rw-r--r--WebCore/rendering/RenderLayerCompositor.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index 6578d1d..c0dba6f 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -535,8 +535,17 @@ bool RenderLayerCompositor::overlapsCompositedLayers(OverlapMap& overlapMap, con
RenderLayerCompositor::OverlapMap::const_iterator end = overlapMap.end();
for (RenderLayerCompositor::OverlapMap::const_iterator it = overlapMap.begin(); it != end; ++it) {
const IntRect& bounds = it->second;
- if (layerBounds.intersects(bounds))
+ if (layerBounds.intersects(bounds)) {
+#if ENABLE(COMPOSITED_FIXED_ELEMENTS)
+ RenderLayer* intersectedLayer = it->first;
+ if (intersectedLayer && intersectedLayer->isFixed()) {
+ if (bounds.contains(layerBounds)) {
+ continue;
+ }
+ }
+#endif
return true;
+ }
}
return false;
@@ -1170,15 +1179,6 @@ bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const
if (!canBeComposited(layer))
return false;
-#if ENABLE(COMPOSITED_FIXED_ELEMENTS)
- // if an ancestor is fixed positioned, we need to be composited...
- const RenderLayer* currLayer = layer;
- while ((currLayer = currLayer->parent())) {
- if (currLayer->isComposited() && currLayer->isFixed())
- return true;
- }
-#endif
-
// The root layer always has a compositing layer, but it may not have backing.
return requiresCompositingLayer(layer) || layer->mustOverlapCompositedLayers() || (inCompositingMode() && layer->isRootLayer());
}