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

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

Issue 1364063007: Throttle rendering pipeline for invisible frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo in comment. Created 5 years, 2 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 // 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()->shouldThrottleRendering())
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); 62 // TODO(skyostil): Find out if these functions need to be run for docume nts without views.
esprehn 2015/10/16 21:40:45 They definitely shouldn't run for documents withou
Sami 2015/10/19 10:51:06 Right, I wasn't sure if we were sure about that. U
60 SVGDocumentExtensions::serviceOnAnimationFrame(*document, monotonicAnima tionStartTime); 63 SVGDocumentExtensions::serviceOnAnimationFrame(*document, monotonicAnima tionStartTime);
61 document->serviceScriptedAnimations(monotonicAnimationStartTime); 64 document->serviceScriptedAnimations(monotonicAnimationStartTime);
62 } 65 }
63 66
64 #if ENABLE(OILPAN) 67 #if ENABLE(OILPAN)
65 // TODO(esprehn): Why is this here? It doesn't make sense to explicitly 68 // TODO(esprehn): Why is this here? It doesn't make sense to explicitly
66 // clear a stack allocated vector. 69 // clear a stack allocated vector.
67 documents.clear(); 70 documents.clear();
68 #endif 71 #endif
69 } 72 }
(...skipping 18 matching lines...) Expand all
88 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view(); 91 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view();
89 92
90 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); 93 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true);
91 94
92 // setFrameRect may have the side-effect of causing existing page layout to 95 // setFrameRect may have the side-effect of causing existing page layout to
93 // be invalidated, so layout needs to be called last. 96 // be invalidated, so layout needs to be called last.
94 view->updateAllLifecyclePhases(); 97 view->updateAllLifecyclePhases();
95 } 98 }
96 99
97 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698