Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1014)

Unified Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 266453008: Get rid of extra clipping of composited layers in CompositedLayerMapping::updateCompositedBounds(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
index fa67c9f8a3e9f3a572993175a72cc37fc4a0f527..2e0126aa42c15ac1a1d31e828f7f30184c9c9239 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -335,34 +335,6 @@ static bool hasNonZeroTransformOrigin(const RenderObject* renderer)
|| (style->transformOriginY().type() == Fixed && style->transformOriginY().value());
}
-static bool layerOrAncestorIsTransformedOrUsingCompositedScrolling(RenderLayer* layer)
-{
- for (RenderLayer* curr = layer; curr; curr = curr->parent()) {
- if (curr->hasTransform() || curr->needsCompositedScrolling())
- return true;
- }
-
- return false;
-}
-
-bool CompositedLayerMapping::shouldClipCompositedBounds() const
-{
- // Scrollbar layers use this layer for relative positioning, so don't clip.
- if (layerForHorizontalScrollbar() || layerForVerticalScrollbar())
- return false;
-
- if (layerOrAncestorIsTransformedOrUsingCompositedScrolling(&m_owningLayer))
- return false;
-
- // Scrolled composited layers are clipped by their ancestor clipping layer,
- // so don't clip these, either.
- if (compositor()->clippedByNonAncestorInStackingTree(&m_owningLayer)
- && m_owningLayer.renderer()->containingBlock()->enclosingLayer() == m_owningLayer.ancestorScrollingLayer())
- return false;
-
- return true;
-}
-
void CompositedLayerMapping::updateCompositedBounds(GraphicsLayerUpdater::UpdateType updateType)
{
if (!shouldUpdateGraphicsLayer(updateType))
@@ -374,29 +346,6 @@ void CompositedLayerMapping::updateCompositedBounds(GraphicsLayerUpdater::Update
LayoutRect layerBounds = m_owningLayer.boundingBoxForCompositing();
- // Clip to the size of the document or enclosing overflow-scroll layer.
- // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with.
- // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist.
- if (shouldClipCompositedBounds()) {
- RenderView* view = m_owningLayer.renderer()->view();
- RenderLayer* rootLayer = view->layer();
-
- LayoutRect clippingBounds;
- if (renderer()->style()->position() == FixedPosition && renderer()->container() == view)
- clippingBounds = view->frameView()->viewportConstrainedVisibleContentRect();
- else
- clippingBounds = view->unscaledDocumentRect();
-
- if (&m_owningLayer != rootLayer)
- clippingBounds.intersect(m_owningLayer.clipper().backgroundClipRect(ClipRectsContext(rootLayer, AbsoluteClipRects)).rect());
-
- LayoutPoint delta;
- m_owningLayer.convertToLayerCoords(rootLayer, delta);
- clippingBounds.move(-delta.x(), -delta.y());
-
- layerBounds.intersect(clippingBounds);
- }
-
// If the element has a transform-origin that has fixed lengths, and the renderer has zero size,
// then we need to ensure that the compositing layer has non-zero size so that we can apply
// the transform-origin via the GraphicsLayer anchorPoint (which is expressed as a fractional value).
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698