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

Side by Side Diff: Source/core/page/PageAnimator.cpp

Issue 1246173002: Throttle rendering pipeline for invisible iframes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Clean up logic. Created 5 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/page/PageAnimator.h" 6 #include "core/page/PageAnimator.h"
7 7
8 #include "core/animation/DocumentAnimations.h" 8 #include "core/animation/DocumentAnimations.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 21 matching lines...) Expand all
32 visitor->trace(m_page); 32 visitor->trace(m_page);
33 } 33 }
34 34
35 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) 35 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
36 { 36 {
37 RefPtrWillBeRawPtr<PageAnimator> protector(this); 37 RefPtrWillBeRawPtr<PageAnimator> protector(this);
38 TemporaryChange<bool> servicing(m_servicingAnimations, true); 38 TemporaryChange<bool> servicing(m_servicingAnimations, true);
39 39
40 WillBeHeapVector<RefPtrWillBeMember<Document>> documents; 40 WillBeHeapVector<RefPtrWillBeMember<Document>> documents;
41 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) { 41 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) {
42 if (frame->isLocalFrame()) 42 if (!frame->isLocalFrame())
43 documents.append(toLocalFrame(frame)->document()); 43 continue;
44 LocalFrame* localFrame = toLocalFrame(frame);
45 if (localFrame->view() && localFrame->view()->shouldThrottleRenderingPip eline())
46 continue;
dstockwell 2015/09/01 23:52:24 I think we might want to split out the animation c
Sami 2015/09/02 10:46:03 Making sure the time still advances sounds like a
47 documents.append(localFrame->document());
44 } 48 }
45 49
46 for (auto& document : documents) { 50 for (auto& document : documents) {
47 if (document->view()) { 51 if (document->view()) {
48 document->view()->scrollableArea()->serviceScrollAnimations(monotoni cAnimationStartTime); 52 document->view()->scrollableArea()->serviceScrollAnimations(monotoni cAnimationStartTime);
49 53
50 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d ocument->view()->animatingScrollableAreas()) { 54 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d ocument->view()->animatingScrollableAreas()) {
51 // Iterate over a copy, since ScrollableAreas may deregister 55 // Iterate over a copy, since ScrollableAreas may deregister
52 // themselves during the iteration. 56 // themselves during the iteration.
53 Vector<ScrollableArea*> animatingScrollableAreasCopy; 57 Vector<ScrollableArea*> animatingScrollableAreasCopy;
(...skipping 30 matching lines...) Expand all
84 } 88 }
85 89
86 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame) 90 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame)
87 { 91 {
88 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view(); 92 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view();
89 93
90 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); 94 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true);
91 95
92 // setFrameRect may have the side-effect of causing existing page layout to 96 // setFrameRect may have the side-effect of causing existing page layout to
93 // be invalidated, so layout needs to be called last. 97 // be invalidated, so layout needs to be called last.
94 view->updateAllLifecyclePhases(); 98 view->updateAllLifecyclePhases(FrameView::LifecycleThrottlingMode::Allow);
95 } 99 }
96 100
97 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698