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

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

Issue 1774193002: New paint invalidation using paint property tree walk (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/core/layout/LayoutObject.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index 8614a89b100a0d259dabca599e1958db3b90da9f..bbc135b27aa54814aacd0dd203dca18ba20171e6 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -43,6 +43,7 @@
#include "core/layout/api/SelectionState.h"
#include "core/layout/compositing/CompositingState.h"
#include "core/layout/compositing/CompositingTriggers.h"
+#include "core/paint/ObjectPaintProperties.h"
#include "core/style/ComputedStyle.h"
#include "core/style/StyleInheritedData.h"
#include "platform/geometry/FloatQuad.h"
@@ -66,7 +67,6 @@ class LayoutFlowThread;
class LayoutGeometryMap;
class LayoutMultiColumnSpannerPlaceholder;
class LayoutView;
-class ObjectPaintProperties;
class PaintLayer;
class PseudoStyleRequest;
class TransformState;
@@ -1300,27 +1300,8 @@ public:
void adjustPreviousPaintInvalidationForScrollIfNeeded(const DoubleSize& scrollDelta);
// The previous position of the top-left corner of the object in its previous paint backing.
- const LayoutPoint& previousPositionFromPaintInvalidationBacking() const
- {
- ASSERT(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
- return m_previousPositionFromPaintInvalidationBacking;
- }
- void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& positionFromPaintInvalidationBacking)
- {
- ASSERT(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
- m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvalidationBacking;
- }
-
- bool paintOffsetChanged(const LayoutPoint& newPaintOffset) const
- {
- ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
- return m_previousPositionFromPaintInvalidationBacking != uninitializedPaintOffset() && m_previousPositionFromPaintInvalidationBacking != newPaintOffset;
- }
- void setPreviousPaintOffset(const LayoutPoint& paintOffset)
- {
- ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
- m_previousPositionFromPaintInvalidationBacking = paintOffset;
- }
+ const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { return m_previousPositionFromPaintInvalidationBacking; }
+ void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& positionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvalidationBacking; }
PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfields.fullPaintInvalidationReason(); }
bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone; }
@@ -1365,7 +1346,10 @@ public:
// Painters can use const methods only, except for these explicitly declared methods.
class MutableForPainting {
public:
- void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutObject.setPreviousPaintOffset(paintOffset); }
+ PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContainer) { return m_layoutObject.invalidatePaintIfNeeded(const_cast<PaintInvalidationState&>(paintInvalidationState), paintInvalidationContainer); }
+ void clearPaintInvalidationState(const PaintInvalidationState& paintInvalidationState) { m_layoutObject.clearPaintInvalidationState(paintInvalidationState); }
+ void setObjectPaintProperties(PassOwnPtr<ObjectPaintProperties> properties) { m_layoutObject.setObjectPaintProperties(properties); }
+ void clearObjectPaintProperties() { m_layoutObject.clearObjectPaintProperties(); }
private:
friend class LayoutObject;
@@ -1634,7 +1618,7 @@ private:
// The passed rect is mutated into the coordinate space of the paint invalidation container.
const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRect&) const;
- static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUnit::max(), LayoutUnit::max()); }
+ LayoutObject* parentCrossingFrameBoundaries() const;
RefPtr<ComputedStyle> m_style;
@@ -1780,11 +1764,11 @@ private:
// widths.
ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidthsDirty);
- ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateOverflowForPaint); // TODO(wangxianzhu): Remove for slimming paint v2.
+ ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateOverflowForPaint);
ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, ChildShouldCheckForPaintInvalidation);
ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation);
- ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection); // TODO(wangxianzhu): Remove for slimming paint v2.
- ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseOfChildren); // TODO(wangxianzhu): Remove for slimming paint v2.
+ ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection);
+ ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseOfChildren);
// This boolean is the cached value of 'float'
// (see ComputedStyle::isFloating).
@@ -1921,8 +1905,6 @@ private:
// 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().
- // For slimmingPaintInvalidation, this stores the previous paint offset.
- // TODO(wangxianzhu): Rename this to m_previousPaintOffset when we enable slimmingPaintInvalidation.
LayoutPoint m_previousPositionFromPaintInvalidationBacking;
};

Powered by Google App Engine
This is Rietveld 408576698