Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2795263002: Add a new document lifecycle; CompositingInputsClean (Closed)
Patch Set: Rebase past blink reformat Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2902 matching lines...) Expand 10 before | Expand all | Expand 10 after
2913 // TODO(chrishtr): add a scrolling update lifecycle phase. 2913 // TODO(chrishtr): add a scrolling update lifecycle phase.
2914 void FrameView::UpdateLifecycleToCompositingCleanPlusScrolling() { 2914 void FrameView::UpdateLifecycleToCompositingCleanPlusScrolling() {
2915 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 2915 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
2916 UpdateAllLifecyclePhasesExceptPaint(); 2916 UpdateAllLifecyclePhasesExceptPaint();
2917 } else { 2917 } else {
2918 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal( 2918 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal(
2919 DocumentLifecycle::kCompositingClean); 2919 DocumentLifecycle::kCompositingClean);
2920 } 2920 }
2921 } 2921 }
2922 2922
2923 void FrameView::UpdateLifecycleToCompositingInputsClean() {
2924 // TODO(smcgruer): DCHECK !RuntimeEnabledFeatures::slimmingPaintV2Enabled() ?
flackr 2017/04/11 20:46:28 This is never called with slimming paint V2? Are t
smcgruer 2017/04/12 15:33:04 This should never be called with spv2, as the enti
flackr 2017/04/12 15:50:15 Acknowledged.
2925 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
2926 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal(
2927 DocumentLifecycle::kCompositingInputsClean);
2928 }
2929 }
2930
2923 void FrameView::UpdateAllLifecyclePhasesExceptPaint() { 2931 void FrameView::UpdateAllLifecyclePhasesExceptPaint() {
2924 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal( 2932 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal(
2925 DocumentLifecycle::kPrePaintClean); 2933 DocumentLifecycle::kPrePaintClean);
2926 } 2934 }
2927 2935
2928 void FrameView::UpdateLifecycleToLayoutClean() { 2936 void FrameView::UpdateLifecycleToLayoutClean() {
2929 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal( 2937 GetFrame().LocalFrameRoot()->View()->UpdateLifecyclePhasesInternal(
2930 DocumentLifecycle::kLayoutClean); 2938 DocumentLifecycle::kLayoutClean);
2931 } 2939 }
2932 2940
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
3014 NOTREACHED() << "FrameView::updateLifecyclePhasesInternal() reentrance"; 3022 NOTREACHED() << "FrameView::updateLifecyclePhasesInternal() reentrance";
3015 return; 3023 return;
3016 } 3024 }
3017 3025
3018 // This must be called from the root frame, since it recurses down, not up. 3026 // This must be called from the root frame, since it recurses down, not up.
3019 // Otherwise the lifecycles of the frames might be out of sync. 3027 // Otherwise the lifecycles of the frames might be out of sync.
3020 DCHECK(frame_->IsLocalRoot()); 3028 DCHECK(frame_->IsLocalRoot());
3021 3029
3022 // Only the following target states are supported. 3030 // Only the following target states are supported.
3023 DCHECK(target_state == DocumentLifecycle::kLayoutClean || 3031 DCHECK(target_state == DocumentLifecycle::kLayoutClean ||
3032 target_state == DocumentLifecycle::kCompositingInputsClean ||
3024 target_state == DocumentLifecycle::kCompositingClean || 3033 target_state == DocumentLifecycle::kCompositingClean ||
3025 target_state == DocumentLifecycle::kPrePaintClean || 3034 target_state == DocumentLifecycle::kPrePaintClean ||
3026 target_state == DocumentLifecycle::kPaintClean); 3035 target_state == DocumentLifecycle::kPaintClean);
3027 3036
3028 if (!frame_->GetDocument()->IsActive()) 3037 if (!frame_->GetDocument()->IsActive())
3029 return; 3038 return;
3030 3039
3031 AutoReset<DocumentLifecycle::LifecycleState> target_state_scope( 3040 AutoReset<DocumentLifecycle::LifecycleState> target_state_scope(
3032 &current_update_lifecycle_phases_target_state_, target_state); 3041 &current_update_lifecycle_phases_target_state_, target_state);
3033 3042
(...skipping 29 matching lines...) Expand all
3063 ForAllNonThrottledFrameViews([](FrameView& frame_view) { 3072 ForAllNonThrottledFrameViews([](FrameView& frame_view) {
3064 frame_view.CheckDoesNotNeedLayout(); 3073 frame_view.CheckDoesNotNeedLayout();
3065 frame_view.allows_layout_invalidation_after_layout_clean_ = false; 3074 frame_view.allows_layout_invalidation_after_layout_clean_ = false;
3066 }); 3075 });
3067 3076
3068 { 3077 {
3069 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", 3078 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data",
3070 InspectorUpdateLayerTreeEvent::Data(frame_.Get())); 3079 InspectorUpdateLayerTreeEvent::Data(frame_.Get()));
3071 3080
3072 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 3081 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
3073 view.Compositor()->UpdateIfNeededRecursive(); 3082 view.Compositor()->UpdateIfNeededRecursive(target_state);
3074 } else { 3083 } else {
3075 ForAllNonThrottledFrameViews([](FrameView& frame_view) { 3084 ForAllNonThrottledFrameViews([](FrameView& frame_view) {
3076 frame_view.GetLayoutView()->Layer()->UpdateDescendantDependentFlags(); 3085 frame_view.GetLayoutView()->Layer()->UpdateDescendantDependentFlags();
3077 frame_view.GetLayoutView()->CommitPendingSelection(); 3086 frame_view.GetLayoutView()->CommitPendingSelection();
3078 }); 3087 });
3079 } 3088 }
3080 3089
3090 if (target_state == DocumentLifecycle::kCompositingInputsClean) {
3091 DCHECK_EQ(Lifecycle().GetState(),
3092 DocumentLifecycle::kCompositingInputsClean);
3093 return;
3094 }
3095
3081 ScrollContentsIfNeededRecursive(); 3096 ScrollContentsIfNeededRecursive();
3082 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() || 3097 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() ||
3083 Lifecycle().GetState() >= DocumentLifecycle::kCompositingClean); 3098 Lifecycle().GetState() >= DocumentLifecycle::kCompositingClean);
3084 3099
3085 frame_->GetPage()->GlobalRootScrollerController().DidUpdateCompositing(); 3100 frame_->GetPage()->GlobalRootScrollerController().DidUpdateCompositing();
3086 3101
3087 if (target_state >= DocumentLifecycle::kPrePaintClean) { 3102 if (target_state >= DocumentLifecycle::kPrePaintClean) {
3088 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) 3103 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
3089 InvalidateTreeIfNeededRecursive(); 3104 InvalidateTreeIfNeededRecursive();
3090 3105
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698