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

Unified Diff: Source/core/rendering/RenderLayer.cpp

Issue 445263002: Remove cached bounds in RenderLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/RenderLayer.h ('k') | Source/core/rendering/RenderLayerScrollableArea.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 40929ef10c881f0eb92eec07e8ed59e727051ba5..9ba262c13a414167ad17ceb6b39b097060de945f 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -114,9 +114,6 @@ RenderLayer::RenderLayer(RenderLayerModelObject* renderer, LayerType type)
, m_hasVisibleDescendant(false)
, m_hasVisibleNonLayerContent(false)
, m_isPaginated(false)
-#if ENABLE(ASSERT)
- , m_needsPositionUpdate(true)
-#endif
, m_3DTransformedDescendantStatusDirty(true)
, m_has3DTransformedDescendant(false)
, m_containsDirtyOverlayScrollbars(false)
@@ -264,8 +261,6 @@ void RenderLayer::updateLayerPositionsAfterLayout()
void RenderLayer::updateLayerPositionRecursive()
{
- updateLayerPosition();
-
if (hasOverflowControls()) {
// FIXME: We should figure out the right time to position the overflow controls.
// This call appears to be necessary to pass some layout test that use EventSender,
@@ -323,21 +318,6 @@ bool RenderLayer::scrollsWithRespectTo(const RenderLayer* other) const
return ancestorScrollingLayer() != other->ancestorScrollingLayer();
}
-void RenderLayer::updateLayerPositionsAfterOverflowScroll()
-{
- m_clipper.clearClipRectsIncludingDescendants();
- updateLayerPositionsAfterScrollRecursive();
-}
-
-void RenderLayer::updateLayerPositionsAfterScrollRecursive()
-{
- if (updateLayerPosition())
- m_renderer->setPreviousPaintInvalidationRect(m_renderer->boundsRectForPaintInvalidation(m_renderer->containerForPaintInvalidation()));
-
- for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
- child->updateLayerPositionsAfterScrollRecursive();
-}
-
void RenderLayer::updateTransformationMatrix()
{
if (m_transform) {
@@ -797,7 +777,19 @@ bool RenderLayer::update3DTransformedDescendantStatus()
return has3DTransform();
}
-bool RenderLayer::updateLayerPosition()
+const IntSize RenderLayer::size() const
abarth-chromium 2014/08/07 21:51:12 No need for |const| here. IntSize is a value type
skobes 2014/08/07 22:21:09 Done.
+{
+ if (renderer()->isInline() && renderer()->isRenderInline())
+ return toRenderInline(renderer())->linesBoundingBox().size();
+
+ // FIXME: Is snapping the size really needed here?
+ if (RenderBox* box = renderBox())
+ return pixelSnappedIntSize(box->size(), box->location());
+
+ return IntSize();
+}
+
+const LayoutPoint RenderLayer::location() const
abarth-chromium 2014/08/07 21:51:12 No need for |const| here. LayoutPoint is a value
skobes 2014/08/07 22:21:09 Done.
{
LayoutPoint localPoint;
LayoutSize inlineBoundingBoxOffset; // We don't put this into the RenderLayer x/y for inlines, so we need to subtract it out when done.
@@ -805,12 +797,9 @@ bool RenderLayer::updateLayerPosition()
if (renderer()->isInline() && renderer()->isRenderInline()) {
RenderInline* inlineFlow = toRenderInline(renderer());
IntRect lineBox = inlineFlow->linesBoundingBox();
- m_size = lineBox.size();
inlineBoundingBoxOffset = toSize(lineBox.location());
localPoint += inlineBoundingBoxOffset;
} else if (RenderBox* box = renderBox()) {
- // FIXME: Is snapping the size really needed here for the RenderBox case?
- m_size = pixelSnappedIntSize(box->size(), box->location());
localPoint += box->topLeftLocationOffset();
}
@@ -867,27 +856,17 @@ bool RenderLayer::updateLayerPosition()
}
}
- bool positionOrOffsetChanged = false;
- if (renderer()->isRelPositioned()) {
- LayoutSize newOffset = toRenderBoxModelObject(renderer())->offsetForInFlowPosition();
- positionOrOffsetChanged = newOffset != m_offsetForInFlowPosition;
- m_offsetForInFlowPosition = newOffset;
- localPoint.move(m_offsetForInFlowPosition);
- } else {
- m_offsetForInFlowPosition = LayoutSize();
- }
+ localPoint.move(offsetForInFlowPosition());
// FIXME: We'd really like to just get rid of the concept of a layer rectangle and rely on the renderers.
localPoint -= inlineBoundingBoxOffset;
- if (m_location != localPoint)
- positionOrOffsetChanged = true;
- m_location = localPoint;
+ return localPoint;
+}
-#if ENABLE(ASSERT)
- m_needsPositionUpdate = false;
-#endif
- return positionOrOffsetChanged;
+const LayoutSize RenderLayer::offsetForInFlowPosition() const
+{
+ return renderer()->isRelPositioned() ? toRenderBoxModelObject(renderer())->offsetForInFlowPosition() : LayoutSize();
}
TransformationMatrix RenderLayer::perspectiveTransform() const
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698