summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
diff options
context:
space:
mode:
authorwangxianzhu <wangxianzhu@chromium.org>2016-03-25 18:09:36 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-26 01:11:03 +0000
commit934f67a68da2054e526e13648c5452e2cf79c211 (patch)
tree277c6dd46f8140a7ef848eed1acf0c7e8432932a /third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
parent2e08ddfc910194c1fed498a86f55518707322dd3 (diff)
downloadchromium_src-934f67a68da2054e526e13648c5452e2cf79c211.zip
chromium_src-934f67a68da2054e526e13648c5452e2cf79c211.tar.gz
chromium_src-934f67a68da2054e526e13648c5452e2cf79c211.tar.bz2
Move all fast-path paint invalidation mapping into PaintInvalidationState
- Remove the optional const PaintInvalidationState* parameter from paint invalidation mapping methods and move fast-path mapping code into PaintInvalidationState. - PaintLayer::computePaintInvalidationRect() is now PaintInvalidationState::computePaintInvalidationRectInBacking(); PaintLayer::positionFromPaintInvalidationBacking() is now PaintInvalidationState::positionFromPaintInvalidationBacking(); PaintLayer::mapRectToPaintInvalidationBacking() is now PaintInvalidationState::mapLocalRectToPaintInvalidationBacking(). - Change LayoutObject::clippedOverflowRectForPaintInvalidationBacking() to: * Non-SVG objects and LayoutSVGRoot: LayoutObject::localOverflowRectForPaintInvalidation() which doesn't map the rect to paint invalidation backing; * SVG objects except LayoutSVGRoot: Using existing paintInvalidationRectInLocalSVGCoordinates() PaintInvalidationState::computePaintInvalidationRectInBacking(), calls the above functions to get the local paint invalidation rect, and map to paintInvalidationContainer using fast path if possible, or slow path by calling LayoutObject::mapToVisibleRectToAncestor(). - Let selection paint invalidation go through fast-path if possible. BUG=591199 Review URL: https://codereview.chromium.org/1813383002 Cr-Commit-Position: refs/heads/master@{#383430}
Diffstat (limited to 'third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp')
-rw-r--r--third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index af2bed6..e5294b7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -360,12 +360,12 @@ void LayoutBoxModelObject::invalidateTreeIfNeeded(const PaintInvalidationState&
{
ASSERT(!needsLayout());
- if (!shouldCheckForPaintInvalidation(paintInvalidationState))
+ PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *this);
+ if (!shouldCheckForPaintInvalidation(newPaintInvalidationState))
return;
LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRect();
- PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *this);
// TODO(wangxianzhu): Enable this assert after we fix all paintInvalidationContainer mismatch issues. crbug.com/360286
// ASSERT(&newPaintInvalidationState.paintInvalidationContainer() == &containerForPaintInvalidation());
@@ -378,6 +378,8 @@ void LayoutBoxModelObject::invalidateTreeIfNeeded(const PaintInvalidationState&
if (reason == PaintInvalidationLocationChange)
newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer();
+ // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTreeIfNeeded() when removing the following workarounds.
+
// TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove when we enable paint offset caching.
if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef()))
newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer();
@@ -390,7 +392,7 @@ void LayoutBoxModelObject::invalidateTreeIfNeeded(const PaintInvalidationState&
&& hasOverflowClip())
newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinContainer();
- newPaintInvalidationState.updatePaintOffsetAndClipForChildren();
+ newPaintInvalidationState.updateForChildren();
invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState);
}