| OLD | NEW |
| 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/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 , m_servicingAnimations(false) | 22 , m_servicingAnimations(false) |
| 23 , m_updatingLayoutAndStyleForPainting(false) | 23 , m_updatingLayoutAndStyleForPainting(false) |
| 24 { | 24 { |
| 25 } | 25 } |
| 26 | 26 |
| 27 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) | 27 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) |
| 28 { | 28 { |
| 29 m_animationFramePending = false; | 29 m_animationFramePending = false; |
| 30 TemporaryChange<bool> servicing(m_servicingAnimations, true); | 30 TemporaryChange<bool> servicing(m_servicingAnimations, true); |
| 31 | 31 |
| 32 for (RefPtr<LocalFrame> frame = m_page->mainFrame(); frame; frame = frame->t
ree().traverseNext()) { | 32 Vector<RefPtr<Document> > documents; |
| 33 frame->view()->serviceScrollAnimations(); | 33 for (RefPtr<LocalFrame> frame = m_page->mainFrame(); frame; frame = frame->t
ree().traverseNext()) |
| 34 DocumentAnimations::updateAnimationTimingForAnimationFrame(*frame->docum
ent(), monotonicAnimationStartTime); | 34 documents.append(frame->document()); |
| 35 SVGDocumentExtensions::serviceOnAnimationFrame(*frame->document(), monot
onicAnimationStartTime); | 35 |
| 36 for (size_t i = 0; i < documents.size(); ++i) { |
| 37 if (documents[i]->frame()) { |
| 38 documents[i]->view()->serviceScrollAnimations(); |
| 39 |
| 40 if (const FrameView::ScrollableAreaSet* scrollableAreas = documents[
i]->view()->scrollableAreas()) { |
| 41 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas
->begin(); it != scrollableAreas->end(); ++it) |
| 42 (*it)->serviceScrollAnimations(); |
| 43 } |
| 44 } |
| 36 } | 45 } |
| 37 | 46 |
| 38 Vector<RefPtr<Document> > documents; | 47 for (size_t i = 0; i < documents.size(); ++i) { |
| 39 for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().t
raverseNext()) | 48 DocumentAnimations::updateAnimationTimingForAnimationFrame(*documents[i]
, monotonicAnimationStartTime); |
| 40 documents.append(frame->document()); | 49 SVGDocumentExtensions::serviceOnAnimationFrame(*documents[i], monotonicA
nimationStartTime); |
| 50 } |
| 41 | 51 |
| 42 for (size_t i = 0; i < documents.size(); ++i) | 52 for (size_t i = 0; i < documents.size(); ++i) |
| 43 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); | 53 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); |
| 44 | 54 |
| 45 // Frame callbacks might have started new players or caused existing players
to become outdated. | 55 // Frame callbacks might have started new players or caused existing players
to become outdated. |
| 46 for (size_t i = 0; i < documents.size(); ++i) | 56 for (size_t i = 0; i < documents.size(); ++i) |
| 47 DocumentAnimations::updateOutdatedAnimationPlayersAfterFrameCallbacks(*d
ocuments[i]); | 57 DocumentAnimations::updateOutdatedAnimationPlayersAfterFrameCallbacks(*d
ocuments[i]); |
| 48 } | 58 } |
| 49 | 59 |
| 50 void PageAnimator::scheduleVisualUpdate() | 60 void PageAnimator::scheduleVisualUpdate() |
| (...skipping 17 matching lines...) Expand all Loading... |
| 68 // setFrameRect(). This will be a quick operation for most frames, but the | 78 // setFrameRect(). This will be a quick operation for most frames, but the |
| 69 // NativeWindowWidgets will update a proper clipping region. | 79 // NativeWindowWidgets will update a proper clipping region. |
| 70 view->setFrameRect(view->frameRect()); | 80 view->setFrameRect(view->frameRect()); |
| 71 | 81 |
| 72 // setFrameRect may have the side-effect of causing existing page layout to | 82 // setFrameRect may have the side-effect of causing existing page layout to |
| 73 // be invalidated, so layout needs to be called last. | 83 // be invalidated, so layout needs to be called last. |
| 74 view->updateLayoutAndStyleForPainting(); | 84 view->updateLayoutAndStyleForPainting(); |
| 75 } | 85 } |
| 76 | 86 |
| 77 } | 87 } |
| OLD | NEW |