Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
index 4973d95d5ebc1706b4035522f31a2c6431fdfc04..d6ad506212fbe3b7f28241b2b0128d846148fe23 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
@@ -76,6 +76,7 @@ |
#include "core/page/AutoscrollController.h" |
#include "core/page/Page.h" |
#include "core/paint/ObjectPainter.h" |
+#include "core/paint/PaintInfo.h" |
#include "core/paint/PaintLayer.h" |
#include "core/style/ContentData.h" |
#include "core/style/ShadowList.h" |
@@ -1416,6 +1417,29 @@ PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationS |
return invalidationReason; |
} |
+void LayoutObject::invalidatePaintIfNeededForSynchronizedPainting(const PaintInfo& paintInfo) |
+{ |
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()); |
+ ASSERT(document().lifecycle().state() == DocumentLifecycle::InPaint); |
+ ASSERT(paintInfo.paintInvalidationState); |
+ ASSERT(paintInfo.paintContainer()); |
+ |
+ DisplayItemList* displayItemList = paintInfo.context->displayItemList(); |
+ if (displayItemList->clientHasCheckedPaintInvalidation(displayItemClient())) { |
+ ASSERT(displayItemList->clientCacheIsValid(displayItemClient()) |
+ == (invalidatePaintIfNeeded(*paintInfo.paintInvalidationState, *paintInfo.paintContainer()) == PaintInvalidationNone)); |
+ return; |
+ } |
+ |
+ PaintInvalidationReason reason = invalidatePaintIfNeeded(*paintInfo.paintInvalidationState, *paintInfo.paintContainer()); |
+ clearPaintInvalidationState(*paintInfo.paintInvalidationState); |
+ |
+ if (reason == PaintInvalidationDelayedFull) |
+ paintInfo.paintInvalidationState->pushDelayedPaintInvalidationTarget(*this); |
+ |
+ displayItemList->setClientHasCheckedPaintInvalidation(displayItemClient()); |
+} |
+ |
PaintInvalidationReason LayoutObject::paintInvalidationReason(const LayoutBoxModelObject& paintInvalidationContainer, |
const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalidationBacking, |
const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalidationBacking) const |