| 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/FrameProtector.h" |
| 9 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 11 #include "core/frame/LocalFrame.h" |
| 11 #include "core/page/Chrome.h" | 12 #include "core/page/Chrome.h" |
| 12 #include "core/page/ChromeClient.h" | 13 #include "core/page/ChromeClient.h" |
| 13 #include "core/page/Page.h" | 14 #include "core/page/Page.h" |
| 14 #include "core/svg/SVGDocumentExtensions.h" | 15 #include "core/svg/SVGDocumentExtensions.h" |
| 15 #include "platform/Logging.h" | 16 #include "platform/Logging.h" |
| 16 | 17 |
| 17 namespace blink { | 18 namespace blink { |
| 18 | 19 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 void PageAnimator::scheduleVisualUpdate() | 61 void PageAnimator::scheduleVisualUpdate() |
| 61 { | 62 { |
| 62 // FIXME: also include m_animationFramePending here. It is currently not the
re due to crbug.com/353756. | 63 // FIXME: also include m_animationFramePending here. It is currently not the
re due to crbug.com/353756. |
| 63 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) | 64 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) |
| 64 return; | 65 return; |
| 65 m_page->chrome().scheduleAnimation(); | 66 m_page->chrome().scheduleAnimation(); |
| 66 } | 67 } |
| 67 | 68 |
| 68 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame) | 69 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame) |
| 69 { | 70 { |
| 70 RefPtr<FrameView> view = rootFrame->view(); | 71 FrameView* view = rootFrame->view(); |
| 71 | 72 FrameViewProtector protect(view); |
| 72 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); | 73 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); |
| 73 | 74 |
| 74 // In order for our child HWNDs (NativeWindowWidgets) to update properly, | 75 // In order for our child HWNDs (NativeWindowWidgets) to update properly, |
| 75 // they need to be told that we are updating the screen. The problem is that | 76 // they need to be told that we are updating the screen. The problem is that |
| 76 // the native widgets need to recalculate their clip region and not overlap | 77 // the native widgets need to recalculate their clip region and not overlap |
| 77 // any of our non-native widgets. To force the resizing, call | 78 // any of our non-native widgets. To force the resizing, call |
| 78 // setFrameRect(). This will be a quick operation for most frames, but the | 79 // setFrameRect(). This will be a quick operation for most frames, but the |
| 79 // NativeWindowWidgets will update a proper clipping region. | 80 // NativeWindowWidgets will update a proper clipping region. |
| 80 view->setFrameRect(view->frameRect()); | 81 view->setFrameRect(view->frameRect()); |
| 81 | 82 |
| 82 // setFrameRect may have the side-effect of causing existing page layout to | 83 // setFrameRect may have the side-effect of causing existing page layout to |
| 83 // be invalidated, so layout needs to be called last. | 84 // be invalidated, so layout needs to be called last. |
| 84 view->updateLayoutAndStyleForPainting(); | 85 view->updateLayoutAndStyleForPainting(); |
| 85 } | 86 } |
| 86 | 87 |
| 87 } | 88 } |
| OLD | NEW |