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

Unified Diff: Source/core/layout/LayoutObject.h

Issue 1315213002: (WIP) Paint invalidation for slimming paint v2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | « Source/core/layout/LayoutBox.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutObject.h
diff --git a/Source/core/layout/LayoutObject.h b/Source/core/layout/LayoutObject.h
index 84e8af67fea41dae10f28f58c5ebb7ae6fe14f0d..296b8bfcc7fc582684610e4c5a84f59cfc6f4d9c 100644
--- a/Source/core/layout/LayoutObject.h
+++ b/Source/core/layout/LayoutObject.h
@@ -913,6 +913,7 @@ public:
inline void setSelectionStateIfNeeded(SelectionState);
bool canUpdateSelectionOnRootLineBoxes() const;
+ // TODO: Remove for slimming paint v2.
// A single rectangle that encompasses all of the selected objects within this object. Used to determine the tightest
// possible bounding box for the selection. The rect returned is in the coordinate space of the paint invalidation container's backing.
virtual LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObject* /*paintInvalidationContainer*/) const { return LayoutRect(); }
@@ -1032,6 +1033,7 @@ public:
bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInvalidateOverflowForPaint(); }
virtual void clearPaintInvalidationState(const PaintInvalidationState&);
+ void clearSelfPaintInvalidationFlags();
bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInvalidation(); }
void setMayNeedPaintInvalidation();
@@ -1049,7 +1051,12 @@ public:
bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() const
{
- return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection() || m_bitfields.childShouldCheckForPaintInvalidation();
+ return selfShouldCheckForPaintInvalidation() || m_bitfields.childShouldCheckForPaintInvalidation();
+ }
+
+ bool selfShouldCheckForPaintInvalidation() const
+ {
+ return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection();
}
virtual bool supportsPaintInvalidationStateCachedOffsets() const { return !hasTransformRelatedProperty() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); }
@@ -1076,6 +1083,7 @@ public:
bool childNeedsRepaint() const { return m_bitfields.childNeedsRepaint(); }
bool shouldCheckForRepaint() const { return selfNeedsRepaint() || childNeedsRepaint(); }
+ virtual PaintInvalidationReason invalidatePaintIfNeededForSlimmingPaintV2(const LayoutPoint& newPaintOffset);
void clearRepaintFlagsRecursively();
protected:
@@ -1246,6 +1254,7 @@ private:
void invalidatePaintIncludingNonCompositingDescendantsInternal(const LayoutBoxModelObject& repaintContainer);
+ // TODO: Remove for slimming paint v2.
LayoutRect previousSelectionRectForPaintInvalidation() const;
void setPreviousSelectionRectForPaintInvalidation(const LayoutRect&);
@@ -1352,7 +1361,7 @@ private:
{
}
- // 32 bits have been used in the first word, and 18 in the second.
+ // 32 bits have been used in the first word, and 19 in the second.
ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout);
ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateOverflowForPaint); // TODO(wangxianzhu): Remove for slimming paint v2.
ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, ChildShouldCheckForPaintInvalidation);
@@ -1461,12 +1470,17 @@ private:
// This stores the paint invalidation rect from the previous frame. This rect does *not* account for composited scrolling. See
// adjustInvalidationRectForCompositedScrolling().
+ // TODO: Remove for slimming paint v2.
LayoutRect m_previousPaintInvalidationRect;
// This stores the position in the paint invalidation backing's coordinate.
// It is used to detect layoutObject shifts that forces a full invalidation.
// This point does *not* account for composited scrolling. See adjustInvalidationRectForCompositedScrolling().
- LayoutPoint m_previousPositionFromPaintInvalidationBacking;
+ union {
+ LayoutPoint m_previousPositionFromPaintInvalidationBacking; // TODO: Remove for slimming paint v2.
+ // For slimming paint v2: previous paint offset in the space of the nearest transform container.
+ LayoutPoint m_previousPaintOffset;
+ };
};
// FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit.
« no previous file with comments | « Source/core/layout/LayoutBox.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698