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

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

Issue 2732573003: Skip paint property update and visual rect update if no geometry change (Closed)
Patch Set: - 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 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after
3138 m_paintController = PaintController::create(); 3138 m_paintController = PaintController::create();
3139 3139
3140 forAllNonThrottledFrameViews([](FrameView& frameView) { 3140 forAllNonThrottledFrameViews([](FrameView& frameView) {
3141 frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaint); 3141 frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaint);
3142 if (frameView.canThrottleRendering()) { 3142 if (frameView.canThrottleRendering()) {
3143 // This frame can be throttled but not throttled, meaning we are not in an 3143 // This frame can be throttled but not throttled, meaning we are not in an
3144 // AllowThrottlingScope. Now this frame may contain dirty paint flags, and 3144 // AllowThrottlingScope. Now this frame may contain dirty paint flags, and
3145 // we need to propagate the flags into the ancestor chain so that 3145 // we need to propagate the flags into the ancestor chain so that
3146 // PrePaintTreeWalk can reach this frame. 3146 // PrePaintTreeWalk can reach this frame.
3147 frameView.setNeedsPaintPropertyUpdate(); 3147 frameView.setNeedsPaintPropertyUpdate();
3148 if (auto owner = frameView.frame().ownerLayoutItem())
3149 owner.setMayNeedPaintInvalidation();
3148 } 3150 }
3149 }); 3151 });
3150 3152
3151 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { 3153 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
3152 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); 3154 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime");
3153 PrePaintTreeWalk(geometryMapper()).walk(*this); 3155 PrePaintTreeWalk(geometryMapper()).walk(*this);
3154 } 3156 }
3155 3157
3156 forAllNonThrottledFrameViews([](FrameView& frameView) { 3158 forAllNonThrottledFrameViews([](FrameView& frameView) {
3157 frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintClean); 3159 frameView.lifecycle().advanceTo(DocumentLifecycle::PrePaintClean);
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
4963 // so they should be able to tolerate some delay in receiving replies from a 4965 // so they should be able to tolerate some delay in receiving replies from a
4964 // throttled peer. 4966 // throttled peer.
4965 return m_hiddenForThrottling && m_frame->isCrossOriginSubframe(); 4967 return m_hiddenForThrottling && m_frame->isCrossOriginSubframe();
4966 } 4968 }
4967 4969
4968 void FrameView::beginLifecycleUpdates() { 4970 void FrameView::beginLifecycleUpdates() {
4969 // Avoid pumping frames for the initially empty document. 4971 // Avoid pumping frames for the initially empty document.
4970 if (!frame().loader().stateMachine()->committedFirstRealDocumentLoad()) 4972 if (!frame().loader().stateMachine()->committedFirstRealDocumentLoad())
4971 return; 4973 return;
4972 m_lifecycleUpdatesThrottled = false; 4974 m_lifecycleUpdatesThrottled = false;
4975 if (auto owner = frame().ownerLayoutItem())
4976 owner.setMayNeedPaintInvalidation();
4973 setupRenderThrottling(); 4977 setupRenderThrottling();
4974 updateRenderThrottlingStatus(m_hiddenForThrottling, m_subtreeThrottled); 4978 updateRenderThrottlingStatus(m_hiddenForThrottling, m_subtreeThrottled);
4975 // The compositor will "defer commits" for the main frame until we 4979 // The compositor will "defer commits" for the main frame until we
4976 // explicitly request them. 4980 // explicitly request them.
4977 if (frame().isMainFrame()) 4981 if (frame().isMainFrame())
4978 frame().page()->chromeClient().beginLifecycleUpdates(); 4982 frame().page()->chromeClient().beginLifecycleUpdates();
4979 } 4983 }
4980 4984
4981 void FrameView::setInitialViewportSize(const IntSize& viewportSize) { 4985 void FrameView::setInitialViewportSize(const IntSize& viewportSize) {
4982 if (viewportSize == m_initialViewportSize) 4986 if (viewportSize == m_initialViewportSize)
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
5251 void FrameView::setAnimationHost( 5255 void FrameView::setAnimationHost(
5252 std::unique_ptr<CompositorAnimationHost> host) { 5256 std::unique_ptr<CompositorAnimationHost> host) {
5253 m_animationHost = std::move(host); 5257 m_animationHost = std::move(host);
5254 } 5258 }
5255 5259
5256 LayoutUnit FrameView::caretWidth() const { 5260 LayoutUnit FrameView::caretWidth() const {
5257 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); 5261 return LayoutUnit(getHostWindow()->windowToViewportScalar(1));
5258 } 5262 }
5259 5263
5260 } // namespace blink 5264 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698