Chromium Code Reviews| 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; |
| } |