| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PrePaintTreeWalk.h" | 5 #include "core/paint/PrePaintTreeWalk.h" |
| 6 | 6 |
| 7 #include "core/dom/DocumentLifecycle.h" | 7 #include "core/dom/DocumentLifecycle.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" | 10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 PrePaintTreeWalkContext& context) { | 128 PrePaintTreeWalkContext& context) { |
| 129 if (!object.hasLayer()) | 129 if (!object.hasLayer()) |
| 130 return; | 130 return; |
| 131 | 131 |
| 132 PaintLayer& paintLayer = *toLayoutBoxModelObject(object).layer(); | 132 PaintLayer& paintLayer = *toLayoutBoxModelObject(object).layer(); |
| 133 if (object.styleRef().hasTransform() || | 133 if (object.styleRef().hasTransform() || |
| 134 &object == context.paintInvalidatorContext.paintInvalidationContainer) { | 134 &object == context.paintInvalidatorContext.paintInvalidationContainer) { |
| 135 context.ancestorTransformedOrRootPaintLayer = &paintLayer; | 135 context.ancestorTransformedOrRootPaintLayer = &paintLayer; |
| 136 } | 136 } |
| 137 | 137 |
| 138 const ObjectPaintProperties& ancestorPaintProperties = | 138 const auto& ancestor = |
| 139 *context.ancestorTransformedOrRootPaintLayer->layoutObject() | 139 context.ancestorTransformedOrRootPaintLayer->layoutObject(); |
| 140 .paintProperties(); | 140 PropertyTreeState ancestorState = *ancestor.localBorderBoxProperties(); |
| 141 PropertyTreeState ancestorState = | |
| 142 *ancestorPaintProperties.localBorderBoxProperties(); | |
| 143 | 141 |
| 144 #ifdef CHECK_CLIP_RECTS | 142 #ifdef CHECK_CLIP_RECTS |
| 145 ShouldRespectOverflowClipType respectOverflowClip = RespectOverflowClip; | 143 ShouldRespectOverflowClipType respectOverflowClip = RespectOverflowClip; |
| 146 #endif | 144 #endif |
| 147 if (context.ancestorTransformedOrRootPaintLayer->compositingState() == | 145 if (context.ancestorTransformedOrRootPaintLayer->compositingState() == |
| 148 PaintsIntoOwnBacking && | 146 PaintsIntoOwnBacking) { |
| 149 ancestorPaintProperties.overflowClip()) { | 147 const auto* ancestorProperties = ancestor.paintProperties(); |
| 150 ancestorState.setClip(ancestorPaintProperties.overflowClip()); | 148 if (ancestorProperties && ancestorProperties->overflowClip()) { |
| 149 ancestorState.setClip(ancestorProperties->overflowClip()); |
| 151 #ifdef CHECK_CLIP_RECTS | 150 #ifdef CHECK_CLIP_RECTS |
| 152 respectOverflowClip = IgnoreOverflowClip; | 151 respectOverflowClip = IgnoreOverflowClip; |
| 153 #endif | 152 #endif |
| 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 #ifdef CHECK_CLIP_RECTS | 156 #ifdef CHECK_CLIP_RECTS |
| 157 ClipRects& oldClipRects = | 157 ClipRects& oldClipRects = |
| 158 paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper) | 158 paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper) |
| 159 .paintingClipRects(&ancestorTransformedOrRootPaintLayer, | 159 .paintingClipRects(&ancestorTransformedOrRootPaintLayer, |
| 160 respectOverflowClip, LayoutSize()); | 160 respectOverflowClip, LayoutSize()); |
| 161 #endif | 161 #endif |
| 162 | 162 |
| 163 ClipRects clipRects; | 163 ClipRects clipRects; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 roundedIntPoint(context.treeBuilderContext->current.paintOffset); | 257 roundedIntPoint(context.treeBuilderContext->current.paintOffset); |
| 258 walk(*toFrameView(frameViewBase), context); | 258 walk(*toFrameView(frameViewBase), context); |
| 259 } | 259 } |
| 260 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). | 260 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). |
| 261 } | 261 } |
| 262 | 262 |
| 263 object.getMutableForPainting().clearPaintFlags(); | 263 object.getMutableForPainting().clearPaintFlags(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace blink | 266 } // namespace blink |
| OLD | NEW |