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

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

Issue 1823353003: Disable subsequence caching when didLayoutWithPendingStylesheets is true. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 0a6252bb97619ba13f0f2ee27db062730789b882..1adf2cf4b26de53dc455d7bb47cf4feeefa40dc0 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -36,12 +36,12 @@
namespace blink {
-static inline bool shouldSuppressPaintingLayer(PaintLayer* layer)
+static inline bool shouldSuppressPaintingLayer(const PaintLayer& layer)
{
// Avoid painting descendants of the root layer when stylesheets haven't loaded. This eliminates FOUC.
// It's ok not to draw, because later on, when all the stylesheets do load, updateStyleSelector on the Document
// will do a full paintInvalidationForWholeLayoutObject().
Xianzhu 2016/03/23 03:44:56 The comment above refer to methods that no longer
chrishtr 2016/03/23 16:26:31 Will send you a CL now to fix the comment.
- if (layer->layoutObject()->document().didLayoutWithPendingStylesheets() && !layer->isRootLayer() && !layer->layoutObject()->isDocumentElement())
+ if (layer.layoutObject()->document().didLayoutWithPendingStylesheets() && !layer.isRootLayer() && !layer.layoutObject()->isDocumentElement())
return true;
return false;
@@ -77,7 +77,7 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayer(GraphicsContext& co
if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLayerDescendant())
return FullyPainted;
- if (shouldSuppressPaintingLayer(&m_paintLayer))
+ if (shouldSuppressPaintingLayer(m_paintLayer))
return FullyPainted;
if (m_paintLayer.layoutObject()->isLayoutView() && toLayoutView(m_paintLayer.layoutObject())->frameView()->shouldThrottleRendering())
@@ -209,6 +209,12 @@ static bool shouldCreateSubsequence(const PaintLayer& paintLayer, GraphicsContex
if (!PaintLayerStackingNodeIterator(*paintLayer.stackingNode(), AllChildren).next())
return false;
+ // When in FOUC-avoidance mode, don't cache any subsequences, to avoid having
+ // to invalidate all of them when leaving this mode. There is an early-out in BlockPainter::paintContents that may result
+ // in nothing getting painted in thos mode, in addition to early-out logic in PaintLayerPainter.
+ if (paintLayer.layoutObject()->document().didLayoutWithPendingStylesheets())
+ return false;
+
return true;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698