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 2908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2919 // TODO(chrishtr): add a scrolling update lifecycle phase. | 2919 // TODO(chrishtr): add a scrolling update lifecycle phase. |
2920 void FrameView::UpdateLifecycleToCompositingCleanPlusScrolling() { | 2920 void FrameView::UpdateLifecycleToCompositingCleanPlusScrolling() { |
2921 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 2921 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
2922 UpdateAllLifecyclePhasesExceptPaint(); | 2922 UpdateAllLifecyclePhasesExceptPaint(); |
2923 } else { | 2923 } else { |
2924 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal( | 2924 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal( |
2925 DocumentLifecycle::kCompositingClean); | 2925 DocumentLifecycle::kCompositingClean); |
2926 } | 2926 } |
2927 } | 2927 } |
2928 | 2928 |
| 2929 void FrameView::UpdateLifecycleToCompositingInputsClean() { |
| 2930 // When SPv2 is enabled, the standard compositing lifecycle steps do not |
| 2931 // exist; compositing is done after paint instead. |
| 2932 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 2933 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal( |
| 2934 DocumentLifecycle::kCompositingInputsClean); |
| 2935 } |
| 2936 |
2929 void FrameView::UpdateAllLifecyclePhasesExceptPaint() { | 2937 void FrameView::UpdateAllLifecyclePhasesExceptPaint() { |
2930 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal( | 2938 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal( |
2931 DocumentLifecycle::kPrePaintClean); | 2939 DocumentLifecycle::kPrePaintClean); |
2932 } | 2940 } |
2933 | 2941 |
2934 void FrameView::UpdateLifecycleToLayoutClean() { | 2942 void FrameView::UpdateLifecycleToLayoutClean() { |
2935 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal( | 2943 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal( |
2936 DocumentLifecycle::kLayoutClean); | 2944 DocumentLifecycle::kLayoutClean); |
2937 } | 2945 } |
2938 | 2946 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3023 NOTREACHED() << "FrameView::updateLifecyclePhasesInternal() reentrance"; | 3031 NOTREACHED() << "FrameView::updateLifecyclePhasesInternal() reentrance"; |
3024 return; | 3032 return; |
3025 } | 3033 } |
3026 | 3034 |
3027 // This must be called from the root frame, since it recurses down, not up. | 3035 // This must be called from the root frame, since it recurses down, not up. |
3028 // Otherwise the lifecycles of the frames might be out of sync. | 3036 // Otherwise the lifecycles of the frames might be out of sync. |
3029 DCHECK(frame_->IsLocalRoot()); | 3037 DCHECK(frame_->IsLocalRoot()); |
3030 | 3038 |
3031 // Only the following target states are supported. | 3039 // Only the following target states are supported. |
3032 DCHECK(target_state == DocumentLifecycle::kLayoutClean || | 3040 DCHECK(target_state == DocumentLifecycle::kLayoutClean || |
| 3041 target_state == DocumentLifecycle::kCompositingInputsClean || |
3033 target_state == DocumentLifecycle::kCompositingClean || | 3042 target_state == DocumentLifecycle::kCompositingClean || |
3034 target_state == DocumentLifecycle::kPrePaintClean || | 3043 target_state == DocumentLifecycle::kPrePaintClean || |
3035 target_state == DocumentLifecycle::kPaintClean); | 3044 target_state == DocumentLifecycle::kPaintClean); |
3036 | 3045 |
3037 if (!frame_->GetDocument()->IsActive()) | 3046 if (!frame_->GetDocument()->IsActive()) |
3038 return; | 3047 return; |
3039 | 3048 |
3040 AutoReset<DocumentLifecycle::LifecycleState> target_state_scope( | 3049 AutoReset<DocumentLifecycle::LifecycleState> target_state_scope( |
3041 ¤t_update_lifecycle_phases_target_state_, target_state); | 3050 ¤t_update_lifecycle_phases_target_state_, target_state); |
3042 | 3051 |
(...skipping 29 matching lines...) Expand all Loading... |
3072 ForAllNonThrottledFrameViews([](FrameView& frame_view) { | 3081 ForAllNonThrottledFrameViews([](FrameView& frame_view) { |
3073 frame_view.CheckDoesNotNeedLayout(); | 3082 frame_view.CheckDoesNotNeedLayout(); |
3074 frame_view.allows_layout_invalidation_after_layout_clean_ = false; | 3083 frame_view.allows_layout_invalidation_after_layout_clean_ = false; |
3075 }); | 3084 }); |
3076 | 3085 |
3077 { | 3086 { |
3078 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", | 3087 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", |
3079 InspectorUpdateLayerTreeEvent::Data(frame_.Get())); | 3088 InspectorUpdateLayerTreeEvent::Data(frame_.Get())); |
3080 | 3089 |
3081 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 3090 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
3082 view.Compositor()->UpdateIfNeededRecursive(); | 3091 view.Compositor()->UpdateIfNeededRecursive(target_state); |
3083 } else { | 3092 } else { |
3084 ForAllNonThrottledFrameViews([](FrameView& frame_view) { | 3093 ForAllNonThrottledFrameViews([](FrameView& frame_view) { |
3085 frame_view.GetLayoutView()->Layer()->UpdateDescendantDependentFlags(); | 3094 frame_view.GetLayoutView()->Layer()->UpdateDescendantDependentFlags(); |
3086 frame_view.GetLayoutView()->CommitPendingSelection(); | 3095 frame_view.GetLayoutView()->CommitPendingSelection(); |
3087 }); | 3096 }); |
3088 } | 3097 } |
3089 | 3098 |
| 3099 if (target_state == DocumentLifecycle::kCompositingInputsClean) { |
| 3100 DCHECK_EQ(Lifecycle().GetState(), |
| 3101 DocumentLifecycle::kCompositingInputsClean); |
| 3102 return; |
| 3103 } |
| 3104 |
3090 ScrollContentsIfNeededRecursive(); | 3105 ScrollContentsIfNeededRecursive(); |
3091 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() || | 3106 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() || |
3092 Lifecycle().GetState() >= DocumentLifecycle::kCompositingClean); | 3107 Lifecycle().GetState() >= DocumentLifecycle::kCompositingClean); |
3093 | 3108 |
3094 frame_->GetPage()->GlobalRootScrollerController().DidUpdateCompositing(); | 3109 frame_->GetPage()->GlobalRootScrollerController().DidUpdateCompositing(); |
3095 | 3110 |
3096 if (target_state >= DocumentLifecycle::kPrePaintClean) { | 3111 if (target_state >= DocumentLifecycle::kPrePaintClean) { |
3097 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) | 3112 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
3098 InvalidateTreeIfNeededRecursive(); | 3113 InvalidateTreeIfNeededRecursive(); |
3099 | 3114 |
(...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5331 void FrameView::SetAnimationHost( | 5346 void FrameView::SetAnimationHost( |
5332 std::unique_ptr<CompositorAnimationHost> host) { | 5347 std::unique_ptr<CompositorAnimationHost> host) { |
5333 animation_host_ = std::move(host); | 5348 animation_host_ = std::move(host); |
5334 } | 5349 } |
5335 | 5350 |
5336 LayoutUnit FrameView::CaretWidth() const { | 5351 LayoutUnit FrameView::CaretWidth() const { |
5337 return LayoutUnit(GetHostWindow()->WindowToViewportScalar(1)); | 5352 return LayoutUnit(GetHostWindow()->WindowToViewportScalar(1)); |
5338 } | 5353 } |
5339 | 5354 |
5340 } // namespace blink | 5355 } // namespace blink |
OLD | NEW |