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

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

Issue 2779683002: Revert of Add 'WithoutGeometryChange' variants of paint invalidation flag setters (Closed)
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
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 f1a02b92ae994f4d8b3b39d222de81e8fa5572c3..2f058262c0a0d371c51b23bfe4bf2b2716997f83 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1624,7 +1624,6 @@
void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() {
bool neededRecalc = needsOverflowRecalcAfterStyleChange();
setSelfNeedsOverflowRecalcAfterStyleChange();
- setMayNeedPaintInvalidation();
if (!neededRecalc)
markAncestorsForOverflowRecalcIfNeeded();
}
@@ -1724,17 +1723,11 @@
}
if (diff.needsPaintInvalidationSubtree() ||
- updatedDiff.needsPaintInvalidationSubtree()) {
+ updatedDiff.needsPaintInvalidationSubtree())
setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
- } else if (diff.needsPaintInvalidationObject() ||
- updatedDiff.needsPaintInvalidationObject()) {
- // TODO(wangxianzhu): For now LayoutSVGRoot::localVisualRect() depends on
- // several styles. Refactor to avoid this special case.
- if (isSVGRoot())
- setShouldDoFullPaintInvalidation();
- else
- setShouldDoFullPaintInvalidationWithoutGeometryChange();
- }
+ else if (diff.needsPaintInvalidationObject() ||
+ updatedDiff.needsPaintInvalidationObject())
+ setShouldDoFullPaintInvalidation();
// Text nodes share style with their parents but the paint properties don't
// apply to them, hence the !isText() check.
@@ -3416,24 +3409,14 @@
for (LayoutObject* parent = this->paintInvalidationParent();
parent && !parent->shouldCheckForPaintInvalidation();
parent = parent->paintInvalidationParent())
- parent->m_bitfields.setMayNeedPaintInvalidation(true);
-}
-
-inline void LayoutObject::setNeedsPaintOffsetAndVisualRectUpdate() {
- if (needsPaintOffsetAndVisualRectUpdate())
- return;
- m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true);
- for (LayoutObject* parent = paintInvalidationParent();
- parent && !parent->needsPaintOffsetAndVisualRectUpdate();
- parent = parent->paintInvalidationParent())
- parent->m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true);
+ parent->m_bitfields.setChildShouldCheckForPaintInvalidation(true);
}
void LayoutObject::setShouldInvalidateSelection() {
if (!canUpdateSelectionOnRootLineBoxes())
return;
m_bitfields.setShouldInvalidateSelection(true);
- setMayNeedPaintInvalidation();
+ markAncestorsForPaintInvalidation();
frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded();
}
@@ -3445,14 +3428,8 @@
void LayoutObject::setShouldDoFullPaintInvalidation(
PaintInvalidationReason reason) {
- setNeedsPaintOffsetAndVisualRectUpdate();
- setShouldDoFullPaintInvalidationWithoutGeometryChange(reason);
-}
-
-void LayoutObject::setShouldDoFullPaintInvalidationWithoutGeometryChange(
- PaintInvalidationReason reason) {
// Only full invalidation reasons are allowed.
- DCHECK(isFullPaintInvalidationReason(reason));
+ ASSERT(isFullPaintInvalidationReason(reason));
bool isUpgradingDelayedFullToFull =
m_bitfields.fullPaintInvalidationReason() ==
@@ -3473,11 +3450,6 @@
}
void LayoutObject::setMayNeedPaintInvalidation() {
- setNeedsPaintOffsetAndVisualRectUpdate();
- setMayNeedPaintInvalidationWithoutGeometryChange();
-}
-
-void LayoutObject::setMayNeedPaintInvalidationWithoutGeometryChange() {
if (mayNeedPaintInvalidation())
return;
m_bitfields.setMayNeedPaintInvalidation(true);
@@ -3496,7 +3468,7 @@
if (mayNeedPaintInvalidationAnimatedBackgroundImage())
return;
m_bitfields.setMayNeedPaintInvalidationAnimatedBackgroundImage(true);
- setMayNeedPaintInvalidationWithoutGeometryChange();
+ setMayNeedPaintInvalidation();
}
void LayoutObject::clearPaintInvalidationFlags() {
@@ -3506,10 +3478,10 @@
DCHECK(!shouldCheckForPaintInvalidation() || paintInvalidationStateIsDirty());
#endif
clearShouldDoFullPaintInvalidation();
+ m_bitfields.setChildShouldCheckForPaintInvalidation(false);
m_bitfields.setMayNeedPaintInvalidation(false);
m_bitfields.setMayNeedPaintInvalidationSubtree(false);
m_bitfields.setMayNeedPaintInvalidationAnimatedBackgroundImage(false);
- m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(false);
m_bitfields.setShouldInvalidateSelection(false);
m_bitfields.setBackgroundChangedSinceLastPaintInvalidation(false);
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698