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

Unified Diff: third_party/WebKit/Source/core/layout/line/InlineBox.cpp

Issue 2087513003: Remove LayoutBlockFlow overflow invalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NeedsRebaseline Created 4 years, 6 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/line/InlineBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/line/InlineBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineBox.cpp
index 93f11136dbc85c86e8c7c826cc551c684eeab383..777d2189fc9df751879da03f339a15af594d2281 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineBox.cpp
+++ b/third_party/WebKit/Source/core/layout/line/InlineBox.cpp
@@ -65,9 +65,17 @@ void InlineBox::destroy()
{
// We do not need to issue invalidations if the page is being destroyed
// since these objects will never be repainted.
- // TODO(crbug.com/619630): Make this fast.
- if (!m_lineLayoutItem.documentBeingDestroyed())
- m_lineLayoutItem.slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(*this, PaintInvalidationFull);
+ if (!m_lineLayoutItem.documentBeingDestroyed()) {
+ setLineLayoutItemShouldDoFullPaintInvalidationIfNeeded();
+
+#if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
+ // This object may have display items in a cached subsequence, but we are
+ // sure that the subsequence will be invalidated because m_lineLayoutItem has
+ // been setShouldFullPaintInvalidation(), so deletion of this object is safe.
+ endShouldKeepAlive();
+#endif
+ }
+
delete this;
}
@@ -214,6 +222,8 @@ void InlineBox::move(const LayoutSize& delta)
if (getLineLayoutItem().isAtomicInlineLevel())
LineLayoutBox(getLineLayoutItem()).move(delta.width(), delta.height());
+
+ setLineLayoutItemShouldDoFullPaintInvalidationIfNeeded();
}
void InlineBox::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit /* lineTop */, LayoutUnit /* lineBottom */) const
@@ -383,14 +393,21 @@ LayoutPoint InlineBox::flipForWritingMode(const LayoutPoint& point) const
return root().block().flipForWritingMode(point);
}
-void InlineBox::invalidateDisplayItemClientsRecursively()
+void InlineBox::setShouldDoFullPaintInvalidationRecursively()
{
- // TODO(crbug.com/619630): Make this fast.
- getLineLayoutItem().slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(*this, PaintInvalidationFull);
+ getLineLayoutItem().setShouldDoFullPaintInvalidation();
if (!isInlineFlowBox())
return;
for (InlineBox* child = toInlineFlowBox(this)->firstChild(); child; child = child->nextOnLine())
- child->invalidateDisplayItemClientsRecursively();
+ child->setShouldDoFullPaintInvalidationRecursively();
+}
+
+void InlineBox::setLineLayoutItemShouldDoFullPaintInvalidationIfNeeded()
+{
+ // For RootInlineBox, we only need to invalidate if it's using the first line style.
+ // otherwise it paints nothing so we don't need to invalidate it.
+ if (!isRootInlineBox() || isFirstLineStyle())
+ m_lineLayoutItem.setShouldDoFullPaintInvalidation();
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.h ('k') | third_party/WebKit/Source/core/layout/line/LineLayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698