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

Unified Diff: Source/WebCore/rendering/RenderLayer.h

Issue 13913013: Only update composited scrolling state when necessary (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: . Created 7 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
Index: Source/WebCore/rendering/RenderLayer.h
diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h
index 21a6c919dc01fd742dd8ee8f5dc6b7e0f7ca60b8..d77dca4eb11342f1ee9eaea0ba555f3d920560a0 100644
--- a/Source/WebCore/rendering/RenderLayer.h
+++ b/Source/WebCore/rendering/RenderLayer.h
@@ -315,6 +315,7 @@ typedef Vector<LayerFragment, 1> LayerFragments;
class RenderLayer : public ScrollableArea {
public:
friend class RenderReplica;
+ friend struct ScopedCompositedScrollingUpdater;
RenderLayer(RenderLayerModelObject*);
~RenderLayer();
@@ -497,10 +498,18 @@ public:
// layer itself.
RenderLayer* stackingContainer() const;
+ // Gets the enclosing stacking context for this layer, excluding this
+ // layer itself.
+ RenderLayer* stackingContext() const;
+
// Gets the enclosing stacking container for this layer, possibly the layer
// itself, if it is a stacking container.
RenderLayer* enclosingStackingContainer() { return isStackingContainer() ? this : stackingContainer(); }
+ // Gets the enclosing stacking context for this layer, possibly the layer
+ // itself, if it is a stacking context.
+ RenderLayer* enclosingStackingContext() { return isStackingContext() ? this : stackingContext(); }
+
void dirtyZOrderLists();
void dirtyStackingContainerZOrderLists();
@@ -866,6 +875,8 @@ private:
bool shouldRepaintAfterLayout() const;
void updateSelfPaintingLayer();
+ void updateIsNormalFlowOnly();
+ void updateVisibilityAfterStyleChange(const RenderStyle* oldStyle);
void updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle);
void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle);
@@ -876,6 +887,11 @@ private:
void updateOutOfFlowPositioned(const RenderStyle* oldStyle);
void updateNeedsCompositedScrolling();
+ void setNeedsCompositedScrolling(bool);
+
+ void requestNeedsCompositedScrollingUpdate();
+ void requestDescendantsAreContiguousInStackingOrderUpdate();
+ void cancelScheduledCompositedScrollingUpdates() const;
// Returns true if the position changed.
bool updateLayerPosition();
@@ -1151,6 +1167,7 @@ protected:
// descendants in stacking order. This is one of the requirements of being
// able to safely become a stacking context.
bool m_descendantsAreContiguousInStackingOrder : 1;
+ bool m_descendantsAreContiguousInStackingOrderDirty : 1;
const bool m_isRootLayer : 1;
@@ -1272,20 +1289,6 @@ inline void RenderLayer::clearZOrderLists()
m_negZOrderList.clear();
}
-inline void RenderLayer::updateZOrderLists()
-{
- if (!m_zOrderListsDirty)
- return;
-
- if (!isStackingContainer()) {
- clearZOrderLists();
- m_zOrderListsDirty = false;
- return;
- }
-
- rebuildZOrderLists();
-}
-
#if !ASSERT_DISABLED
class LayerListMutationDetector {
public:

Powered by Google App Engine
This is Rietveld 408576698