| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 2852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2863 | 2863 |
| 2864 void FrameView::updateGeometriesIfNeeded() { | 2864 void FrameView::updateGeometriesIfNeeded() { |
| 2865 if (!m_needsUpdateGeometries) | 2865 if (!m_needsUpdateGeometries) |
| 2866 return; | 2866 return; |
| 2867 | 2867 |
| 2868 m_needsUpdateGeometries = false; | 2868 m_needsUpdateGeometries = false; |
| 2869 | 2869 |
| 2870 updateGeometries(); | 2870 updateGeometries(); |
| 2871 } | 2871 } |
| 2872 | 2872 |
| 2873 GeometryMapper& FrameView::geometryMapper() { | |
| 2874 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | |
| 2875 DCHECK(lifecycle().state() >= DocumentLifecycle::InPrePaint); | |
| 2876 | |
| 2877 if (m_frame->isLocalRoot()) { | |
| 2878 if (!m_geometryMapper) | |
| 2879 m_geometryMapper = GeometryMapper::create(); | |
| 2880 return *m_geometryMapper.get(); | |
| 2881 } | |
| 2882 | |
| 2883 return frame().localFrameRoot()->view()->geometryMapper(); | |
| 2884 } | |
| 2885 | |
| 2886 void FrameView::updateAllLifecyclePhases() { | 2873 void FrameView::updateAllLifecyclePhases() { |
| 2887 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( | 2874 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( |
| 2888 DocumentLifecycle::PaintClean); | 2875 DocumentLifecycle::PaintClean); |
| 2889 } | 2876 } |
| 2890 | 2877 |
| 2891 // TODO(chrishtr): add a scrolling update lifecycle phase. | 2878 // TODO(chrishtr): add a scrolling update lifecycle phase. |
| 2892 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() { | 2879 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() { |
| 2893 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 2880 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 2894 updateAllLifecyclePhasesExceptPaint(); | 2881 updateAllLifecyclePhasesExceptPaint(); |
| 2895 } else { | 2882 } else { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3143 // This frame can be throttled but not throttled, meaning we are not in an | 3130 // This frame can be throttled but not throttled, meaning we are not in an |
| 3144 // AllowThrottlingScope. Now this frame may contain dirty paint flags, and | 3131 // AllowThrottlingScope. Now this frame may contain dirty paint flags, and |
| 3145 // we need to propagate the flags into the ancestor chain so that | 3132 // we need to propagate the flags into the ancestor chain so that |
| 3146 // PrePaintTreeWalk can reach this frame. | 3133 // PrePaintTreeWalk can reach this frame. |
| 3147 frameView.setNeedsPaintPropertyUpdate(); | 3134 frameView.setNeedsPaintPropertyUpdate(); |
| 3148 } | 3135 } |
| 3149 }); | 3136 }); |
| 3150 | 3137 |
| 3151 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 3138 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 3152 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); | 3139 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); |
| 3153 PrePaintTreeWalk(geometryMapper()).walk(*this); | 3140 PrePaintTreeWalk().walk(*this); |
| 3154 } | 3141 } |
| 3155 | 3142 |
| 3156 forAllNonThrottledFrameViews([](FrameView& frameView) { | 3143 forAllNonThrottledFrameViews([](FrameView& frameView) { |
| 3157 frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintClean); | 3144 frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintClean); |
| 3158 }); | 3145 }); |
| 3159 } | 3146 } |
| 3160 | 3147 |
| 3161 void FrameView::notifyPaint(const PaintController& paintController) const { | 3148 void FrameView::notifyPaint(const PaintController& paintController) const { |
| 3162 DCHECK(m_frame->document()); | 3149 DCHECK(m_frame->document()); |
| 3163 PaintTiming::from(*m_frame->document()) | 3150 PaintTiming::from(*m_frame->document()) |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3251 return; | 3238 return; |
| 3252 | 3239 |
| 3253 if (!m_paintArtifactCompositor) { | 3240 if (!m_paintArtifactCompositor) { |
| 3254 m_paintArtifactCompositor = PaintArtifactCompositor::create(); | 3241 m_paintArtifactCompositor = PaintArtifactCompositor::create(); |
| 3255 page->chromeClient().attachRootLayer( | 3242 page->chromeClient().attachRootLayer( |
| 3256 m_paintArtifactCompositor->getWebLayer(), &frame()); | 3243 m_paintArtifactCompositor->getWebLayer(), &frame()); |
| 3257 } | 3244 } |
| 3258 | 3245 |
| 3259 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime"); | 3246 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime"); |
| 3260 | 3247 |
| 3261 DCHECK(m_geometryMapper.get()); | |
| 3262 m_paintArtifactCompositor->update( | 3248 m_paintArtifactCompositor->update( |
| 3263 m_paintController->paintArtifact(), | 3249 m_paintController->paintArtifact(), |
| 3264 m_paintController->paintChunksRasterInvalidationTrackingMap(), | 3250 m_paintController->paintChunksRasterInvalidationTrackingMap(), |
| 3265 m_isStoringCompositedLayerDebugInfo, *m_geometryMapper); | 3251 m_isStoringCompositedLayerDebugInfo); |
| 3266 } | 3252 } |
| 3267 | 3253 |
| 3268 std::unique_ptr<JSONObject> FrameView::compositedLayersAsJSON( | 3254 std::unique_ptr<JSONObject> FrameView::compositedLayersAsJSON( |
| 3269 LayerTreeFlags flags) { | 3255 LayerTreeFlags flags) { |
| 3270 return frame() | 3256 return frame() |
| 3271 .localFrameRoot() | 3257 .localFrameRoot() |
| 3272 ->view() | 3258 ->view() |
| 3273 ->m_paintArtifactCompositor->layersAsJSON(flags); | 3259 ->m_paintArtifactCompositor->layersAsJSON(flags); |
| 3274 } | 3260 } |
| 3275 | 3261 |
| (...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5251 void FrameView::setAnimationHost( | 5237 void FrameView::setAnimationHost( |
| 5252 std::unique_ptr<CompositorAnimationHost> host) { | 5238 std::unique_ptr<CompositorAnimationHost> host) { |
| 5253 m_animationHost = std::move(host); | 5239 m_animationHost = std::move(host); |
| 5254 } | 5240 } |
| 5255 | 5241 |
| 5256 LayoutUnit FrameView::caretWidth() const { | 5242 LayoutUnit FrameView::caretWidth() const { |
| 5257 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5243 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
| 5258 } | 5244 } |
| 5259 | 5245 |
| 5260 } // namespace blink | 5246 } // namespace blink |
| OLD | NEW |