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

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: Keep animation time consistent. 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 26 matching lines...) Expand all
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 documents.append(toLocalFrame(frame)->document());
44 } 44 }
45 45
46 for (auto& document : documents) { 46 for (auto& document : documents) {
47 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document, mo notonicAnimationStartTime);
47 if (document->view()) { 48 if (document->view()) {
49 if (document->view()->shouldThrottleRenderingPipeline())
50 continue;
48 document->view()->scrollableArea()->serviceScrollAnimations(monotoni cAnimationStartTime); 51 document->view()->scrollableArea()->serviceScrollAnimations(monotoni cAnimationStartTime);
49 52
50 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d ocument->view()->animatingScrollableAreas()) { 53 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d ocument->view()->animatingScrollableAreas()) {
51 // Iterate over a copy, since ScrollableAreas may deregister 54 // Iterate over a copy, since ScrollableAreas may deregister
52 // themselves during the iteration. 55 // themselves during the iteration.
53 Vector<ScrollableArea*> animatingScrollableAreasCopy; 56 Vector<ScrollableArea*> animatingScrollableAreasCopy;
54 copyToVector(*animatingScrollableAreas, animatingScrollableAreas Copy); 57 copyToVector(*animatingScrollableAreas, animatingScrollableAreas Copy);
55 for (ScrollableArea* scrollableArea : animatingScrollableAreasCo py) 58 for (ScrollableArea* scrollableArea : animatingScrollableAreasCo py)
56 scrollableArea->serviceScrollAnimations(monotonicAnimationSt artTime); 59 scrollableArea->serviceScrollAnimations(monotonicAnimationSt artTime);
57 } 60 }
58 } 61 }
59 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document, mo notonicAnimationStartTime);
60 SVGDocumentExtensions::serviceOnAnimationFrame(*document, monotonicAnima tionStartTime); 62 SVGDocumentExtensions::serviceOnAnimationFrame(*document, monotonicAnima tionStartTime);
61 document->serviceScriptedAnimations(monotonicAnimationStartTime); 63 document->serviceScriptedAnimations(monotonicAnimationStartTime);
62 } 64 }
63 65
64 #if ENABLE(OILPAN) 66 #if ENABLE(OILPAN)
65 // TODO(esprehn): Why is this here? It doesn't make sense to explicitly 67 // TODO(esprehn): Why is this here? It doesn't make sense to explicitly
66 // clear a stack allocated vector. 68 // clear a stack allocated vector.
67 documents.clear(); 69 documents.clear();
68 #endif 70 #endif
69 } 71 }
(...skipping 14 matching lines...) Expand all
84 } 86 }
85 87
86 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame) 88 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame)
87 { 89 {
88 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view(); 90 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view();
89 91
90 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); 92 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true);
91 93
92 // setFrameRect may have the side-effect of causing existing page layout to 94 // setFrameRect may have the side-effect of causing existing page layout to
93 // be invalidated, so layout needs to be called last. 95 // be invalidated, so layout needs to be called last.
94 view->updateAllLifecyclePhases(); 96 view->updateAllLifecyclePhases(DocumentLifecycle::ThrottlingMode::Allow);
95 } 97 }
96 98
97 } 99 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698