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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 1833003002: Revert of Disable subsequence caching when didLayoutWithPendingStylesheets is true. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/layout/ClipPathOperation.h" 9 #include "core/layout/ClipPathOperation.h"
10 #include "core/layout/LayoutBlock.h" 10 #include "core/layout/LayoutBlock.h"
(...skipping 18 matching lines...) Expand all
29 #include "platform/graphics/paint/ClipRecorder.h" 29 #include "platform/graphics/paint/ClipRecorder.h"
30 #include "platform/graphics/paint/CompositingRecorder.h" 30 #include "platform/graphics/paint/CompositingRecorder.h"
31 #include "platform/graphics/paint/PaintChunkProperties.h" 31 #include "platform/graphics/paint/PaintChunkProperties.h"
32 #include "platform/graphics/paint/ScopedPaintChunkProperties.h" 32 #include "platform/graphics/paint/ScopedPaintChunkProperties.h"
33 #include "platform/graphics/paint/SubsequenceRecorder.h" 33 #include "platform/graphics/paint/SubsequenceRecorder.h"
34 #include "platform/graphics/paint/Transform3DDisplayItem.h" 34 #include "platform/graphics/paint/Transform3DDisplayItem.h"
35 #include "wtf/Optional.h" 35 #include "wtf/Optional.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 static inline bool shouldSuppressPaintingLayer(const PaintLayer& layer) 39 static inline bool shouldSuppressPaintingLayer(PaintLayer* layer)
40 { 40 {
41 // Avoid painting descendants of the root layer when stylesheets haven't loa ded. This eliminates FOUC. 41 // Avoid painting descendants of the root layer when stylesheets haven't loa ded. This eliminates FOUC.
42 // It's ok not to draw, because later on, when all the stylesheets do load, updateStyleSelector on the Document 42 // It's ok not to draw, because later on, when all the stylesheets do load, updateStyleSelector on the Document
43 // will do a full paintInvalidationForWholeLayoutObject(). 43 // will do a full paintInvalidationForWholeLayoutObject().
44 if (layer.layoutObject()->document().didLayoutWithPendingStylesheets() && !l ayer.isRootLayer() && !layer.layoutObject()->isDocumentElement()) 44 if (layer->layoutObject()->document().didLayoutWithPendingStylesheets() && ! layer->isRootLayer() && !layer->layoutObject()->isDocumentElement())
45 return true; 45 return true;
46 46
47 return false; 47 return false;
48 } 48 }
49 49
50 void PaintLayerPainter::paint(GraphicsContext& context, const LayoutRect& damage Rect, const GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags) 50 void PaintLayerPainter::paint(GraphicsContext& context, const LayoutRect& damage Rect, const GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags)
51 { 51 {
52 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), globalPaintFlags, LayoutSize()); 52 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), globalPaintFlags, LayoutSize());
53 if (shouldPaintLayerInSoftwareMode(globalPaintFlags, paintFlags)) 53 if (shouldPaintLayerInSoftwareMode(globalPaintFlags, paintFlags))
54 paintLayer(context, paintingInfo, paintFlags); 54 paintLayer(context, paintingInfo, paintFlags);
(...skipping 15 matching lines...) Expand all
70 // FIXME: why isn't the code here global, as opposed to being set on each paintLayer() call? 70 // FIXME: why isn't the code here global, as opposed to being set on each paintLayer() call?
71 paintFlags |= PaintLayerUncachedClipRects; 71 paintFlags |= PaintLayerUncachedClipRects;
72 } 72 }
73 } 73 }
74 74
75 // Non self-painting layers without self-painting descendants don't need to be painted as their 75 // Non self-painting layers without self-painting descendants don't need to be painted as their
76 // layoutObject() should properly paint itself. 76 // layoutObject() should properly paint itself.
77 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye rDescendant()) 77 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye rDescendant())
78 return FullyPainted; 78 return FullyPainted;
79 79
80 if (shouldSuppressPaintingLayer(m_paintLayer)) 80 if (shouldSuppressPaintingLayer(&m_paintLayer))
81 return FullyPainted; 81 return FullyPainted;
82 82
83 if (m_paintLayer.layoutObject()->isLayoutView() && toLayoutView(m_paintLayer .layoutObject())->frameView()->shouldThrottleRendering()) 83 if (m_paintLayer.layoutObject()->isLayoutView() && toLayoutView(m_paintLayer .layoutObject())->frameView()->shouldThrottleRendering())
84 return FullyPainted; 84 return FullyPainted;
85 85
86 // If this layer is totally invisible then there is nothing to paint. 86 // If this layer is totally invisible then there is nothing to paint.
87 if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()- >hasBackdropFilter()) 87 if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()- >hasBackdropFilter())
88 return FullyPainted; 88 return FullyPainted;
89 89
90 if (m_paintLayer.paintsWithTransparency(paintingInfo.globalPaintFlags())) 90 if (m_paintLayer.paintsWithTransparency(paintingInfo.globalPaintFlags()))
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 return false; 202 return false;
203 203
204 // Create subsequence for only stacking contexts whose painting are atomic. 204 // Create subsequence for only stacking contexts whose painting are atomic.
205 if (!paintLayer.stackingNode()->isStackingContext()) 205 if (!paintLayer.stackingNode()->isStackingContext())
206 return false; 206 return false;
207 207
208 // The layer doesn't have children. Subsequence caching is not worth because normally the actual painting will be cheap. 208 // The layer doesn't have children. Subsequence caching is not worth because normally the actual painting will be cheap.
209 if (!PaintLayerStackingNodeIterator(*paintLayer.stackingNode(), AllChildren) .next()) 209 if (!PaintLayerStackingNodeIterator(*paintLayer.stackingNode(), AllChildren) .next())
210 return false; 210 return false;
211 211
212 // When in FOUC-avoidance mode, don't cache any subsequences, to avoid havin g
213 // to invalidate all of them when leaving this mode. There is an early-out i n BlockPainter::paintContents that may result
214 // in nothing getting painted in thos mode, in addition to early-out logic i n PaintLayerPainter.
215 if (paintLayer.layoutObject()->document().didLayoutWithPendingStylesheets())
216 return false;
217
218 return true; 212 return true;
219 } 213 }
220 214
221 static bool shouldRepaintSubsequence(PaintLayer& paintLayer, const PaintLayerPai ntingInfo& paintingInfo, ShouldRespectOverflowClip respectOverflowClip, const La youtSize& subpixelAccumulation) 215 static bool shouldRepaintSubsequence(PaintLayer& paintLayer, const PaintLayerPai ntingInfo& paintingInfo, ShouldRespectOverflowClip respectOverflowClip, const La youtSize& subpixelAccumulation)
222 { 216 {
223 bool needsRepaint = false; 217 bool needsRepaint = false;
224 218
225 // Repaint subsequence if the layer is marked for needing repaint. 219 // Repaint subsequence if the layer is marked for needing repaint.
226 if (paintLayer.needsRepaint()) 220 if (paintLayer.needsRepaint())
227 needsRepaint = true; 221 needsRepaint = true;
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 767 if (!m_paintLayer.containsDirtyOverlayScrollbars())
774 return; 768 return;
775 769
776 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); 770 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize());
777 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 771 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
778 772
779 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 773 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
780 } 774 }
781 775
782 } // namespace blink 776 } // namespace blink
OLDNEW
« 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