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

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

Issue 1813383002: Move all fast-path paint invalidation mapping into PaintInvalidationState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reorganize conditions in PaintInvalidationState constructor Created 4 years, 9 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/LayoutReplaced.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
index e2737bd2f7786a07ad4b94c9f079fdbdf6b20eaf..bd27c594a47772ee24036d0e686671722edca626 100644
--- a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
@@ -709,21 +709,6 @@ PositionWithAffinity LayoutReplaced::positionForPoint(const LayoutPoint& point)
return LayoutBox::positionForPoint(point);
}
-LayoutRect LayoutReplaced::selectionRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer) const
-{
- ASSERT(!needsLayout());
-
- LayoutRect rect = localSelectionRect();
- if (rect.isEmpty())
- return rect;
-
- mapToVisibleRectInAncestorSpace(paintInvalidationContainer, rect, 0);
- // FIXME: groupedMapping() leaks the squashing abstraction.
- if (paintInvalidationContainer->layer()->groupedMapping())
- PaintLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, rect);
- return rect;
-}
-
LayoutRect LayoutReplaced::localSelectionRect() const
{
if (getSelectionState() == SelectionNone)
@@ -751,8 +736,11 @@ void LayoutReplaced::setSelectionState(SelectionState state)
// We only include the space below the baseline in our layer's cached paint invalidation rect if the
// image is selected. Since the selection state has changed update the rect.
- if (hasLayer())
- setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(containerForPaintInvalidation()));
+ if (hasLayer()) {
+ LayoutRect rect = localOverflowRectForPaintInvalidation();
+ PaintLayer::mapRectToPaintInvalidationBacking(*this, containerForPaintInvalidation(), rect);
+ setPreviousPaintInvalidationRect(rect);
+ }
if (canUpdateSelectionOnRootLineBoxes())
inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone);

Powered by Google App Engine
This is Rietveld 408576698