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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor
m::current()->isThreadedAnimationEnabled()) { | 97 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor
m::current()->isThreadedAnimationEnabled()) { |
98 ASSERT(m_page); | 98 ASSERT(m_page); |
99 ASSERT(m_page->mainFrame()->isLocalFrame()); | 99 if (m_page->mainFrame()->isLocalFrame()) { |
100 ASSERT(Platform::current()->compositorSupport()); | 100 ASSERT(Platform::current()->compositorSupport()); |
101 m_programmaticScrollAnimatorTimeline = adoptPtr(Platform::current()->com
positorSupport()->createAnimationTimeline()); | 101 m_programmaticScrollAnimatorTimeline = adoptPtr(Platform::current()-
>compositorSupport()->createAnimationTimeline()); |
102 m_page->chromeClient().attachCompositorAnimationTimeline(m_programmaticS
crollAnimatorTimeline.get(), toLocalFrame(m_page->mainFrame())); | 102 m_page->chromeClient().attachCompositorAnimationTimeline(m_programma
ticScrollAnimatorTimeline.get(), toLocalFrame(m_page->mainFrame())); |
| 103 } |
103 } | 104 } |
104 } | 105 } |
105 | 106 |
106 ScrollingCoordinator::~ScrollingCoordinator() | 107 ScrollingCoordinator::~ScrollingCoordinator() |
107 { | 108 { |
108 ASSERT(!m_page); | 109 ASSERT(!m_page); |
109 } | 110 } |
110 | 111 |
111 DEFINE_TRACE(ScrollingCoordinator) | 112 DEFINE_TRACE(ScrollingCoordinator) |
112 { | 113 { |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 bool frameIsScrollable = frameView && frameView->isScrollable(); | 1084 bool frameIsScrollable = frameView && frameView->isScrollable(); |
1084 if (frameIsScrollable != m_wasFrameScrollable) | 1085 if (frameIsScrollable != m_wasFrameScrollable) |
1085 return true; | 1086 return true; |
1086 | 1087 |
1087 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) | 1088 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) |
1088 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); | 1089 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); |
1089 return false; | 1090 return false; |
1090 } | 1091 } |
1091 | 1092 |
1092 } // namespace blink | 1093 } // namespace blink |
OLD | NEW |