| 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 2804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2815 | 2815 |
| 2816 void FrameView::updateWidgetGeometriesIfNeeded() { | 2816 void FrameView::updateWidgetGeometriesIfNeeded() { |
| 2817 if (!m_needsUpdateWidgetGeometries) | 2817 if (!m_needsUpdateWidgetGeometries) |
| 2818 return; | 2818 return; |
| 2819 | 2819 |
| 2820 m_needsUpdateWidgetGeometries = false; | 2820 m_needsUpdateWidgetGeometries = false; |
| 2821 | 2821 |
| 2822 updateWidgetGeometries(); | 2822 updateWidgetGeometries(); |
| 2823 } | 2823 } |
| 2824 | 2824 |
| 2825 GeometryMapper& FrameView::geometryMapper() { |
| 2826 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
| 2827 DCHECK(lifecycle().state() >= DocumentLifecycle::InPrePaint); |
| 2828 |
| 2829 if (m_frame->isLocalRoot()) { |
| 2830 if (!m_geometryMapper) |
| 2831 m_geometryMapper = GeometryMapper::create(); |
| 2832 return *m_geometryMapper.get(); |
| 2833 } |
| 2834 |
| 2835 return frame().localFrameRoot()->view()->geometryMapper(); |
| 2836 } |
| 2837 |
| 2825 void FrameView::updateAllLifecyclePhases() { | 2838 void FrameView::updateAllLifecyclePhases() { |
| 2826 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( | 2839 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( |
| 2827 DocumentLifecycle::PaintClean); | 2840 DocumentLifecycle::PaintClean); |
| 2828 } | 2841 } |
| 2829 | 2842 |
| 2830 // TODO(chrishtr): add a scrolling update lifecycle phase. | 2843 // TODO(chrishtr): add a scrolling update lifecycle phase. |
| 2831 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() { | 2844 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() { |
| 2832 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 2845 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 2833 updateAllLifecyclePhasesExceptPaint(); | 2846 updateAllLifecyclePhasesExceptPaint(); |
| 2834 } else { | 2847 } else { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3067 } | 3080 } |
| 3068 m_anchoringAdjustmentQueue.clear(); | 3081 m_anchoringAdjustmentQueue.clear(); |
| 3069 } | 3082 } |
| 3070 | 3083 |
| 3071 void FrameView::prePaint() { | 3084 void FrameView::prePaint() { |
| 3072 TRACE_EVENT0("blink", "FrameView::prePaint"); | 3085 TRACE_EVENT0("blink", "FrameView::prePaint"); |
| 3073 | 3086 |
| 3074 if (!m_paintController) | 3087 if (!m_paintController) |
| 3075 m_paintController = PaintController::create(); | 3088 m_paintController = PaintController::create(); |
| 3076 | 3089 |
| 3077 if (!m_geometryMapper) | |
| 3078 m_geometryMapper.reset(new GeometryMapper()); | |
| 3079 // TODO(chrishtr): the cache only needs to be invalidated if one or more of | |
| 3080 // the property tree nodes changed. | |
| 3081 m_geometryMapper->clearCache(); | |
| 3082 | |
| 3083 forAllNonThrottledFrameViews([](FrameView& frameView) { | 3090 forAllNonThrottledFrameViews([](FrameView& frameView) { |
| 3084 frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaint); | 3091 frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaint); |
| 3085 if (frameView.canThrottleRendering()) { | 3092 if (frameView.canThrottleRendering()) { |
| 3086 // This frame can be throttled but not throttled, meaning we are not in an | 3093 // This frame can be throttled but not throttled, meaning we are not in an |
| 3087 // AllowThrottlingScope. Now this frame may contain dirty paint flags, and | 3094 // AllowThrottlingScope. Now this frame may contain dirty paint flags, and |
| 3088 // we need to propagate the flags into the ancestor chain so that | 3095 // we need to propagate the flags into the ancestor chain so that |
| 3089 // PrePaintTreeWalk can reach this frame. | 3096 // PrePaintTreeWalk can reach this frame. |
| 3090 frameView.setNeedsPaintPropertyUpdate(); | 3097 frameView.setNeedsPaintPropertyUpdate(); |
| 3091 } | 3098 } |
| 3092 }); | 3099 }); |
| 3093 | 3100 |
| 3094 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 3101 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 3102 // TODO(chrishtr): the cache only needs to be invalidated if one or more of |
| 3103 // the property tree nodes changed. |
| 3104 geometryMapper().clearCache(); |
| 3105 } |
| 3106 |
| 3107 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 3095 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); | 3108 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); |
| 3096 PrePaintTreeWalk(*m_geometryMapper).walk(*this); | 3109 PrePaintTreeWalk(geometryMapper()).walk(*this); |
| 3097 } | 3110 } |
| 3098 | 3111 |
| 3099 forAllNonThrottledFrameViews([](FrameView& frameView) { | 3112 forAllNonThrottledFrameViews([](FrameView& frameView) { |
| 3100 frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintClean); | 3113 frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintClean); |
| 3101 }); | 3114 }); |
| 3102 } | 3115 } |
| 3103 | 3116 |
| 3104 void FrameView::notifyPaint(const PaintController& paintController) const { | 3117 void FrameView::notifyPaint(const PaintController& paintController) const { |
| 3105 DCHECK(m_frame->document()); | 3118 DCHECK(m_frame->document()); |
| 3106 PaintTiming::from(*m_frame->document()) | 3119 PaintTiming::from(*m_frame->document()) |
| (...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5145 std::unique_ptr<CompositorAnimationTimeline> timeline) { | 5158 std::unique_ptr<CompositorAnimationTimeline> timeline) { |
| 5146 m_animationTimeline = std::move(timeline); | 5159 m_animationTimeline = std::move(timeline); |
| 5147 } | 5160 } |
| 5148 | 5161 |
| 5149 void FrameView::setAnimationHost( | 5162 void FrameView::setAnimationHost( |
| 5150 std::unique_ptr<CompositorAnimationHost> host) { | 5163 std::unique_ptr<CompositorAnimationHost> host) { |
| 5151 m_animationHost = std::move(host); | 5164 m_animationHost = std::move(host); |
| 5152 } | 5165 } |
| 5153 | 5166 |
| 5154 } // namespace blink | 5167 } // namespace blink |
| OLD | NEW |