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

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

Issue 2792063002: Reland of Skip paint property update and visual rect update if no geometry change (Closed)
Patch Set: Rebase 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 3114 matching lines...) Expand 10 before | Expand all | Expand 10 after
3125 m_paintController = PaintController::create(); 3125 m_paintController = PaintController::create();
3126 3126
3127 forAllNonThrottledFrameViews([](FrameView& frameView) { 3127 forAllNonThrottledFrameViews([](FrameView& frameView) {
3128 frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaint); 3128 frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaint);
3129 if (frameView.canThrottleRendering()) { 3129 if (frameView.canThrottleRendering()) {
3130 // 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
3131 // AllowThrottlingScope. Now this frame may contain dirty paint flags, and 3131 // AllowThrottlingScope. Now this frame may contain dirty paint flags, and
3132 // 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
3133 // PrePaintTreeWalk can reach this frame. 3133 // PrePaintTreeWalk can reach this frame.
3134 frameView.setNeedsPaintPropertyUpdate(); 3134 frameView.setNeedsPaintPropertyUpdate();
3135 if (auto owner = frameView.frame().ownerLayoutItem())
3136 owner.setMayNeedPaintInvalidation();
3135 } 3137 }
3136 }); 3138 });
3137 3139
3138 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { 3140 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
3139 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); 3141 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime");
3140 PrePaintTreeWalk().walk(*this); 3142 PrePaintTreeWalk().walk(*this);
3141 } 3143 }
3142 3144
3143 forAllNonThrottledFrameViews([](FrameView& frameView) { 3145 forAllNonThrottledFrameViews([](FrameView& frameView) {
3144 frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintClean); 3146 frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintClean);
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after
4949 // so they should be able to tolerate some delay in receiving replies from a 4951 // so they should be able to tolerate some delay in receiving replies from a
4950 // throttled peer. 4952 // throttled peer.
4951 return m_hiddenForThrottling && m_frame->isCrossOriginSubframe(); 4953 return m_hiddenForThrottling && m_frame->isCrossOriginSubframe();
4952 } 4954 }
4953 4955
4954 void FrameView::beginLifecycleUpdates() { 4956 void FrameView::beginLifecycleUpdates() {
4955 // Avoid pumping frames for the initially empty document. 4957 // Avoid pumping frames for the initially empty document.
4956 if (!frame().loader().stateMachine()->committedFirstRealDocumentLoad()) 4958 if (!frame().loader().stateMachine()->committedFirstRealDocumentLoad())
4957 return; 4959 return;
4958 m_lifecycleUpdatesThrottled = false; 4960 m_lifecycleUpdatesThrottled = false;
4961 if (auto owner = frame().ownerLayoutItem())
4962 owner.setMayNeedPaintInvalidation();
4959 setupRenderThrottling(); 4963 setupRenderThrottling();
4960 updateRenderThrottlingStatus(m_hiddenForThrottling, m_subtreeThrottled); 4964 updateRenderThrottlingStatus(m_hiddenForThrottling, m_subtreeThrottled);
4961 // The compositor will "defer commits" for the main frame until we 4965 // The compositor will "defer commits" for the main frame until we
4962 // explicitly request them. 4966 // explicitly request them.
4963 if (frame().isMainFrame()) 4967 if (frame().isMainFrame())
4964 frame().page()->chromeClient().beginLifecycleUpdates(); 4968 frame().page()->chromeClient().beginLifecycleUpdates();
4965 } 4969 }
4966 4970
4967 void FrameView::setInitialViewportSize(const IntSize& viewportSize) { 4971 void FrameView::setInitialViewportSize(const IntSize& viewportSize) {
4968 if (viewportSize == m_initialViewportSize) 4972 if (viewportSize == m_initialViewportSize)
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
5237 void FrameView::setAnimationHost( 5241 void FrameView::setAnimationHost(
5238 std::unique_ptr<CompositorAnimationHost> host) { 5242 std::unique_ptr<CompositorAnimationHost> host) {
5239 m_animationHost = std::move(host); 5243 m_animationHost = std::move(host);
5240 } 5244 }
5241 5245
5242 LayoutUnit FrameView::caretWidth() const { 5246 LayoutUnit FrameView::caretWidth() const {
5243 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); 5247 return LayoutUnit(getHostWindow()->windowToViewportScalar(1));
5244 } 5248 }
5245 5249
5246 } // namespace blink 5250 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698