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 "core/paint/PaintLayerPainter.h" | 5 #include "core/paint/PaintLayerPainter.h" |
6 | 6 |
| 7 #include "core/frame/FrameView.h" |
7 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
8 #include "core/layout/ClipPathOperation.h" | 9 #include "core/layout/ClipPathOperation.h" |
9 #include "core/layout/LayoutBlock.h" | 10 #include "core/layout/LayoutBlock.h" |
10 #include "core/layout/LayoutFrame.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/FilterPainter.h" | 15 #include "core/paint/FilterPainter.h" |
15 #include "core/paint/LayerClipRecorder.h" | 16 #include "core/paint/LayerClipRecorder.h" |
16 #include "core/paint/LayerFixedPositionRecorder.h" | 17 #include "core/paint/LayerFixedPositionRecorder.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 74 } |
74 | 75 |
75 // 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 |
76 // layoutObject() should properly paint itself. | 77 // layoutObject() should properly paint itself. |
77 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye
rDescendant()) | 78 if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLaye
rDescendant()) |
78 return FullyPainted; | 79 return FullyPainted; |
79 | 80 |
80 if (shouldSuppressPaintingLayer(&m_paintLayer)) | 81 if (shouldSuppressPaintingLayer(&m_paintLayer)) |
81 return FullyPainted; | 82 return FullyPainted; |
82 | 83 |
83 // TODO(skyostil): Unify this early-out logic with subsequence caching. | 84 if (m_paintLayer.layoutObject()->isLayoutView() && toLayoutView(m_paintLayer
.layoutObject())->frameView()->shouldThrottleRendering()) |
84 if (m_paintLayer.layoutObject()->isLayoutPart() && toLayoutPart(m_paintLayer
.layoutObject())->isThrottledFrameView()) | |
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.globalPaintFlags())) | 91 if (m_paintLayer.paintsWithTransparency(paintingInfo.globalPaintFlags())) |
92 paintFlags |= PaintLayerHaveTransparency; | 92 paintFlags |= PaintLayerHaveTransparency; |
93 | 93 |
94 LayerFixedPositionRecorder fixedPositionRecorder(context, *m_paintLayer.layo
utObject()); | 94 LayerFixedPositionRecorder fixedPositionRecorder(context, *m_paintLayer.layo
utObject()); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 && ((isPaintingScrollingContent && isPaintingCompositedBackground) | 263 && ((isPaintingScrollingContent && isPaintingCompositedBackground) |
264 || (!isPaintingScrollingContent && isPaintingCompositedForeground)) | 264 || (!isPaintingScrollingContent && isPaintingCompositedForeground)) |
265 && m_paintLayer.layoutObject()->styleRef().hasOutline(); | 265 && m_paintLayer.layoutObject()->styleRef().hasOutline(); |
266 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && isSelfPainting
Layer && !isPaintingOverlayScrollbars; | 266 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && isSelfPainting
Layer && !isPaintingOverlayScrollbars; |
267 | 267 |
268 PaintResult result = FullyPainted; | 268 PaintResult result = FullyPainted; |
269 | 269 |
270 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && !m_paintLayer.layou
tObject()->isLayoutView() && !m_paintLayer.layoutObject()->isDocumentElement()) | 270 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && !m_paintLayer.layou
tObject()->isLayoutView() && !m_paintLayer.layoutObject()->isDocumentElement()) |
271 return result; | 271 return result; |
272 | 272 |
273 // TODO(skyostil): Unify this early-out logic with subsequence caching. | 273 if (m_paintLayer.layoutObject()->isLayoutView() && toLayoutView(m_paintLayer
.layoutObject())->frameView()->shouldThrottleRendering()) |
274 if (m_paintLayer.layoutObject()->isLayoutPart() && toLayoutPart(m_paintLayer
.layoutObject())->isThrottledFrameView()) | 274 return result; |
275 return FullyPainted; | |
276 | 275 |
277 // Ensure our lists are up-to-date. | 276 // Ensure our lists are up-to-date. |
278 m_paintLayer.stackingNode()->updateLayerListsIfNeeded(); | 277 m_paintLayer.stackingNode()->updateLayerListsIfNeeded(); |
279 | 278 |
280 LayoutSize subpixelAccumulation = m_paintLayer.compositingState() == PaintsI
ntoOwnBacking ? m_paintLayer.subpixelAccumulation() : paintingInfoArg.subPixelAc
cumulation; | 279 LayoutSize subpixelAccumulation = m_paintLayer.compositingState() == PaintsI
ntoOwnBacking ? m_paintLayer.subpixelAccumulation() : paintingInfoArg.subPixelAc
cumulation; |
281 ShouldRespectOverflowClip respectOverflowClip = shouldRespectOverflowClip(pa
intFlags, m_paintLayer.layoutObject()); | 280 ShouldRespectOverflowClip respectOverflowClip = shouldRespectOverflowClip(pa
intFlags, m_paintLayer.layoutObject()); |
282 | 281 |
283 Optional<SubsequenceRecorder> subsequenceRecorder; | 282 Optional<SubsequenceRecorder> subsequenceRecorder; |
284 if (shouldCreateSubsequence(m_paintLayer, context, paintingInfoArg, paintFla
gs)) { | 283 if (shouldCreateSubsequence(m_paintLayer, context, paintingInfoArg, paintFla
gs)) { |
285 if (!shouldRepaintSubsequence(m_paintLayer, paintingInfoArg, respectOver
flowClip, subpixelAccumulation) | 284 if (!shouldRepaintSubsequence(m_paintLayer, paintingInfoArg, respectOver
flowClip, subpixelAccumulation) |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 735 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
737 return; | 736 return; |
738 | 737 |
739 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 738 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
740 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 739 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
741 | 740 |
742 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 741 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
743 } | 742 } |
744 | 743 |
745 } // namespace blink | 744 } // namespace blink |
OLD | NEW |