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

Unified Diff: Source/core/paint/DeprecatedPaintLayerStackingNode.cpp

Issue 1188363002: Compute the normal flow list on the fly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reviewnated patch! Created 5 years, 6 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
Index: Source/core/paint/DeprecatedPaintLayerStackingNode.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayerStackingNode.cpp b/Source/core/paint/DeprecatedPaintLayerStackingNode.cpp
index 83f947c472a1c49fb2c74f4950aa5bf393ba1a70..b1fb9c52663bca382be4310b1091f232f78f483b 100644
--- a/Source/core/paint/DeprecatedPaintLayerStackingNode.cpp
+++ b/Source/core/paint/DeprecatedPaintLayerStackingNode.cpp
@@ -56,7 +56,6 @@ namespace blink {
// layer about some of its state.
DeprecatedPaintLayerStackingNode::DeprecatedPaintLayerStackingNode(DeprecatedPaintLayer* layer)
: m_layer(layer)
- , m_normalFlowListDirty(true)
#if ENABLE(ASSERT)
, m_layerListMutationAllowed(true)
, m_stackingParent(0)
@@ -74,10 +73,8 @@ DeprecatedPaintLayerStackingNode::~DeprecatedPaintLayerStackingNode()
#if ENABLE(ASSERT)
if (!layoutObject()->documentBeingDestroyed()) {
ASSERT(!isInStackingParentZOrderLists());
- ASSERT(!isInStackingParentNormalFlowList());
updateStackingParentForZOrderLists(0);
- updateStackingParentForNormalFlowList(0);
}
#endif
}
@@ -119,22 +116,6 @@ void DeprecatedPaintLayerStackingNode::dirtyStackingContextZOrderLists()
stackingNode->dirtyZOrderLists();
}
-void DeprecatedPaintLayerStackingNode::dirtyNormalFlowList()
-{
- ASSERT(m_layerListMutationAllowed);
-
-#if ENABLE(ASSERT)
- updateStackingParentForNormalFlowList(0);
-#endif
-
- if (m_normalFlowList)
- m_normalFlowList->clear();
- m_normalFlowListDirty = true;
-
- if (!layoutObject()->documentBeingDestroyed())
- compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
-}
-
void DeprecatedPaintLayerStackingNode::rebuildZOrderLists()
{
ASSERT(m_layerListMutationAllowed);
@@ -175,28 +156,6 @@ void DeprecatedPaintLayerStackingNode::rebuildZOrderLists()
m_zOrderListsDirty = false;
}
-void DeprecatedPaintLayerStackingNode::updateNormalFlowList()
-{
- if (!m_normalFlowListDirty)
- return;
-
- ASSERT(m_layerListMutationAllowed);
-
- for (DeprecatedPaintLayer* child = layer()->firstChild(); child; child = child->nextSibling()) {
- if (!child->stackingNode()->isTreatedAsStackingContextForPainting() && (!layer()->reflectionInfo() || layer()->reflectionInfo()->reflectionLayer() != child)) {
- if (!m_normalFlowList)
- m_normalFlowList = adoptPtr(new Vector<DeprecatedPaintLayerStackingNode*>);
- m_normalFlowList->append(child->stackingNode());
- }
- }
-
-#if ENABLE(ASSERT)
- updateStackingParentForNormalFlowList(this);
-#endif
-
- m_normalFlowListDirty = false;
-}
-
void DeprecatedPaintLayerStackingNode::collectLayers(OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& posBuffer, OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& negBuffer)
{
if (layer()->isInTopLayer())
@@ -232,14 +191,6 @@ bool DeprecatedPaintLayerStackingNode::isInStackingParentZOrderLists() const
return false;
}
-bool DeprecatedPaintLayerStackingNode::isInStackingParentNormalFlowList() const
-{
- if (!m_stackingParent || m_stackingParent->normalFlowListDirty())
- return false;
-
- return (m_stackingParent->normalFlowList() && m_stackingParent->normalFlowList()->find(this) != kNotFound);
-}
-
void DeprecatedPaintLayerStackingNode::updateStackingParentForZOrderLists(DeprecatedPaintLayerStackingNode* stackingParent)
{
if (m_posZOrderList) {
@@ -253,26 +204,17 @@ void DeprecatedPaintLayerStackingNode::updateStackingParentForZOrderLists(Deprec
}
}
-void DeprecatedPaintLayerStackingNode::updateStackingParentForNormalFlowList(DeprecatedPaintLayerStackingNode* stackingParent)
-{
- if (m_normalFlowList) {
- for (size_t i = 0; i < m_normalFlowList->size(); ++i)
- m_normalFlowList->at(i)->setStackingParent(stackingParent);
- }
-}
#endif
void DeprecatedPaintLayerStackingNode::updateLayerListsIfNeeded()
{
updateZOrderLists();
- updateNormalFlowList();
if (!layer()->reflectionInfo())
return;
DeprecatedPaintLayer* reflectionLayer = layer()->reflectionInfo()->reflectionLayer();
reflectionLayer->stackingNode()->updateZOrderLists();
- reflectionLayer->stackingNode()->updateNormalFlowList();
}
void DeprecatedPaintLayerStackingNode::updateStackingNodesAfterStyleChange(const ComputedStyle* oldStyle)
@@ -299,8 +241,8 @@ void DeprecatedPaintLayerStackingNode::updateIsTreatedAsStackingContextForPainti
return;
m_isTreatedAsStackingContextForPainting = isTreatedAsStackingContextForPainting;
- if (DeprecatedPaintLayer* p = layer()->parent())
- p->stackingNode()->dirtyNormalFlowList();
+ if (!layoutObject()->documentBeingDestroyed() && !layer()->isRootLayer())
+ compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
dirtyStackingContextZOrderLists();
}

Powered by Google App Engine
This is Rietveld 408576698