Chromium Code Reviews| 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..d583aff8aa964246f0499d5fd45ba0e6845d8794 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,32 @@ PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationS |
| return invalidationReason; |
| } |
| +void LayoutObject::invalidatePaintIfNeededForSynchronziedPainting(const PaintInfo& paintInfo) |
| +{ |
| + ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()); |
| + ASSERT(document().lifecycle().state() == DocumentLifecycle::InPaint); |
| + ASSERT(paintInfo.paintInvalidationState); |
| + ASSERT(paintInfo.paintContainer()); |
| + |
| + DisplayItemList* displayItemList = paintInfo.context->displayItemList(); |
| + // TODO(chrishtr): paintInvalidationContainer for squashed layer. |
|
chrishtr
2015/10/05 21:50:35
This works out of the box. GraphicsLayer::paint ca
Xianzhu
2015/10/05 22:04:15
Done.
|
| + const LayoutBoxModelObject& paintInvalidationContainer = *paintInfo.paintContainer(); |
| + |
| + if (displayItemList->clientHasCheckedPaintInvalidation(displayItemClient())) { |
| + ASSERT(displayItemList->clientCacheIsValid(displayItemClient()) |
| + == (invalidatePaintIfNeeded(*paintInfo.paintInvalidationState, paintInvalidationContainer) == PaintInvalidationNone)); |
| + return; |
| + } |
| + |
| + PaintInvalidationReason reason = invalidatePaintIfNeeded(*paintInfo.paintInvalidationState, paintInvalidationContainer); |
| + 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 |