Chromium Code Reviews| Index: Source/core/rendering/RenderObject.h |
| diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h |
| index ad12bed26fb90d6bfed16d21d23d796201e475c6..c1cfd6af8299725318eab75b758b7480211e833a 100644 |
| --- a/Source/core/rendering/RenderObject.h |
| +++ b/Source/core/rendering/RenderObject.h |
| @@ -847,6 +847,10 @@ public: |
| // Walk the tree after layout issuing paint invalidations for renderers that have changed or moved, updating bounds that have changed, and clearing paint invalidation state. |
| virtual void invalidateTreeIfNeeded(const PaintInvalidationState&); |
| + // For now RenderBoxes and RenderSVGModelObjects know how to invalidate themselves in invalidateTreeIfNeeded. |
|
dsinclair
2014/07/17 18:36:01
This makes it sound like we're going to make all o
Xianzhu
2014/07/17 21:57:34
Updated crbug.com/394133 and added link here.
|
| + // Other objects (e.g. RenderText, RenderInline, etc) depend on their containers for invalidation. |
| + bool invalidatesSelfDuringTreeInvalidation() const { return isBox() || isSVG(); } |
|
dsinclair
2014/07/17 18:36:01
canSelfInvalidate?
Xianzhu
2014/07/17 21:57:34
As the object just don't self invalidate during in
|
| + |
| virtual void invalidatePaintForOverflow(); |
| void invalidatePaintForOverflowIfNeeded(); |
| @@ -996,7 +1000,8 @@ public: |
| void setPreviousPositionFromPaintInvalidationContainer(const LayoutPoint& location) { m_previousPositionFromPaintInvalidationContainer = location; } |
| bool shouldDoFullPaintInvalidation() const { return m_bitfields.shouldDoFullPaintInvalidation(); } |
| - void setShouldDoFullPaintInvalidation(bool b) { m_bitfields.setShouldDoFullPaintInvalidation(b); } |
| + void setShouldDoFullPaintInvalidation(bool); |
| + |
| bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInvalidateOverflowForPaint(); } |
| bool shouldDoFullPaintInvalidationIfSelfPaintingLayer() const { return m_bitfields.shouldDoFullPaintInvalidationIfSelfPaintingLayer(); } |
| @@ -1009,10 +1014,10 @@ public: |
| // layoutDidGetCalled indicates whether this render object was re-laid-out |
| // since the last call to setLayoutDidGetCalled(false) on this object. |
| - bool layoutDidGetCalled() { return m_bitfields.layoutDidGetCalled(); } |
| + bool layoutDidGetCalled() const { return m_bitfields.layoutDidGetCalled(); } |
| void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); } |
| - bool mayNeedPaintInvalidation() { return m_bitfields.mayNeedPaintInvalidation(); } |
| + bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInvalidation(); } |
| void setMayNeedPaintInvalidation(bool b) |
| { |
| m_bitfields.setMayNeedPaintInvalidation(b); |
| @@ -1025,9 +1030,13 @@ public: |
| bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayoutBecauseOfChildren(); } |
| void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutBecauseOfChildren(b); } |
| - bool shouldCheckForPaintInvalidation() |
| + bool shouldCheckForPaintInvalidation() const |
| { |
| - return layoutDidGetCalled() || mayNeedPaintInvalidation(); |
| + return m_bitfields.childNeedsPaintInvalidation() || shouldCheckForSelfPaintInvalidation(); |
| + } |
| + bool shouldCheckForSelfPaintInvalidation() const |
|
dsinclair
2014/07/17 18:36:01
The naming of these two methods doesn't seem quite
Xianzhu
2014/07/17 21:57:34
How about shouldCheckForTreePaintInvalidation() an
dsinclair
2014/07/18 14:15:04
My preference would be to get the word Tree out of
Xianzhu
2014/07/18 17:15:22
Agreed. Done.
|
| + { |
| + return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation(); |
| } |
| bool supportsLayoutStateCachedOffsets() const { return !hasColumns() && !hasTransform() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); } |
| @@ -1093,6 +1102,8 @@ protected: |
| void incrementallyInvalidatePaint(const RenderLayerModelObject& paintInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds); |
| void fullyInvalidatePaint(const RenderLayerModelObject& paintInvalidationContainer, InvalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBounds); |
| + void setChildNeedsPaintInvalidation(bool b) { m_bitfields.setChildNeedsPaintInvalidation(true); } |
| + |
| private: |
| const RenderLayerModelObject* enclosingCompositedContainer() const; |
| @@ -1154,6 +1165,7 @@ private: |
| // FIXME: We should remove mayNeedPaintInvalidation once we are able to |
| // use the other layout flags to detect the same cases. crbug.com/370118 |
| , m_mayNeedPaintInvalidation(false) |
| + , m_childNeedsPaintInvalidation(false) |
| , m_onlyNeededPositionedMovementLayout(false) |
| , m_neededLayoutBecauseOfChildren(false) |
| , m_needsPositionedMovementLayout(false) |
| @@ -1195,6 +1207,7 @@ private: |
| ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateOverflowForPaint); |
| ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidationIfSelfPaintingLayer, ShouldDoFullPaintInvalidationIfSelfPaintingLayer); |
| ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation); |
| + ADD_BOOLEAN_BITFIELD(childNeedsPaintInvalidation, ChildNeedsPaintInvalidation); |
| ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPositionedMovementLayout); |
| ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseOfChildren); |
| ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovementLayout); |