| 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 26 matching lines...) Expand all Loading... |
| 37 PaintLayer* ancestorTransformedOrRootPaintLayer; | 37 PaintLayer* ancestorTransformedOrRootPaintLayer; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 void PrePaintTreeWalk::walk(FrameView& rootFrame) { | 40 void PrePaintTreeWalk::walk(FrameView& rootFrame) { |
| 41 DCHECK(rootFrame.frame().document()->lifecycle().state() == | 41 DCHECK(rootFrame.frame().document()->lifecycle().state() == |
| 42 DocumentLifecycle::InPrePaint); | 42 DocumentLifecycle::InPrePaint); |
| 43 | 43 |
| 44 PrePaintTreeWalkContext initialContext; | 44 PrePaintTreeWalkContext initialContext; |
| 45 initialContext.treeBuilderContext = | 45 initialContext.treeBuilderContext = |
| 46 m_propertyTreeBuilder.setupInitialContext(); | 46 m_propertyTreeBuilder.setupInitialContext(); |
| 47 initialContext.ancestorTransformedOrRootPaintLayer = |
| 48 rootFrame.layoutView()->layer(); |
| 47 | 49 |
| 48 // GeometryMapper depends on paint properties. | 50 // GeometryMapper depends on paint properties. |
| 49 if (rootFrame.needsPaintPropertyUpdate() || | 51 if (rootFrame.needsPaintPropertyUpdate() || |
| 50 (rootFrame.layoutView() && | 52 (rootFrame.layoutView() && |
| 51 !shouldEndWalkBefore(*rootFrame.layoutView(), initialContext))) | 53 !shouldEndWalkBefore(*rootFrame.layoutView(), initialContext))) |
| 52 m_geometryMapper.clearCache(); | 54 m_geometryMapper.clearCache(); |
| 53 | 55 |
| 54 walk(rootFrame, initialContext); | 56 walk(rootFrame, initialContext); |
| 55 m_paintInvalidator.processPendingDelayedPaintInvalidations(); | 57 m_paintInvalidator.processPendingDelayedPaintInvalidations(); |
| 56 } | 58 } |
| 57 | 59 |
| 58 void PrePaintTreeWalk::walk(FrameView& frameView, | 60 void PrePaintTreeWalk::walk(FrameView& frameView, |
| 59 const PrePaintTreeWalkContext& parentContext) { | 61 const PrePaintTreeWalkContext& parentContext) { |
| 60 if (frameView.shouldThrottleRendering()) { | 62 if (frameView.shouldThrottleRendering()) { |
| 61 // Skip the throttled frame. Will update it when it becomes unthrottled. | 63 // Skip the throttled frame. Will update it when it becomes unthrottled. |
| 62 return; | 64 return; |
| 63 } | 65 } |
| 64 | 66 |
| 65 PrePaintTreeWalkContext context(parentContext); | 67 PrePaintTreeWalkContext context(parentContext); |
| 66 // ancestorOverflowLayer does not cross frame boundaries. | 68 // ancestorOverflowLayer does not cross frame boundaries. |
| 67 context.ancestorOverflowPaintLayer = nullptr; | 69 context.ancestorOverflowPaintLayer = nullptr; |
| 68 context.ancestorTransformedOrRootPaintLayer = frameView.layoutView()->layer(); | |
| 69 m_propertyTreeBuilder.updateProperties(frameView, context.treeBuilderContext); | 70 m_propertyTreeBuilder.updateProperties(frameView, context.treeBuilderContext); |
| 70 m_paintInvalidator.invalidatePaintIfNeeded(frameView, | 71 m_paintInvalidator.invalidatePaintIfNeeded(frameView, |
| 71 context.paintInvalidatorContext); | 72 context.paintInvalidatorContext); |
| 72 | 73 |
| 73 if (LayoutView* view = frameView.layoutView()) { | 74 if (LayoutView* view = frameView.layoutView()) { |
| 74 walk(*view, context); | 75 walk(*view, context); |
| 75 #if DCHECK_IS_ON() | 76 #if DCHECK_IS_ON() |
| 76 view->assertSubtreeClearedPaintInvalidationFlags(); | 77 view->assertSubtreeClearedPaintInvalidationFlags(); |
| 77 #endif | 78 #endif |
| 78 } | 79 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 roundedIntPoint(context.treeBuilderContext.current.paintOffset); | 273 roundedIntPoint(context.treeBuilderContext.current.paintOffset); |
| 273 walk(*toFrameView(frameViewBase), context); | 274 walk(*toFrameView(frameViewBase), context); |
| 274 } | 275 } |
| 275 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). | 276 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). |
| 276 } | 277 } |
| 277 | 278 |
| 278 object.getMutableForPainting().clearPaintFlags(); | 279 object.getMutableForPainting().clearPaintFlags(); |
| 279 } | 280 } |
| 280 | 281 |
| 281 } // namespace blink | 282 } // namespace blink |
| OLD | NEW |