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

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

Issue 1364063007: Throttle rendering pipeline for invisible frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix layout test by not dumping throttled FrameViews. Created 5 years, 2 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 "config.h" 5 #include "config.h"
6 #include "core/paint/PaintLayerPainter.h" 6 #include "core/paint/PaintLayerPainter.h"
7 7
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"
11 #include "core/layout/LayoutFrame.h"
11 #include "core/layout/LayoutView.h" 12 #include "core/layout/LayoutView.h"
12 #include "core/layout/svg/LayoutSVGResourceClipper.h" 13 #include "core/layout/svg/LayoutSVGResourceClipper.h"
13 #include "core/page/Page.h" 14 #include "core/page/Page.h"
14 #include "core/paint/CompositingRecorder.h" 15 #include "core/paint/CompositingRecorder.h"
15 #include "core/paint/FilterPainter.h" 16 #include "core/paint/FilterPainter.h"
16 #include "core/paint/LayerClipRecorder.h" 17 #include "core/paint/LayerClipRecorder.h"
17 #include "core/paint/LayerFixedPositionRecorder.h" 18 #include "core/paint/LayerFixedPositionRecorder.h"
18 #include "core/paint/PaintInfo.h" 19 #include "core/paint/PaintInfo.h"
19 #include "core/paint/PaintLayer.h" 20 #include "core/paint/PaintLayer.h"
20 #include "core/paint/SVGClipPainter.h" 21 #include "core/paint/SVGClipPainter.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // Non self-painting layers without self-painting descendants don't need to be painted as their 73 // Non self-painting layers without self-painting descendants don't need to be painted as their
73 // layoutObject() should properly paint itself. 74 // layoutObject() should properly paint itself.
74 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye rDescendant()) { 75 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye rDescendant()) {
75 ASSERT(!m_paintLayer.needsRepaint() || !RuntimeEnabledFeatures::slimming PaintV2Enabled()); 76 ASSERT(!m_paintLayer.needsRepaint() || !RuntimeEnabledFeatures::slimming PaintV2Enabled());
76 return FullyPainted; 77 return FullyPainted;
77 } 78 }
78 79
79 if (shouldSuppressPaintingLayer(&m_paintLayer)) 80 if (shouldSuppressPaintingLayer(&m_paintLayer))
80 return FullyPainted; 81 return FullyPainted;
81 82
83 // TODO(skyostil): Unify this early-out logic with subsequence caching.
84 if (m_paintLayer.layoutObject()->isLayoutPart() && toLayoutPart(m_paintLayer .layoutObject())->isThrottledFrameView())
85 return FullyPainted;
86
82 // 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.
83 if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()- >hasBackdropFilter()) 88 if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()- >hasBackdropFilter())
84 return FullyPainted; 89 return FullyPainted;
85 90
86 if (m_paintLayer.paintsWithTransparency(paintingInfo.globalPaintFlags())) 91 if (m_paintLayer.paintsWithTransparency(paintingInfo.globalPaintFlags()))
87 paintFlags |= PaintLayerHaveTransparency; 92 paintFlags |= PaintLayerHaveTransparency;
88 93
89 LayerFixedPositionRecorder fixedPositionRecorder(*context, *m_paintLayer.lay outObject()); 94 LayerFixedPositionRecorder fixedPositionRecorder(*context, *m_paintLayer.lay outObject());
90 95
91 // PaintLayerAppliedTransform is used in LayoutReplica, to avoid applying th e transform twice. 96 // PaintLayerAppliedTransform is used in LayoutReplica, to avoid applying th e transform twice.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 bool shouldPaintOutline = isSelfPaintingLayer && !isPaintingOverlayScrollbar s 204 bool shouldPaintOutline = isSelfPaintingLayer && !isPaintingOverlayScrollbar s
200 && ((isPaintingScrollingContent && isPaintingCompositedBackground) 205 && ((isPaintingScrollingContent && isPaintingCompositedBackground)
201 || (!isPaintingScrollingContent && isPaintingCompositedForeground)); 206 || (!isPaintingScrollingContent && isPaintingCompositedForeground));
202 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && isSelfPainting Layer && !isPaintingOverlayScrollbars; 207 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && isSelfPainting Layer && !isPaintingOverlayScrollbars;
203 208
204 PaintResult result = FullyPainted; 209 PaintResult result = FullyPainted;
205 210
206 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && !m_paintLayer.layou tObject()->isLayoutView() && !m_paintLayer.layoutObject()->isDocumentElement()) 211 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && !m_paintLayer.layou tObject()->isLayoutView() && !m_paintLayer.layoutObject()->isDocumentElement())
207 return result; 212 return result;
208 213
214 // TODO(skyostil): Unify this early-out logic with subsequence caching.
215 if (m_paintLayer.layoutObject()->isLayoutPart() && toLayoutPart(m_paintLayer .layoutObject())->isThrottledFrameView())
216 return FullyPainted;
217
209 PaintLayerPaintingInfo paintingInfo = paintingInfoArg; 218 PaintLayerPaintingInfo paintingInfo = paintingInfoArg;
210 219
211 // Ensure our lists are up-to-date. 220 // Ensure our lists are up-to-date.
212 m_paintLayer.stackingNode()->updateLayerListsIfNeeded(); 221 m_paintLayer.stackingNode()->updateLayerListsIfNeeded();
213 222
214 LayoutPoint offsetFromRoot; 223 LayoutPoint offsetFromRoot;
215 m_paintLayer.convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot); 224 m_paintLayer.convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot);
216 225
217 if (m_paintLayer.compositingState() == PaintsIntoOwnBacking) 226 if (m_paintLayer.compositingState() == PaintsIntoOwnBacking)
218 offsetFromRoot.move(m_paintLayer.subpixelAccumulation()); 227 offsetFromRoot.move(m_paintLayer.subpixelAccumulation());
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 693 if (!m_paintLayer.containsDirtyOverlayScrollbars())
685 return; 694 return;
686 695
687 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize(), paintingRoot); 696 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize(), paintingRoot);
688 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 697 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
689 698
690 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 699 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
691 } 700 }
692 701
693 } // namespace blink 702 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698