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

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: Review comments. 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 // FIXME: Keep the animation timing ticking while throttled.
esprehn 2015/09/02 21:10:37 I don't think you need to do anything special here
Sami 2015/09/03 17:23:20 This is referring to dstockwell@'s earlier comment
46 if (localFrame->shouldThrottleRenderingPipeline())
47 continue;
48 documents.append(localFrame->document());
44 } 49 }
45 50
46 for (auto& document : documents) { 51 for (auto& document : documents) {
47 if (document->view()) { 52 if (document->view()) {
48 document->view()->scrollableArea()->serviceScrollAnimations(monotoni cAnimationStartTime); 53 document->view()->scrollableArea()->serviceScrollAnimations(monotoni cAnimationStartTime);
49 54
50 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d ocument->view()->animatingScrollableAreas()) { 55 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d ocument->view()->animatingScrollableAreas()) {
51 // Iterate over a copy, since ScrollableAreas may deregister 56 // Iterate over a copy, since ScrollableAreas may deregister
52 // themselves during the iteration. 57 // themselves during the iteration.
53 Vector<ScrollableArea*> animatingScrollableAreasCopy; 58 Vector<ScrollableArea*> animatingScrollableAreasCopy;
(...skipping 30 matching lines...) Expand all
84 } 89 }
85 90
86 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame) 91 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame)
87 { 92 {
88 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view(); 93 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view();
89 94
90 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); 95 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true);
91 96
92 // setFrameRect may have the side-effect of causing existing page layout to 97 // setFrameRect may have the side-effect of causing existing page layout to
93 // be invalidated, so layout needs to be called last. 98 // be invalidated, so layout needs to be called last.
94 view->updateAllLifecyclePhases(); 99 view->updateAllLifecyclePhases(FrameView::LifecycleThrottlingMode::Allow);
esprehn 2015/09/02 21:10:37 Lets un-nest the enum.
Sami 2015/09/03 17:23:20 Done.
95 } 100 }
96 101
97 } 102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698