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

Unified Diff: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp

Issue 2761673005: Optimize scroll adjustment for paint invalidation
Patch Set: - Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInvalidator.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/paint/PaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
index 1c06307669e9806504882409f305d5f9f4682975..d7c7721813fabaa2e3b1e56015c14657a4ba085e 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
@@ -137,6 +137,7 @@ static LayoutRect mapLocalRectToVisualRectInBacking(
// Convert the result to the container's contents space.
result.moveBy(-context.paintInvalidationContainer->paintOffset());
+ result.move(context.scrollAdjustment);
}
object.adjustVisualRectForRasterEffects(result);
@@ -144,9 +145,6 @@ static LayoutRect mapLocalRectToVisualRectInBacking(
PaintLayer::mapRectInPaintInvalidationContainerToBacking(
*context.paintInvalidationContainer, result);
- result.move(object.scrollAdjustmentForPaintInvalidation(
- *context.paintInvalidationContainer));
-
return result;
}
@@ -195,6 +193,7 @@ LayoutPoint PaintInvalidator::computeLocationInBacking(
// Convert the result to the container's contents space.
point.moveBy(-context.paintInvalidationContainer->paintOffset());
+ point.move(context.scrollAdjustment);
}
if (context.paintInvalidationContainer->layer()->groupedMapping()) {
@@ -204,9 +203,6 @@ LayoutPoint PaintInvalidator::computeLocationInBacking(
point = LayoutPoint(floatPoint);
}
- point.move(object.scrollAdjustmentForPaintInvalidation(
- *context.paintInvalidationContainer));
-
return point;
}
@@ -290,6 +286,8 @@ class ScopedUndoFrameViewContentClipAndScroll {
void PaintInvalidator::updatePaintInvalidationContainer(
const LayoutObject& object,
PaintInvalidatorContext& context) {
+ const auto* oldPaintInvalidationContainer =
+ context.paintInvalidationContainer;
if (object.isPaintInvalidationContainer()) {
context.paintInvalidationContainer = toLayoutBoxModelObject(&object);
if (object.styleRef().isStackingContext())
@@ -343,6 +341,15 @@ void PaintInvalidator::updatePaintInvalidationContainer(
}
}
+ if (context.paintInvalidationContainer != oldPaintInvalidationContainer) {
+ context.scrollAdjustment = context.paintInvalidationContainer
+ ->scrollAdjustmentForPaintInvalidation();
+ } else {
+ DCHECK(context.scrollAdjustment ==
+ context.paintInvalidationContainer
+ ->scrollAdjustmentForPaintInvalidation());
+ }
+
DCHECK(context.paintInvalidationContainer ==
object.containerForPaintInvalidation());
DCHECK(context.paintingLayer == object.paintingLayer());
@@ -399,6 +406,8 @@ void PaintInvalidator::invalidatePaintIfNeeded(
context.paintInvalidationContainer =
context.paintInvalidationContainerForStackedContents =
&layoutView->containerForPaintInvalidation();
+ context.scrollAdjustment = context.paintInvalidationContainer
+ ->scrollAdjustmentForPaintInvalidation();
context.paintingLayer = layoutView->layer();
if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInvalidator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698