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

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

Issue 2037713002: Adjust for composited scrolling when invalidating paint rectangles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 80b5de729fdeeb9c48259570b3956b2a4805960d..d412da2498cd8a3eb34d3da1a1dbf4d631c87d46 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1268,6 +1268,12 @@ void LayoutObject::invalidateDisplayItemClientsWithPaintInvalidationState(const
invalidateDisplayItemClients(paintInvalidationContainer, invalidationReason);
}
+
+bool LayoutObject::compositedScrollsWithRespectTo(const LayoutBoxModelObject& paintInvalidationContainer) const
+{
+ return paintInvalidationContainer.usesCompositedScrolling() && this != &paintInvalidationContainer;
+}
+
const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const LayoutRect& dirtyRect) const
{
RELEASE_ASSERT(isRooted());
@@ -1281,6 +1287,13 @@ const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const
const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintInvalidation();
LayoutRect dirtyRectOnBacking = dirtyRect;
PaintLayer::mapRectToPaintInvalidationBacking(*this, paintInvalidationContainer, dirtyRectOnBacking);
+
+ // Composited scrolling should not be included in the bounds of composited-scrolled items.
+ if (compositedScrollsWithRespectTo(paintInvalidationContainer)) {
+ LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrolledContentOffset());
+ dirtyRectOnBacking.move(inverseOffset);
+ }
+
invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking, PaintInvalidationRectangle);
return &paintInvalidationContainer;
}
@@ -1386,7 +1399,7 @@ inline void LayoutObject::invalidateSelectionIfNeeded(const LayoutBoxModelObject
// Composited scrolling should not be included in the bounds and position tracking, because the graphics layer backing the scroller
// does not move on scroll.
- if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidationContainer != this) {
+ if (compositedScrollsWithRespectTo(paintInvalidationContainer)) {
LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrolledContentOffset());
newSelectionRect.move(inverseOffset);
}
@@ -1425,7 +1438,7 @@ PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid
// Composited scrolling should not be included in the bounds and position tracking, because the graphics layer backing the scroller
// does not move on scroll.
- if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidationContainer != this) {
+ if (compositedScrollsWithRespectTo(paintInvalidationContainer)) {
LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrolledContentOffset());
newLocation.move(inverseOffset);
newBounds.move(inverseOffset);
@@ -1528,7 +1541,7 @@ PaintInvalidationReason LayoutObject::getPaintInvalidationReason(const PaintInva
void LayoutObject::adjustInvalidationRectForCompositedScrolling(LayoutRect& rect, const LayoutBoxModelObject& paintInvalidationContainer) const
{
- if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidationContainer != this) {
+ if (compositedScrollsWithRespectTo(paintInvalidationContainer)) {
LayoutSize offset(-toLayoutBox(&paintInvalidationContainer)->scrolledContentOffset());
rect.move(offset);
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698