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

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

Issue 468633002: hasSelfPaintingLayerDescendant should clean m_hasSelfPaintingLayerDescendantDirty (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments 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 | « 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 0138b8d206d243789462c00b0b8b161d48e27b08..a7de9abbc562ce6d3c4569c8ea15917563239364 100644
--- a/Source/core/rendering/RenderLayer.h
+++ b/Source/core/rendering/RenderLayer.h
@@ -114,6 +114,7 @@ public:
void styleChanged(StyleDifference, const RenderStyle* oldStyle);
+ // FIXME: Many people call this function while it has out-of-date information.
bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; }
void setLayerType(LayerType layerType) { m_layerType = layerType; }
@@ -186,10 +187,6 @@ public:
// True if this layer container renderers that paint.
bool hasNonEmptyChildRenderers() const;
- // FIXME: We should ASSERT(!m_hasSelfPaintingLayerDescendantDirty); here but we hit the same bugs as visible content above.
- // Part of the issue is with subtree relayout: we don't check if our ancestors have some descendant flags dirty, missing some updates.
- bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerDescendant; }
-
// Will ensure that hasNonCompositiedChild are up to date.
void updateScrollingStateAfterCompositingChange();
bool hasVisibleNonLayerContent() const { return m_hasVisibleNonLayerContent; }
@@ -544,6 +541,16 @@ private:
void setFirstChild(RenderLayer* first) { m_first = first; }
void setLastChild(RenderLayer* last) { m_last = last; }
+ void updateHasSelfPaintingLayerDescendant() const;
+
+ bool hasSelfPaintingLayerDescendant() const
+ {
+ if (m_hasSelfPaintingLayerDescendantDirty)
+ updateHasSelfPaintingLayerDescendant();
+ ASSERT(!m_hasSelfPaintingLayerDescendantDirty);
+ return m_hasSelfPaintingLayerDescendant;
+ }
+
LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRenderBox(renderer())->location() : LayoutPoint(); }
void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags);
@@ -645,8 +652,8 @@ private:
// If have no self-painting descendants, we don't have to walk our children during painting. This can lead to
// significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells).
- unsigned m_hasSelfPaintingLayerDescendant : 1;
- unsigned m_hasSelfPaintingLayerDescendantDirty : 1;
+ mutable unsigned m_hasSelfPaintingLayerDescendant : 1;
+ mutable unsigned m_hasSelfPaintingLayerDescendantDirty : 1;
const unsigned m_isRootLayer : 1;
« 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