| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 } | 49 } |
| 50 | 50 |
| 51 void PageAnimator::scheduleVisualUpdate() | 51 void PageAnimator::scheduleVisualUpdate() |
| 52 { | 52 { |
| 53 // FIXME: also include m_animationFramePending here. It is currently not the
re due to crbug.com/353756. | 53 // FIXME: also include m_animationFramePending here. It is currently not the
re due to crbug.com/353756. |
| 54 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) | 54 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) |
| 55 return; | 55 return; |
| 56 m_page->chrome().scheduleAnimation(); | 56 m_page->chrome().scheduleAnimation(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void PageAnimator::updateLayoutAndStyleForPainting() | 59 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame) |
| 60 { | 60 { |
| 61 if (!m_page->mainFrame()->isLocalFrame()) | 61 RefPtr<FrameView> view = rootFrame->view(); |
| 62 return; | |
| 63 | |
| 64 RefPtr<FrameView> view = m_page->deprecatedLocalMainFrame()->view(); | |
| 65 | 62 |
| 66 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); | 63 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); |
| 67 | 64 |
| 68 // In order for our child HWNDs (NativeWindowWidgets) to update properly, | 65 // In order for our child HWNDs (NativeWindowWidgets) to update properly, |
| 69 // they need to be told that we are updating the screen. The problem is that | 66 // they need to be told that we are updating the screen. The problem is that |
| 70 // the native widgets need to recalculate their clip region and not overlap | 67 // the native widgets need to recalculate their clip region and not overlap |
| 71 // any of our non-native widgets. To force the resizing, call | 68 // any of our non-native widgets. To force the resizing, call |
| 72 // setFrameRect(). This will be a quick operation for most frames, but the | 69 // setFrameRect(). This will be a quick operation for most frames, but the |
| 73 // NativeWindowWidgets will update a proper clipping region. | 70 // NativeWindowWidgets will update a proper clipping region. |
| 74 view->setFrameRect(view->frameRect()); | 71 view->setFrameRect(view->frameRect()); |
| 75 | 72 |
| 76 // setFrameRect may have the side-effect of causing existing page layout to | 73 // setFrameRect may have the side-effect of causing existing page layout to |
| 77 // be invalidated, so layout needs to be called last. | 74 // be invalidated, so layout needs to be called last. |
| 78 view->updateLayoutAndStyleForPainting(); | 75 view->updateLayoutAndStyleForPainting(); |
| 79 } | 76 } |
| 80 | 77 |
| 81 } | 78 } |
| OLD | NEW |