Chromium Code Reviews| 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 2798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2809 | 2809 |
| 2810 void FrameView::updateWidgetGeometriesIfNeeded() { | 2810 void FrameView::updateWidgetGeometriesIfNeeded() { |
| 2811 if (!m_needsUpdateWidgetGeometries) | 2811 if (!m_needsUpdateWidgetGeometries) |
| 2812 return; | 2812 return; |
| 2813 | 2813 |
| 2814 m_needsUpdateWidgetGeometries = false; | 2814 m_needsUpdateWidgetGeometries = false; |
| 2815 | 2815 |
| 2816 updateWidgetGeometries(); | 2816 updateWidgetGeometries(); |
| 2817 } | 2817 } |
| 2818 | 2818 |
| 2819 GeometryMapper& FrameView::geometryMapper() { | |
| 2820 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | |
| 2821 DCHECK(lifecycle().state() >= DocumentLifecycle::InPrePaint); | |
| 2822 | |
| 2823 if (m_frame->isLocalRoot()) { | |
| 2824 if (!m_geometryMapper) | |
| 2825 m_geometryMapper = GeometryMapper::create(); | |
| 2826 return *m_geometryMapper.get(); | |
| 2827 } | |
| 2828 | |
| 2829 return frame().localFrameRoot()->view()->geometryMapper(); | |
| 2830 } | |
| 2831 | |
| 2819 void FrameView::updateAllLifecyclePhases() { | 2832 void FrameView::updateAllLifecyclePhases() { |
| 2820 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( | 2833 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( |
| 2821 DocumentLifecycle::PaintClean); | 2834 DocumentLifecycle::PaintClean); |
| 2822 } | 2835 } |
| 2823 | 2836 |
| 2824 // TODO(chrishtr): add a scrolling update lifecycle phase. | 2837 // TODO(chrishtr): add a scrolling update lifecycle phase. |
| 2825 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() { | 2838 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() { |
| 2826 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 2839 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 2827 updateAllLifecyclePhasesExceptPaint(); | 2840 updateAllLifecyclePhasesExceptPaint(); |
| 2828 } else { | 2841 } else { |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3025 } | 3038 } |
| 3026 m_anchoringAdjustmentQueue.clear(); | 3039 m_anchoringAdjustmentQueue.clear(); |
| 3027 } | 3040 } |
| 3028 | 3041 |
| 3029 void FrameView::prePaint() { | 3042 void FrameView::prePaint() { |
| 3030 TRACE_EVENT0("blink", "FrameView::prePaint"); | 3043 TRACE_EVENT0("blink", "FrameView::prePaint"); |
| 3031 | 3044 |
| 3032 if (!m_paintController) | 3045 if (!m_paintController) |
| 3033 m_paintController = PaintController::create(); | 3046 m_paintController = PaintController::create(); |
| 3034 | 3047 |
| 3035 if (!m_geometryMapper) | |
| 3036 m_geometryMapper.reset(new GeometryMapper()); | |
| 3037 // TODO(chrishtr): the cache only needs to be invalidated if one or more of | |
| 3038 // the property tree nodes changed. | |
| 3039 m_geometryMapper->clearCache(); | |
| 3040 | |
| 3041 forAllNonThrottledFrameViews([](FrameView& frameView) { | 3048 forAllNonThrottledFrameViews([](FrameView& frameView) { |
| 3042 frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaint); | 3049 frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaint); |
| 3043 if (frameView.canThrottleRendering()) { | 3050 if (frameView.canThrottleRendering()) { |
| 3044 // This frame can be throttled but not throttled, meaning we are not in an | 3051 // This frame can be throttled but not throttled, meaning we are not in an |
| 3045 // AllowThrottlingScope. Now this frame may contain dirty paint flags, and | 3052 // AllowThrottlingScope. Now this frame may contain dirty paint flags, and |
| 3046 // we need to propagate the flags into the ancestor chain so that | 3053 // we need to propagate the flags into the ancestor chain so that |
| 3047 // PrePaintTreeWalk can reach this frame. | 3054 // PrePaintTreeWalk can reach this frame. |
| 3048 frameView.setNeedsPaintPropertyUpdate(); | 3055 frameView.setNeedsPaintPropertyUpdate(); |
| 3049 } | 3056 } |
| 3050 }); | 3057 }); |
| 3051 | 3058 |
| 3052 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 3059 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 3060 // TODO(chrishtr): the cache only needs to be invalidated if one or more | |
| 3061 // of | |
|
pdr.
2017/02/10 23:19:20
Nit: indentation.
chrishtr
2017/02/10 23:23:21
Done.
| |
| 3062 // the property tree nodes changed. | |
| 3063 geometryMapper().clearCache(); | |
| 3064 } | |
| 3065 | |
| 3066 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | |
| 3053 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); | 3067 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); |
| 3054 PrePaintTreeWalk(*m_geometryMapper).walk(*this); | 3068 PrePaintTreeWalk(geometryMapper()).walk(*this); |
| 3055 } | 3069 } |
| 3056 | 3070 |
| 3057 forAllNonThrottledFrameViews([](FrameView& frameView) { | 3071 forAllNonThrottledFrameViews([](FrameView& frameView) { |
| 3058 frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintClean); | 3072 frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintClean); |
| 3059 }); | 3073 }); |
| 3060 } | 3074 } |
| 3061 | 3075 |
| 3062 void FrameView::notifyPaint(const PaintController& paintController) const { | 3076 void FrameView::notifyPaint(const PaintController& paintController) const { |
| 3063 DCHECK(m_frame->document()); | 3077 DCHECK(m_frame->document()); |
| 3064 PaintTiming::from(*m_frame->document()) | 3078 PaintTiming::from(*m_frame->document()) |
| (...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5101 std::unique_ptr<CompositorAnimationTimeline> timeline) { | 5115 std::unique_ptr<CompositorAnimationTimeline> timeline) { |
| 5102 m_animationTimeline = std::move(timeline); | 5116 m_animationTimeline = std::move(timeline); |
| 5103 } | 5117 } |
| 5104 | 5118 |
| 5105 void FrameView::setAnimationHost( | 5119 void FrameView::setAnimationHost( |
| 5106 std::unique_ptr<CompositorAnimationHost> host) { | 5120 std::unique_ptr<CompositorAnimationHost> host) { |
| 5107 m_animationHost = std::move(host); | 5121 m_animationHost = std::move(host); |
| 5108 } | 5122 } |
| 5109 | 5123 |
| 5110 } // namespace blink | 5124 } // namespace blink |
| OLD | NEW |