Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 } | 87 } |
| 88 | 88 |
| 89 ScrollingCoordinator::ScrollingCoordinator(Page* page) | 89 ScrollingCoordinator::ScrollingCoordinator(Page* page) |
| 90 : m_page(page) | 90 : m_page(page) |
| 91 , m_scrollGestureRegionIsDirty(false) | 91 , m_scrollGestureRegionIsDirty(false) |
| 92 , m_touchEventTargetRectsAreDirty(false) | 92 , m_touchEventTargetRectsAreDirty(false) |
| 93 , m_shouldScrollOnMainThreadDirty(false) | 93 , m_shouldScrollOnMainThreadDirty(false) |
| 94 , m_wasFrameScrollable(false) | 94 , m_wasFrameScrollable(false) |
| 95 , m_lastMainThreadScrollingReasons(0) | 95 , m_lastMainThreadScrollingReasons(0) |
| 96 { | 96 { |
| 97 createProgrammaticScrollAnimatorTimeline(); | |
| 98 } | 97 } |
| 99 | 98 |
| 100 ScrollingCoordinator::~ScrollingCoordinator() | 99 ScrollingCoordinator::~ScrollingCoordinator() |
| 101 { | 100 { |
| 102 ASSERT(!m_page); | 101 ASSERT(!m_page); |
| 103 } | 102 } |
| 104 | 103 |
| 105 DEFINE_TRACE(ScrollingCoordinator) | 104 DEFINE_TRACE(ScrollingCoordinator) |
| 106 { | 105 { |
| 107 visitor->trace(m_page); | 106 visitor->trace(m_page); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 713 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh readScrollingReasons reasons) | 712 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh readScrollingReasons reasons) |
| 714 { | 713 { |
| 715 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram e()->view()) | 714 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram e()->view()) |
| 716 return; | 715 return; |
| 717 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v iew()->layerForScrolling())) { | 716 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v iew()->layerForScrolling())) { |
| 718 m_lastMainThreadScrollingReasons = reasons; | 717 m_lastMainThreadScrollingReasons = reasons; |
| 719 scrollLayer->setShouldScrollOnMainThread(reasons); | 718 scrollLayer->setShouldScrollOnMainThread(reasons); |
| 720 } | 719 } |
| 721 } | 720 } |
| 722 | 721 |
| 722 void ScrollingCoordinator::onSetMainFrame() | |
| 723 { | |
| 724 createProgrammaticScrollAnimatorTimeline(); | |
|
dcheng
2015/11/19 05:09:56
It feels like this should be tied to initializing
loyso (OOO)
2015/11/26 06:22:52
Done.
| |
| 725 } | |
| 726 | |
| 727 void ScrollingCoordinator::willSwapMainFrame() | |
| 728 { | |
| 729 destroyProgrammaticScrollAnimatorTimeline(); | |
| 730 } | |
| 731 | |
| 723 void ScrollingCoordinator::willCloseLayerTreeView() | 732 void ScrollingCoordinator::willCloseLayerTreeView() |
| 724 { | 733 { |
| 725 destroyProgrammaticScrollAnimatorTimeline(); | 734 destroyProgrammaticScrollAnimatorTimeline(); |
| 726 } | 735 } |
| 727 | 736 |
| 728 void ScrollingCoordinator::willBeDestroyed() | 737 void ScrollingCoordinator::willBeDestroyed() |
| 729 { | 738 { |
| 730 ASSERT(m_page); | 739 ASSERT(m_page); |
| 731 | 740 |
| 732 destroyProgrammaticScrollAnimatorTimeline(); | 741 destroyProgrammaticScrollAnimatorTimeline(); |
|
dcheng
2015/11/19 05:09:56
See previous comment: I'm a bit confused. Why is t
dcheng
2015/11/25 06:09:44
Ping? I'm still curious about an answer to this, s
loyso (OOO)
2015/11/26 06:22:52
We have many situations when we call Page::willBeD
| |
| 733 | 742 |
| 734 m_page = nullptr; | 743 m_page = nullptr; |
| 735 for (const auto& scrollbar : m_horizontalScrollbars) | 744 for (const auto& scrollbar : m_horizontalScrollbars) |
| 736 GraphicsLayer::unregisterContentsLayer(scrollbar.value->layer()); | 745 GraphicsLayer::unregisterContentsLayer(scrollbar.value->layer()); |
| 737 for (const auto& scrollbar : m_verticalScrollbars) | 746 for (const auto& scrollbar : m_verticalScrollbars) |
| 738 GraphicsLayer::unregisterContentsLayer(scrollbar.value->layer()); | 747 GraphicsLayer::unregisterContentsLayer(scrollbar.value->layer()); |
| 739 } | 748 } |
| 740 | 749 |
| 741 bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView ) const | 750 bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView ) const |
| 742 { | 751 { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1091 { | 1100 { |
| 1092 if (m_programmaticScrollAnimatorTimeline) { | 1101 if (m_programmaticScrollAnimatorTimeline) { |
| 1093 ASSERT(m_page); | 1102 ASSERT(m_page); |
| 1094 ASSERT(m_page->mainFrame()->isLocalFrame()); | 1103 ASSERT(m_page->mainFrame()->isLocalFrame()); |
| 1095 m_page->chromeClient().detachCompositorAnimationTimeline(m_programmaticS crollAnimatorTimeline.get(), toLocalFrame(m_page->mainFrame())); | 1104 m_page->chromeClient().detachCompositorAnimationTimeline(m_programmaticS crollAnimatorTimeline.get(), toLocalFrame(m_page->mainFrame())); |
| 1096 m_programmaticScrollAnimatorTimeline.clear(); | 1105 m_programmaticScrollAnimatorTimeline.clear(); |
| 1097 } | 1106 } |
| 1098 } | 1107 } |
| 1099 | 1108 |
| 1100 } // namespace blink | 1109 } // namespace blink |
| OLD | NEW |