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

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

Issue 1410313004: Web Animations: Use a single animation clock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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 18 matching lines...) Expand all
29 29
30 DEFINE_TRACE(PageAnimator) 30 DEFINE_TRACE(PageAnimator)
31 { 31 {
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 clock().updateTime(monotonicAnimationStartTime);
39 40
40 WillBeHeapVector<RefPtrWillBeMember<Document>> documents; 41 WillBeHeapVector<RefPtrWillBeMember<Document>> documents;
41 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) { 42 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) {
42 if (frame->isLocalFrame()) 43 if (frame->isLocalFrame())
43 documents.append(toLocalFrame(frame)->document()); 44 documents.append(toLocalFrame(frame)->document());
44 } 45 }
45 46
46 for (auto& document : documents) { 47 for (auto& document : documents) {
47 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document, mo notonicAnimationStartTime); 48 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document);
48 if (document->view()) { 49 if (document->view()) {
49 if (document->view()->shouldThrottleRendering()) 50 if (document->view()->shouldThrottleRendering())
50 continue; 51 continue;
51 document->view()->scrollableArea()->serviceScrollAnimations(monotoni cAnimationStartTime); 52 document->view()->scrollableArea()->serviceScrollAnimations(monotoni cAnimationStartTime);
52 53
53 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d ocument->view()->animatingScrollableAreas()) { 54 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d ocument->view()->animatingScrollableAreas()) {
54 // Iterate over a copy, since ScrollableAreas may deregister 55 // Iterate over a copy, since ScrollableAreas may deregister
55 // themselves during the iteration. 56 // themselves during the iteration.
56 WillBeHeapVector<RawPtrWillBeMember<ScrollableArea>> animatingSc rollableAreasCopy; 57 WillBeHeapVector<RawPtrWillBeMember<ScrollableArea>> animatingSc rollableAreasCopy;
57 copyToVector(*animatingScrollableAreas, animatingScrollableAreas Copy); 58 copyToVector(*animatingScrollableAreas, animatingScrollableAreas Copy);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 102 }
102 103
103 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) 104 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame)
104 { 105 {
105 RefPtrWillBeRawPtr<FrameView> view = rootFrame.view(); 106 RefPtrWillBeRawPtr<FrameView> view = rootFrame.view();
106 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); 107 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true);
107 view->updateAllLifecyclePhases(); 108 view->updateAllLifecyclePhases();
108 } 109 }
109 110
110 } 111 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/PageAnimator.h ('k') | third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698