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 85469ef8baeb70befcdbb797f57ebe3e3d300a91..cf65d3481606f8f83cf0fd38d607e5bac1e3a658 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| @@ -1484,12 +1484,6 @@ PaintInvalidationReason LayoutObject::getPaintInvalidationReason(const LayoutBox |
| const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalidationBacking, |
| const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalidationBacking) const |
| { |
| - // First check for InvalidationLocationChange to avoid it from being hidden by other |
| - // invalidation reasons because we'll need to force check for paint invalidation for |
| - // children when location of this object changed. |
| - if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidationBacking) |
| - return PaintInvalidationLocationChange; |
| - |
| if (shouldDoFullPaintInvalidation()) |
| return m_bitfields.fullPaintInvalidationReason(); |
| @@ -1499,11 +1493,12 @@ PaintInvalidationReason LayoutObject::getPaintInvalidationReason(const LayoutBox |
| if (styleRef().hasOutline()) |
| return PaintInvalidationOutline; |
| + bool locationChanged = newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidationBacking; |
| + |
| // If the bounds are the same then we know that none of the statements below |
| - // can match, so we can early out since we will not need to do any |
| - // invalidation. |
| + // can match, so we can early out. |
| if (oldBounds == newBounds) |
| - return PaintInvalidationNone; |
| + return locationChanged && !oldBounds.isEmpty() ? PaintInvalidationLocationChange : PaintInvalidationNone; |
| // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could |
| // be caused by some layout property (left / top) or some in-flow layoutObject inserted / removed before us in the tree. |
| @@ -1526,6 +1521,9 @@ PaintInvalidationReason LayoutObject::getPaintInvalidationReason(const LayoutBox |
| if (newBounds.isEmpty()) |
| return PaintInvalidationBecameInvisible; |
| + if (locationChanged) |
| + return PaintInvalidationLocationChange; |
|
chrishtr
2016/05/04 23:17:36
It looks like no code actually checks for PaintInv
Xianzhu
2016/05/04 23:25:46
I think like some other enum values, it might be n
|
| + |
| return PaintInvalidationIncremental; |
| } |