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

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

Issue 1993713002: Move line painting to BlockFlowPainter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Invoke BlockFlowPainter from BlockPainter instead. Created 4 years, 7 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/BlockFlowPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp b/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp
index a36a6003e736455472f78e6bd44d374bfd2e3cd7..ecc3e67b6d82dbe9b469532517bdb395c9b029bf 100644
--- a/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp
@@ -6,14 +6,31 @@
#include "core/layout/FloatingObjects.h"
#include "core/layout/LayoutBlockFlow.h"
-#include "core/paint/ClipScope.h"
-#include "core/paint/LayoutObjectDrawingRecorder.h"
+#include "core/paint/BlockPainter.h"
+#include "core/paint/LineBoxListPainter.h"
#include "core/paint/ObjectPainter.h"
#include "core/paint/PaintInfo.h"
-#include "core/paint/PaintLayer.h"
namespace blink {
+void BlockFlowPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+{
+ // Avoid painting descendants of the root element when stylesheets haven't loaded. This eliminates FOUC.
+ // It's ok not to draw, because later on, when all the stylesheets do load, styleResolverMayHaveChanged()
+ // on Document will trigger a full paint invalidation.
+ if (m_layoutBlockFlow.document().didLayoutWithPendingStylesheets() && !m_layoutBlockFlow.isLayoutView())
+ return;
+
+ if (!m_layoutBlockFlow.childrenInline()) {
+ BlockPainter(m_layoutBlockFlow).paintContents(paintInfo, paintOffset);
+ return;
+ }
+ if (shouldPaintDescendantOutlines(paintInfo.phase))
+ ObjectPainter(m_layoutBlockFlow).paintInlineChildrenOutlines(paintInfo, paintOffset);
+ else
+ LineBoxListPainter(m_layoutBlockFlow.lineBoxes()).paint(m_layoutBlockFlow, paintInfo, paintOffset);
+}
+
void BlockFlowPainter::paintFloats(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (!m_layoutBlockFlow.floatingObjects())
« no previous file with comments | « third_party/WebKit/Source/core/paint/BlockFlowPainter.h ('k') | third_party/WebKit/Source/core/paint/BlockPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698