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

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

Issue 1954093003: Don't try to paint graphics layers inside throttled frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests. 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 unified diff | Download patch
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 // Non self-painting layers without self-painting descendants don't need to be painted as their 76 // Non self-painting layers without self-painting descendants don't need to be painted as their
77 // layoutObject() should properly paint itself. 77 // layoutObject() should properly paint itself.
78 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye rDescendant()) 78 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye rDescendant())
79 return FullyPainted; 79 return FullyPainted;
80 80
81 if (shouldSuppressPaintingLayer(m_paintLayer)) 81 if (shouldSuppressPaintingLayer(m_paintLayer))
82 return FullyPainted; 82 return FullyPainted;
83 83
84 if (m_paintLayer.layoutObject()->isLayoutView() && toLayoutView(m_paintLayer .layoutObject())->frameView()->shouldThrottleRendering()) 84 if (m_paintLayer.layoutObject()->view()->frame() && m_paintLayer.layoutObjec t()->view()->frame()->shouldThrottleRendering())
85 return FullyPainted; 85 return FullyPainted;
86 86
87 // If this layer is totally invisible then there is nothing to paint. 87 // If this layer is totally invisible then there is nothing to paint.
88 if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()- >hasBackdropFilter()) 88 if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()- >hasBackdropFilter())
89 return FullyPainted; 89 return FullyPainted;
90 90
91 if (m_paintLayer.paintsWithTransparency(paintingInfo.getGlobalPaintFlags())) 91 if (m_paintLayer.paintsWithTransparency(paintingInfo.getGlobalPaintFlags()))
92 paintFlags |= PaintLayerHaveTransparency; 92 paintFlags |= PaintLayerHaveTransparency;
93 93
94 // Transforms will be applied by property nodes directly for SPv2. 94 // Transforms will be applied by property nodes directly for SPv2.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 && ((isPaintingScrollingContent && isPaintingCompositedBackground) 268 && ((isPaintingScrollingContent && isPaintingCompositedBackground)
269 || (!isPaintingScrollingContent && isPaintingCompositedForeground)) 269 || (!isPaintingScrollingContent && isPaintingCompositedForeground))
270 && m_paintLayer.layoutObject()->styleRef().hasOutline(); 270 && m_paintLayer.layoutObject()->styleRef().hasOutline();
271 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && isSelfPainting Layer && !isPaintingOverlayScrollbars; 271 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && isSelfPainting Layer && !isPaintingOverlayScrollbars;
272 272
273 PaintResult result = FullyPainted; 273 PaintResult result = FullyPainted;
274 274
275 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && !m_paintLayer.layou tObject()->isLayoutView() && !m_paintLayer.layoutObject()->isDocumentElement()) 275 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && !m_paintLayer.layou tObject()->isLayoutView() && !m_paintLayer.layoutObject()->isDocumentElement())
276 return result; 276 return result;
277 277
278 if (m_paintLayer.layoutObject()->isLayoutView() && toLayoutView(m_paintLayer .layoutObject())->frameView()->shouldThrottleRendering()) 278 if (m_paintLayer.layoutObject()->view()->frame() && m_paintLayer.layoutObjec t()->view()->frame()->shouldThrottleRendering())
279 return result; 279 return result;
280 280
281 // Ensure our lists are up-to-date. 281 // Ensure our lists are up-to-date.
282 m_paintLayer.stackingNode()->updateLayerListsIfNeeded(); 282 m_paintLayer.stackingNode()->updateLayerListsIfNeeded();
283 283
284 LayoutSize subpixelAccumulation = m_paintLayer.compositingState() == PaintsI ntoOwnBacking ? m_paintLayer.subpixelAccumulation() : paintingInfoArg.subPixelAc cumulation; 284 LayoutSize subpixelAccumulation = m_paintLayer.compositingState() == PaintsI ntoOwnBacking ? m_paintLayer.subpixelAccumulation() : paintingInfoArg.subPixelAc cumulation;
285 ShouldRespectOverflowClipType respectOverflowClip = shouldRespectOverflowCli p(paintFlags, m_paintLayer.layoutObject()); 285 ShouldRespectOverflowClipType respectOverflowClip = shouldRespectOverflowCli p(paintFlags, m_paintLayer.layoutObject());
286 286
287 Optional<SubsequenceRecorder> subsequenceRecorder; 287 Optional<SubsequenceRecorder> subsequenceRecorder;
288 if (shouldCreateSubsequence(m_paintLayer, context, paintingInfoArg, paintFla gs)) { 288 if (shouldCreateSubsequence(m_paintLayer, context, paintingInfoArg, paintFla gs)) {
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 807 if (!m_paintLayer.containsDirtyOverlayScrollbars())
808 return; 808 return;
809 809
810 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); 810 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize());
811 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 811 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
812 812
813 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 813 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
814 } 814 }
815 815
816 } // namespace blink 816 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/FramePainter.cpp ('k') | third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698