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

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

Issue 2476813002: Move LayoutObject::m_previousPosition... into a global map in ObjectPaintInvalidator (Closed)
Patch Set: doc Created 4 years, 1 month 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 18181096b12946f1b6250fee2c54a311780b5c3b..43b6c5dad56c4e0b2d2b1ba5fcad70a0a5d3b616 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
@@ -151,9 +151,14 @@ LayoutRect PaintInvalidator::computeVisualRectInBacking(
return mapLocalRectToPaintInvalidationBacking(object, localRect, context);
}
-LayoutPoint PaintInvalidator::computeLocationFromPaintInvalidationBacking(
+LayoutPoint PaintInvalidator::computeLocationInBacking(
const LayoutObject& object,
const PaintInvalidatorContext& context) {
+ // Use visual rect location for LayoutTexts because it suffices to check
+ // visual rect change for layout caused invalidation.
+ if (object.isText())
+ return context.newVisualRect.location();
+
FloatPoint point;
if (object != context.paintInvalidationContainer) {
point.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset));
@@ -322,11 +327,11 @@ void PaintInvalidator::updateContext(const LayoutObject& object,
context.forcedSubtreeInvalidationFlags |=
PaintInvalidatorContext::ForcedSubtreeSlowPathRect;
+ ObjectPaintInvalidator objectPaintInvalidator(object);
context.oldVisualRect = object.previousVisualRect();
- context.oldLocation = object.previousPositionFromPaintInvalidationBacking();
+ context.oldLocation = objectPaintInvalidator.previousLocationInBacking();
context.newVisualRect = computeVisualRectInBacking(object, context);
- context.newLocation =
- computeLocationFromPaintInvalidationBacking(object, context);
+ context.newLocation = computeLocationInBacking(object, context);
IntSize adjustment = object.scrollAdjustmentForPaintInvalidation(
*context.paintInvalidationContainer);
@@ -334,8 +339,7 @@ void PaintInvalidator::updateContext(const LayoutObject& object,
context.newVisualRect.move(adjustment);
object.getMutableForPainting().setPreviousVisualRect(context.newVisualRect);
- object.getMutableForPainting()
- .setPreviousPositionFromPaintInvalidationBacking(context.newLocation);
+ objectPaintInvalidator.setPreviousLocationInBacking(context.newLocation);
}
void PaintInvalidator::invalidatePaintIfNeeded(
« 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