OLD | NEW |
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Non self-painting layers without self-painting descendants don't need to
be painted as their | 80 // Non self-painting layers without self-painting descendants don't need to
be painted as their |
80 // layoutObject() should properly paint itself. | 81 // layoutObject() should properly paint itself. |
81 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye
rDescendant()) { | 82 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye
rDescendant()) { |
82 ASSERT(!m_paintLayer.needsRepaint() || !RuntimeEnabledFeatures::slimming
PaintV2Enabled()); | 83 ASSERT(!m_paintLayer.needsRepaint() || !RuntimeEnabledFeatures::slimming
PaintV2Enabled()); |
83 return FullyPainted; | 84 return FullyPainted; |
84 } | 85 } |
85 | 86 |
86 if (shouldSuppressPaintingLayer(&m_paintLayer)) | 87 if (shouldSuppressPaintingLayer(&m_paintLayer)) |
87 return FullyPainted; | 88 return FullyPainted; |
88 | 89 |
| 90 // TODO(skyostil): Unify this early-out logic with subsequence caching. |
| 91 if (m_paintLayer.layoutObject()->isLayoutPart() && toLayoutPart(m_paintLayer
.layoutObject())->isThrottledFrameView()) |
| 92 return FullyPainted; |
| 93 |
89 // If this layer is totally invisible then there is nothing to paint. | 94 // If this layer is totally invisible then there is nothing to paint. |
90 if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()-
>hasBackdropFilter()) | 95 if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()-
>hasBackdropFilter()) |
91 return FullyPainted; | 96 return FullyPainted; |
92 | 97 |
93 if (m_paintLayer.paintsWithTransparency(paintingInfo.globalPaintFlags())) | 98 if (m_paintLayer.paintsWithTransparency(paintingInfo.globalPaintFlags())) |
94 paintFlags |= PaintLayerHaveTransparency; | 99 paintFlags |= PaintLayerHaveTransparency; |
95 | 100 |
96 LayerFixedPositionRecorder fixedPositionRecorder(*context, *m_paintLayer.lay
outObject()); | 101 LayerFixedPositionRecorder fixedPositionRecorder(*context, *m_paintLayer.lay
outObject()); |
97 | 102 |
98 // PaintLayerAppliedTransform is used in LayoutReplica, to avoid applying th
e transform twice. | 103 // PaintLayerAppliedTransform is used in LayoutReplica, to avoid applying th
e transform twice. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 bool shouldPaintOutline = isSelfPaintingLayer && !isPaintingOverlayScrollbar
s | 218 bool shouldPaintOutline = isSelfPaintingLayer && !isPaintingOverlayScrollbar
s |
214 && ((isPaintingScrollingContent && isPaintingCompositedBackground) | 219 && ((isPaintingScrollingContent && isPaintingCompositedBackground) |
215 || (!isPaintingScrollingContent && isPaintingCompositedForeground)); | 220 || (!isPaintingScrollingContent && isPaintingCompositedForeground)); |
216 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && isSelfPainting
Layer && !isPaintingOverlayScrollbars; | 221 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && isSelfPainting
Layer && !isPaintingOverlayScrollbars; |
217 | 222 |
218 PaintResult result = FullyPainted; | 223 PaintResult result = FullyPainted; |
219 | 224 |
220 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && !m_paintLayer.layou
tObject()->isLayoutView() && !m_paintLayer.layoutObject()->isDocumentElement()) | 225 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && !m_paintLayer.layou
tObject()->isLayoutView() && !m_paintLayer.layoutObject()->isDocumentElement()) |
221 return result; | 226 return result; |
222 | 227 |
| 228 // TODO(skyostil): Unify this early-out logic with subsequence caching. |
| 229 if (m_paintLayer.layoutObject()->isLayoutPart() && toLayoutPart(m_paintLayer
.layoutObject())->isThrottledFrameView()) |
| 230 return FullyPainted; |
| 231 |
223 PaintLayerPaintingInfo paintingInfo = paintingInfoArg; | 232 PaintLayerPaintingInfo paintingInfo = paintingInfoArg; |
224 | 233 |
225 // Ensure our lists are up-to-date. | 234 // Ensure our lists are up-to-date. |
226 m_paintLayer.stackingNode()->updateLayerListsIfNeeded(); | 235 m_paintLayer.stackingNode()->updateLayerListsIfNeeded(); |
227 | 236 |
228 LayoutPoint offsetFromRoot; | 237 LayoutPoint offsetFromRoot; |
229 m_paintLayer.convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot); | 238 m_paintLayer.convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot); |
230 | 239 |
231 if (m_paintLayer.compositingState() == PaintsIntoOwnBacking) | 240 if (m_paintLayer.compositingState() == PaintsIntoOwnBacking) |
232 offsetFromRoot.move(m_paintLayer.subpixelAccumulation()); | 241 offsetFromRoot.move(m_paintLayer.subpixelAccumulation()); |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 703 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
695 return; | 704 return; |
696 | 705 |
697 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize(), paintingRoot); | 706 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize(), paintingRoot); |
698 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 707 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
699 | 708 |
700 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 709 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
701 } | 710 } |
702 | 711 |
703 } // namespace blink | 712 } // namespace blink |
OLD | NEW |