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

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

Issue 1387923002: LayoutObject::invalidatePaintIfNeededForSynchronizedPainting() and plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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.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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/PaintInvalidationState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698