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

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 665673004: Move selection invalidation to the invalidation phase (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tentative fix, up for slammin' reviews Created 6 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: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index d28180312373d34ffbdc76048d1316c00e21348b..483f9db7ceadb5bed6715b15e7d64b491c8d6bb4 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -130,6 +130,7 @@ struct SameSizeAsRenderObject {
unsigned m_bitfields;
unsigned m_bitfields2;
LayoutRect rect; // Stores the previous paint invalidation rect.
+ LayoutRect rect2; // Stores the previous selection paint invalidation rect.
dsinclair 2014/10/31 14:03:15 Would something like the following be better? Lay
LayoutPoint position; // Stores the previous position from the paint invalidation container.
};
@@ -1246,11 +1247,16 @@ void RenderObject::invalidateSelectionIfNeeded(const RenderLayerModelObject& pai
if (!shouldInvalidateSelection())
return;
- LayoutRect selection = selectionRectForPaintInvalidation(&paintInvalidationContainer);
- // FIXME: groupedMapping() leaks the squashing abstraction. See RenderBlockSelectionInfo for more details.
+ LayoutRect oldSelectionRect = m_previousSelectionRectForPaintInvalidation;
+ m_previousSelectionRectForPaintInvalidation = selectionRectForPaintInvalidation(&paintInvalidationContainer);
+ // FIXME: groupedMapping() leaks the squashing abstraction.
if (paintInvalidationContainer.layer()->groupedMapping())
- RenderLayer::mapRectToPaintBackingCoordinates(&paintInvalidationContainer, selection);
- invalidatePaintUsingContainer(&paintInvalidationContainer, selection, PaintInvalidationSelection);
+ RenderLayer::mapRectToPaintBackingCoordinates(&paintInvalidationContainer, m_previousSelectionRectForPaintInvalidation);
+
+ if (view()->doingFullPaintInvalidation())
+ return;
+
+ fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection, oldSelectionRect, m_previousSelectionRectForPaintInvalidation);
}
PaintInvalidationReason RenderObject::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const RenderLayerModelObject& paintInvalidationContainer)
@@ -1266,6 +1272,10 @@ PaintInvalidationReason RenderObject::invalidatePaintIfNeeded(const PaintInvalid
setPreviousPaintInvalidationRect(newBounds);
setPreviousPositionFromPaintInvalidationBacking(newLocation);
+ // We need to invalidate the selection before checking for whether we are doing a full invalidation.
+ // This is because we need to update the old rect regardless.
+ invalidateSelectionIfNeeded(paintInvalidationContainer);
dsinclair 2014/10/31 14:03:16 We need to update the rect regardless, but we don'
Julien - ping for review 2014/10/31 22:31:03 It was easy to do, added it.
+
PaintInvalidationReason invalidationReason = paintInvalidationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, newLocation);
// If we are set to do a full paint invalidation that means the RenderView will issue
@@ -1278,8 +1288,6 @@ PaintInvalidationReason RenderObject::invalidatePaintIfNeeded(const PaintInvalid
"object", this->debugName().ascii(),
"info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, newLocation));
- invalidateSelectionIfNeeded(paintInvalidationContainer);
-
if (invalidationReason == PaintInvalidationNone)
return invalidationReason;

Powered by Google App Engine
This is Rietveld 408576698