Chromium Code Reviews| 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/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 | 59 |
| 60 for (size_t i = 0; i < documents.size(); ++i) { | 60 for (size_t i = 0; i < documents.size(); ++i) { |
| 61 DocumentAnimations::updateAnimationTimingForAnimationFrame(*documents[i] , monotonicAnimationStartTime); | 61 DocumentAnimations::updateAnimationTimingForAnimationFrame(*documents[i] , monotonicAnimationStartTime); |
| 62 SVGDocumentExtensions::serviceOnAnimationFrame(*documents[i], monotonicA nimationStartTime); | 62 SVGDocumentExtensions::serviceOnAnimationFrame(*documents[i], monotonicA nimationStartTime); |
| 63 } | 63 } |
| 64 | 64 |
| 65 for (size_t i = 0; i < documents.size(); ++i) | 65 for (size_t i = 0; i < documents.size(); ++i) |
| 66 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); | 66 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void PageAnimator::scheduleVisualUpdate() | 69 void PageAnimator::scheduleVisualUpdate(LocalFrame* rootFrame) |
|
dcheng
2014/11/26 18:20:00
And then just call this frame--it's a bit confusin
dcheng
2014/11/26 18:20:00
And then just call this frame--it's a bit confusin
kenrb
2014/12/02 17:49:43
Done.
| |
| 70 { | 70 { |
| 71 // FIXME: also include m_animationFramePending here. It is currently not the re due to crbug.com/353756. | 71 // FIXME: also include m_animationFramePending here. It is currently not the re due to crbug.com/353756. |
| 72 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) | 72 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) |
| 73 return; | 73 return; |
| 74 m_page->chrome().scheduleAnimation(); | 74 // FIXME: The frame-specific version of scheduleAnimation() is for |
| 75 // out-of-process iframes. Passing 0 or the top-level frame to this method | |
| 76 // causes scheduleAnimation() to be called for the page, which still uses | |
| 77 // a page-level WebWidget (the WebViewImpl). | |
| 78 if (rootFrame && !rootFrame->isMainFrame() && rootFrame->isLocalRoot()) { | |
| 79 m_page->chrome().scheduleAnimationForFrame(rootFrame); | |
| 80 } else { | |
| 81 m_page->chrome().scheduleAnimation(); | |
| 82 } | |
| 75 } | 83 } |
| 76 | 84 |
| 77 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame) | 85 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame) |
| 78 { | 86 { |
| 79 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view(); | 87 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view(); |
| 80 | 88 |
| 81 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); | 89 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); |
| 82 | 90 |
| 83 // In order for our child HWNDs (NativeWindowWidgets) to update properly, | 91 // In order for our child HWNDs (NativeWindowWidgets) to update properly, |
| 84 // they need to be told that we are updating the screen. The problem is that | 92 // they need to be told that we are updating the screen. The problem is that |
| 85 // the native widgets need to recalculate their clip region and not overlap | 93 // the native widgets need to recalculate their clip region and not overlap |
| 86 // any of our non-native widgets. To force the resizing, call | 94 // any of our non-native widgets. To force the resizing, call |
| 87 // setFrameRect(). This will be a quick operation for most frames, but the | 95 // setFrameRect(). This will be a quick operation for most frames, but the |
| 88 // NativeWindowWidgets will update a proper clipping region. | 96 // NativeWindowWidgets will update a proper clipping region. |
| 89 view->setFrameRect(view->frameRect()); | 97 view->setFrameRect(view->frameRect()); |
| 90 | 98 |
| 91 // setFrameRect may have the side-effect of causing existing page layout to | 99 // setFrameRect may have the side-effect of causing existing page layout to |
| 92 // be invalidated, so layout needs to be called last. | 100 // be invalidated, so layout needs to be called last. |
| 93 view->updateLayoutAndStyleForPainting(); | 101 view->updateLayoutAndStyleForPainting(); |
| 94 } | 102 } |
| 95 | 103 |
| 96 } | 104 } |
| OLD | NEW |