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

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

Issue 1391753005: (WIP) Invalidation during painting (for synchronized painting) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/paint/LineBoxListPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/LineBoxListPainter.cpp b/third_party/WebKit/Source/core/paint/LineBoxListPainter.cpp
index 9415606348ee67c0743bf2b277a57f8065b220b3..8b61ab28ffecb579041b0c1b1c7df824b4a19df7 100644
--- a/third_party/WebKit/Source/core/paint/LineBoxListPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/LineBoxListPainter.cpp
@@ -60,24 +60,34 @@ void LineBoxListPainter::paint(const LayoutBoxModelObject& layoutObject, const P
}
}
-static void invalidateLineBoxPaintOffsetsInternal(PaintController& paintController, InlineFlowBox* inlineBox)
+static void invalidateLineBoxPaintOffsetsInternal(const LayoutObject& layoutObject, PaintController& paintController, InlineFlowBox* inlineBox)
{
- paintController.invalidatePaintOffset(*inlineBox);
+ ASSERT(layoutObject == inlineBox->layoutObject());
+
+ if (!inlineBox->isRootInlineBox())
+ paintController.invalidatePaintOffset(*inlineBox);
+
for (InlineBox* child = inlineBox->firstChild(); child; child = child->nextOnLine()) {
+ if (layoutObject != child->layoutObject())
+ continue;
if (!child->lineLayoutItem().isText() && child->boxModelObject().hasSelfPaintingLayer())
continue;
if (child->isInlineFlowBox())
- invalidateLineBoxPaintOffsetsInternal(paintController, toInlineFlowBox(child));
+ invalidateLineBoxPaintOffsetsInternal(layoutObject, paintController, toInlineFlowBox(child));
else
paintController.invalidatePaintOffset(*child);
}
}
-void LineBoxListPainter::invalidateLineBoxPaintOffsets(const PaintInfo& paintInfo) const
+void LineBoxListPainter::invalidateLineBoxPaintOffsets(const LayoutObject& layoutObject, const PaintInfo& paintInfo) const
{
PaintController& paintController = paintInfo.context.paintController();
- for (InlineFlowBox* curr = m_lineBoxList.firstLineBox(); curr; curr = curr->nextLineBox())
- invalidateLineBoxPaintOffsetsInternal(paintController, curr);
+ for (InlineFlowBox* curr = m_lineBoxList.firstLineBox(); curr; curr = curr->nextLineBox()) {
+ // Invalidate paint offsets of the line boxes directly contained by the layoutObject.
+ // The other line boxes will be handled by their direct container layout objects.
+ if (layoutObject == curr->layoutObject())
+ invalidateLineBoxPaintOffsetsInternal(layoutObject, paintController, curr);
+ }
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/LineBoxListPainter.h ('k') | third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698