| 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 18 matching lines...) Expand all Loading... |
| 29 DCHECK(rootFrame.frame().document()->lifecycle().state() == DocumentLifecycl
e::InPrePaint); | 29 DCHECK(rootFrame.frame().document()->lifecycle().state() == DocumentLifecycl
e::InPrePaint); |
| 30 | 30 |
| 31 PrePaintTreeWalkContext rootContext; | 31 PrePaintTreeWalkContext rootContext; |
| 32 m_propertyTreeBuilder.buildTreeRootNodes(rootFrame, rootContext.treeBuilderC
ontext); | 32 m_propertyTreeBuilder.buildTreeRootNodes(rootFrame, rootContext.treeBuilderC
ontext); |
| 33 walk(rootFrame, rootContext); | 33 walk(rootFrame, rootContext); |
| 34 m_paintInvalidator.processPendingDelayedPaintInvalidations(); | 34 m_paintInvalidator.processPendingDelayedPaintInvalidations(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void PrePaintTreeWalk::walk(FrameView& frameView, const PrePaintTreeWalkContext&
context) | 37 void PrePaintTreeWalk::walk(FrameView& frameView, const PrePaintTreeWalkContext&
context) |
| 38 { | 38 { |
| 39 if (frameView.shouldThrottleRendering()) |
| 40 return; |
| 41 |
| 39 PrePaintTreeWalkContext localContext(context); | 42 PrePaintTreeWalkContext localContext(context); |
| 40 m_propertyTreeBuilder.buildTreeNodes(frameView, localContext.treeBuilderCont
ext); | 43 m_propertyTreeBuilder.buildTreeNodes(frameView, localContext.treeBuilderCont
ext); |
| 41 | 44 |
| 42 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) | 45 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
| 43 m_paintInvalidator.invalidatePaintIfNeeded(frameView, localContext.paint
InvalidatorContext); | 46 m_paintInvalidator.invalidatePaintIfNeeded(frameView, localContext.paint
InvalidatorContext); |
| 44 | 47 |
| 45 if (LayoutView* layoutView = frameView.layoutView()) | 48 if (LayoutView* layoutView = frameView.layoutView()) |
| 46 walk(*layoutView, localContext); | 49 walk(*layoutView, localContext); |
| 47 } | 50 } |
| 48 | 51 |
| 49 void PrePaintTreeWalk::walk(const LayoutObject& object, const PrePaintTreeWalkCo
ntext& context) | 52 void PrePaintTreeWalk::walk(const LayoutObject& object, const PrePaintTreeWalkCo
ntext& context) |
| 50 { | 53 { |
| 51 PrePaintTreeWalkContext localContext(context); | 54 PrePaintTreeWalkContext localContext(context); |
| 52 m_propertyTreeBuilder.buildTreeNodes(object, localContext.treeBuilderContext
); | |
| 53 | 55 |
| 56 m_propertyTreeBuilder.buildTreeNodesForSelf(object, localContext.treeBuilder
Context); |
| 54 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) | 57 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
| 55 m_paintInvalidator.invalidatePaintIfNeeded(object, localContext.paintInv
alidatorContext); | 58 m_paintInvalidator.invalidatePaintIfNeeded(object, localContext.paintInv
alidatorContext); |
| 59 m_propertyTreeBuilder.buildTreeNodesForChildren(object, localContext.treeBui
lderContext); |
| 56 | 60 |
| 57 for (const LayoutObject* child = object.slowFirstChild(); child; child = chi
ld->nextSibling()) { | 61 for (const LayoutObject* child = object.slowFirstChild(); child; child = chi
ld->nextSibling()) { |
| 58 // Column spanners are walked through their placeholders. See below. | 62 // Column spanners are walked through their placeholders. See below. |
| 59 if (child->isColumnSpanAll()) | 63 if (child->isColumnSpanAll()) |
| 60 continue; | 64 continue; |
| 61 walk(*child, localContext); | 65 walk(*child, localContext); |
| 62 } | 66 } |
| 63 | 67 |
| 64 if (object.isLayoutMultiColumnSpannerPlaceholder()) | 68 if (object.isLayoutMultiColumnSpannerPlaceholder()) |
| 65 walk(*toLayoutMultiColumnSpannerPlaceholder(object).layoutObjectInFlowTh
read(), localContext); | 69 walk(*toLayoutMultiColumnSpannerPlaceholder(object).layoutObjectInFlowTh
read(), localContext); |
| 66 | 70 |
| 67 if (object.isLayoutPart()) { | 71 if (object.isLayoutPart()) { |
| 68 const LayoutPart& layoutPart = toLayoutPart(object); | 72 const LayoutPart& layoutPart = toLayoutPart(object); |
| 69 Widget* widget = layoutPart.widget(); | 73 Widget* widget = layoutPart.widget(); |
| 70 if (widget && widget->isFrameView()) { | 74 if (widget && widget->isFrameView()) { |
| 71 localContext.treeBuilderContext.current.paintOffset += layoutPart.re
placedContentRect().location() - widget->frameRect().location(); | 75 localContext.treeBuilderContext.current.paintOffset += layoutPart.re
placedContentRect().location() - widget->frameRect().location(); |
| 72 localContext.treeBuilderContext.current.paintOffset = roundedIntPoin
t(localContext.treeBuilderContext.current.paintOffset); | 76 localContext.treeBuilderContext.current.paintOffset = roundedIntPoin
t(localContext.treeBuilderContext.current.paintOffset); |
| 73 walk(*toFrameView(widget), localContext); | 77 walk(*toFrameView(widget), localContext); |
| 74 } | 78 } |
| 75 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). | 79 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). |
| 76 } | 80 } |
| 77 } | 81 } |
| 78 | 82 |
| 79 } // namespace blink | 83 } // namespace blink |
| OLD | NEW |