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

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

Issue 206283003: Avoid tree walks when computing RenderLayer::scrollParent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix build errors. Created 6 years, 9 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 | « no previous file | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.h
diff --git a/Source/core/rendering/RenderLayer.h b/Source/core/rendering/RenderLayer.h
index cf9654aa369d9899df8cf2db658482a291ef91a7..7ce163ea54d565a1349b062c08da493dd01834e1 100644
--- a/Source/core/rendering/RenderLayer.h
+++ b/Source/core/rendering/RenderLayer.h
@@ -358,6 +358,9 @@ public:
// compositing state may legally be read.
bool isAllowedToQueryCompositingState() const;
+ // This returns true if our current phase is the compositing update.
+ bool isInCompositingUpdate() const;
+
CompositedLayerMappingPtr compositedLayerMapping() const;
CompositedLayerMappingPtr ensureCompositedLayerMapping();
@@ -479,7 +482,33 @@ public:
bool hasDirectReasonsForCompositing() const { return compositingReasons() & CompositingReasonComboAllDirectReasons; }
+ void clearAncestorDependentPropertyCache();
+
private:
+ class AncestorDependentPropertyCache {
+ WTF_MAKE_NONCOPYABLE(AncestorDependentPropertyCache);
+ public:
+ AncestorDependentPropertyCache();
+
+ RenderLayer* ancestorCompositedScrollingLayer() const;
+ void setAncestorCompositedScrollingLayer(RenderLayer*);
+
+ RenderLayer* scrollParent() const;
+ void setScrollParent(RenderLayer*);
+
+ bool ancestorCompositedScrollingLayerDirty() const { return m_ancestorCompositedScrollingLayerDirty; }
+ bool scrollParentDirty() const { return m_scrollParentDirty; }
+
+ private:
+ RenderLayer* m_ancestorCompositedScrollingLayer;
+ RenderLayer* m_scrollParent;
+
+ bool m_ancestorCompositedScrollingLayerDirty;
+ bool m_scrollParentDirty;
+ };
+
+ void ensureAncestorDependentPropertyCache() const;
+
bool hasOverflowControls() const;
void setIsUnclippedDescendant(bool isUnclippedDescendant) { m_isUnclippedDescendant = isUnclippedDescendant; }
@@ -578,7 +607,6 @@ private:
bool shouldBeSelfPaintingLayer() const;
-private:
// FIXME: We should only create the stacking node if needed.
bool requiresStackingNode() const { return true; }
void updateStackingNode();
@@ -630,7 +658,6 @@ private:
friend class RenderLayerCompositor;
friend class RenderLayerModelObject;
-private:
LayerType m_layerType;
// Self-painting layer is an optimization where we avoid the heavy RenderLayer painting
@@ -756,6 +783,8 @@ private:
OwnPtr<CompositedLayerMapping> m_compositedLayerMapping;
OwnPtr<RenderLayerScrollableArea> m_scrollableArea;
+ mutable OwnPtr<AncestorDependentPropertyCache> m_ancestorDependentPropertyCache;
+
CompositedLayerMapping* m_groupedMapping;
RenderLayerRepainter m_repainter;
« no previous file with comments | « no previous file | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698