Changeset 238675 in webkit
- Timestamp:
- Nov 29, 2018 10:36:29 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 2 deleted
- 7 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r238673 r238675 1 2018-11-29 Don Olmstead <don.olmstead@sony.com> 2 3 Make generic ScrollAnimator 4 https://bugs.webkit.org/show_bug.cgi?id=192128 5 6 Reviewed by Michael Catanzaro. 7 8 No new tests. No change in behavior. 9 10 Moves ScrollAnimatorGtk into ScrollAnimatorGeneric where it can be used 11 by other implementations. Fixed some compilation issues around using 12 this as a default implementation. 13 14 Removing ScrollAnimatorSmooth since it is dead code and doesn't even 15 compile at this time. 16 17 Fixing a compilation issue within LowPowerModeNotifierGLib 18 implementation that appeared due to unified sources changes. 19 20 * PlatformGTK.cmake: 21 * SourcesGTK.txt: 22 * platform/LowPowerModeNotifier.h: 23 * platform/PlatformWheelEvent.h: 24 (WebCore::PlatformWheelEvent::swipeVelocity const): 25 * platform/ScrollAnimatorSmooth.cpp: Removed. 26 * platform/ScrollAnimatorSmooth.h: Removed. 27 * platform/generic/ScrollAnimatorGeneric.cpp: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp. 28 (WebCore::ScrollAnimator::create): 29 (WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric): 30 (WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation): 31 (WebCore::ScrollAnimatorGeneric::scroll): 32 (WebCore::ScrollAnimatorGeneric::scrollToOffsetWithoutAnimation): 33 (WebCore::ScrollAnimatorGeneric::computeVelocity): 34 (WebCore::ScrollAnimatorGeneric::handleWheelEvent): 35 (WebCore::ScrollAnimatorGeneric::willEndLiveResize): 36 (WebCore::ScrollAnimatorGeneric::updatePosition): 37 (WebCore::ScrollAnimatorGeneric::didAddVerticalScrollbar): 38 (WebCore::ScrollAnimatorGeneric::didAddHorizontalScrollbar): 39 (WebCore::ScrollAnimatorGeneric::willRemoveVerticalScrollbar): 40 (WebCore::ScrollAnimatorGeneric::willRemoveHorizontalScrollbar): 41 (WebCore::ScrollAnimatorGeneric::updateOverlayScrollbarsOpacity): 42 (WebCore::ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired): 43 (WebCore::ScrollAnimatorGeneric::showOverlayScrollbars): 44 (WebCore::ScrollAnimatorGeneric::hideOverlayScrollbars): 45 (WebCore::ScrollAnimatorGeneric::mouseEnteredContentArea): 46 (WebCore::ScrollAnimatorGeneric::mouseExitedContentArea): 47 (WebCore::ScrollAnimatorGeneric::mouseMovedInContentArea): 48 (WebCore::ScrollAnimatorGeneric::contentAreaDidShow): 49 (WebCore::ScrollAnimatorGeneric::contentAreaDidHide): 50 (WebCore::ScrollAnimatorGeneric::notifyContentAreaScrolled): 51 (WebCore::ScrollAnimatorGeneric::lockOverlayScrollbarStateToHidden): 52 * platform/generic/ScrollAnimatorGeneric.h: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.h. 53 * platform/glib/LowPowerModeNotifierGLib.cpp: 54 * platform/gtk/PlatformWheelEventGtk.cpp: 55 (WebCore::PlatformWheelEvent::swipeVelocity const): Deleted. 56 1 57 2018-11-28 Dean Jackson <dino@apple.com> 2 58 -
trunk/Source/WebCore/PlatformGTK.cmake
r237566 r238675 21 21 "${WEBCORE_DIR}/editing/atk" 22 22 "${WEBCORE_DIR}/page/gtk" 23 "${WEBCORE_DIR}/platform/generic" 23 24 "${WEBCORE_DIR}/platform/geoclue" 24 25 "${WEBCORE_DIR}/platform/gtk" -
trunk/Source/WebCore/SourcesGTK.txt
r235521 r238675 60 60 platform/UserAgentQuirks.cpp 61 61 62 platform/generic/ScrollAnimatorGeneric.cpp 63 62 64 platform/geoclue/GeolocationProviderGeoclue.cpp 63 65 … … 90 92 platform/gtk/LocalizedStringsGtk.cpp 91 93 platform/gtk/PasteboardGtk.cpp 92 platform/gtk/ScrollAnimatorGtk.cpp93 94 platform/gtk/SelectionData.cpp 94 95 -
trunk/Source/WebCore/platform/LowPowerModeNotifier.h
r237266 r238675 35 35 #if USE(GLIB) 36 36 #include <wtf/glib/GRefPtr.h> 37 typedef _GDBusProxy GDBusProxy;37 typedef struct _GDBusProxy GDBusProxy; 38 38 #endif 39 39 -
trunk/Source/WebCore/platform/PlatformWheelEvent.h
r232590 r238675 127 127 #if PLATFORM(GTK) 128 128 explicit PlatformWheelEvent(GdkEventScroll*); 129 FloatPoint swipeVelocity() const;130 129 #endif 131 130 … … 152 151 bool isEndOfNonMomentumScroll() const; 153 152 bool isTransitioningToMomentumScroll() const; 153 FloatPoint swipeVelocity() const; 154 154 #endif 155 155 … … 210 210 } 211 211 212 #endif213 214 #if PLATFORM(COCOA) || PLATFORM(GTK)215 216 212 inline bool PlatformWheelEvent::isEndOfNonMomentumScroll() const 217 213 { … … 223 219 return m_phase == PlatformWheelEventPhaseNone && m_momentumPhase == PlatformWheelEventPhaseBegan; 224 220 } 225 #endif 221 222 inline FloatPoint PlatformWheelEvent::swipeVelocity() const 223 { 224 // The swiping velocity is stored in the deltas of the event declaring it. 225 return isTransitioningToMomentumScroll() ? FloatPoint(m_wheelTicksX, m_wheelTicksY) : FloatPoint(); 226 } 227 228 #endif // ENABLE(ASYNC_SCROLLING) 226 229 227 230 } // namespace WebCore -
trunk/Source/WebCore/platform/generic/ScrollAnimatorGeneric.cpp
r238674 r238675 30 30 31 31 #include "config.h" 32 #include "ScrollAnimatorG tk.h"32 #include "ScrollAnimatorGeneric.h" 33 33 34 34 #include "ScrollAnimationKinetic.h" … … 45 45 std::unique_ptr<ScrollAnimator> ScrollAnimator::create(ScrollableArea& scrollableArea) 46 46 { 47 return std::make_unique<ScrollAnimatorG tk>(scrollableArea);48 } 49 50 ScrollAnimatorG tk::ScrollAnimatorGtk(ScrollableArea& scrollableArea)47 return std::make_unique<ScrollAnimatorGeneric>(scrollableArea); 48 } 49 50 ScrollAnimatorGeneric::ScrollAnimatorGeneric(ScrollableArea& scrollableArea) 51 51 : ScrollAnimator(scrollableArea) 52 , m_overlayScrollbarAnimationTimer(*this, &ScrollAnimatorG tk::overlayScrollbarAnimationTimerFired)52 , m_overlayScrollbarAnimationTimer(*this, &ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired) 53 53 { 54 54 m_kineticAnimation = std::make_unique<ScrollAnimationKinetic>(m_scrollableArea, [this](FloatPoint&& position) { … … 66 66 } 67 67 68 ScrollAnimatorG tk::~ScrollAnimatorGtk() = default;69 70 #if ENABLE(SMOOTH_SCROLLING) 71 void ScrollAnimatorG tk::ensureSmoothScrollingAnimation()68 ScrollAnimatorGeneric::~ScrollAnimatorGeneric() = default; 69 70 #if ENABLE(SMOOTH_SCROLLING) 71 void ScrollAnimatorGeneric::ensureSmoothScrollingAnimation() 72 72 { 73 73 if (m_smoothAnimation) … … 81 81 82 82 #if ENABLE(SMOOTH_SCROLLING) 83 bool ScrollAnimatorG tk::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier)83 bool ScrollAnimatorGeneric::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier) 84 84 { 85 85 if (!m_scrollableArea.scrollAnimatorEnabled()) … … 91 91 #endif 92 92 93 void ScrollAnimatorG tk::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping)93 void ScrollAnimatorGeneric::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping) 94 94 { 95 95 FloatPoint position = ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin())); … … 105 105 } 106 106 107 FloatPoint ScrollAnimatorG tk::computeVelocity()107 FloatPoint ScrollAnimatorGeneric::computeVelocity() 108 108 { 109 109 if (m_scrollHistory.isEmpty()) … … 125 125 } 126 126 127 bool ScrollAnimatorG tk::handleWheelEvent(const PlatformWheelEvent& event)127 bool ScrollAnimatorGeneric::handleWheelEvent(const PlatformWheelEvent& event) 128 128 { 129 129 m_kineticAnimation->stop(); … … 133 133 }); 134 134 135 #if ENABLE(ASYNC_SCROLLING) 135 136 if (event.isEndOfNonMomentumScroll()) { 136 137 // We don't need to add the event to the history as its delta will be (0, 0). … … 143 144 return true; 144 145 } 146 #endif 145 147 146 148 m_scrollHistory.append(event); … … 149 151 } 150 152 151 void ScrollAnimatorG tk::willEndLiveResize()153 void ScrollAnimatorGeneric::willEndLiveResize() 152 154 { 153 155 m_kineticAnimation->updateVisibleLengths(); … … 159 161 } 160 162 161 void ScrollAnimatorG tk::updatePosition(FloatPoint&& position)163 void ScrollAnimatorGeneric::updatePosition(FloatPoint&& position) 162 164 { 163 165 FloatSize delta = position - m_currentPosition; … … 166 168 } 167 169 168 void ScrollAnimatorG tk::didAddVerticalScrollbar(Scrollbar* scrollbar)170 void ScrollAnimatorGeneric::didAddVerticalScrollbar(Scrollbar* scrollbar) 169 171 { 170 172 m_kineticAnimation->updateVisibleLengths(); … … 183 185 } 184 186 185 void ScrollAnimatorG tk::didAddHorizontalScrollbar(Scrollbar* scrollbar)187 void ScrollAnimatorGeneric::didAddHorizontalScrollbar(Scrollbar* scrollbar) 186 188 { 187 189 m_kineticAnimation->updateVisibleLengths(); … … 200 202 } 201 203 202 void ScrollAnimatorG tk::willRemoveVerticalScrollbar(Scrollbar* scrollbar)204 void ScrollAnimatorGeneric::willRemoveVerticalScrollbar(Scrollbar* scrollbar) 203 205 { 204 206 if (m_verticalOverlayScrollbar != scrollbar) … … 209 211 } 210 212 211 void ScrollAnimatorG tk::willRemoveHorizontalScrollbar(Scrollbar* scrollbar)213 void ScrollAnimatorGeneric::willRemoveHorizontalScrollbar(Scrollbar* scrollbar) 212 214 { 213 215 if (m_horizontalOverlayScrollbar != scrollbar) … … 218 220 } 219 221 220 void ScrollAnimatorG tk::updateOverlayScrollbarsOpacity()222 void ScrollAnimatorGeneric::updateOverlayScrollbarsOpacity() 221 223 { 222 224 if (m_verticalOverlayScrollbar && m_overlayScrollbarAnimationCurrent != m_verticalOverlayScrollbar->opacity()) { … … 239 241 } 240 242 241 void ScrollAnimatorG tk::overlayScrollbarAnimationTimerFired()243 void ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired() 242 244 { 243 245 if (!m_horizontalOverlayScrollbar && !m_verticalOverlayScrollbar) … … 266 268 } 267 269 268 void ScrollAnimatorG tk::showOverlayScrollbars()270 void ScrollAnimatorGeneric::showOverlayScrollbars() 269 271 { 270 272 if (m_overlayScrollbarsLocked) … … 288 290 } 289 291 290 void ScrollAnimatorG tk::hideOverlayScrollbars()292 void ScrollAnimatorGeneric::hideOverlayScrollbars() 291 293 { 292 294 if (m_overlayScrollbarAnimationTimer.isActive() && !m_overlayScrollbarAnimationTarget) … … 306 308 } 307 309 308 void ScrollAnimatorG tk::mouseEnteredContentArea()310 void ScrollAnimatorGeneric::mouseEnteredContentArea() 309 311 { 310 312 showOverlayScrollbars(); 311 313 } 312 314 313 void ScrollAnimatorG tk::mouseExitedContentArea()315 void ScrollAnimatorGeneric::mouseExitedContentArea() 314 316 { 315 317 hideOverlayScrollbars(); 316 318 } 317 319 318 void ScrollAnimatorG tk::mouseMovedInContentArea()320 void ScrollAnimatorGeneric::mouseMovedInContentArea() 319 321 { 320 322 showOverlayScrollbars(); 321 323 } 322 324 323 void ScrollAnimatorG tk::contentAreaDidShow()325 void ScrollAnimatorGeneric::contentAreaDidShow() 324 326 { 325 327 showOverlayScrollbars(); 326 328 } 327 329 328 void ScrollAnimatorG tk::contentAreaDidHide()330 void ScrollAnimatorGeneric::contentAreaDidHide() 329 331 { 330 332 if (m_overlayScrollbarsLocked) … … 337 339 } 338 340 339 void ScrollAnimatorG tk::notifyContentAreaScrolled(const FloatSize&)341 void ScrollAnimatorGeneric::notifyContentAreaScrolled(const FloatSize&) 340 342 { 341 343 showOverlayScrollbars(); 342 344 } 343 345 344 void ScrollAnimatorG tk::lockOverlayScrollbarStateToHidden(bool shouldLockState)346 void ScrollAnimatorGeneric::lockOverlayScrollbarStateToHidden(bool shouldLockState) 345 347 { 346 348 if (m_overlayScrollbarsLocked == shouldLockState) -
trunk/Source/WebCore/platform/generic/ScrollAnimatorGeneric.h
r238674 r238675 29 29 */ 30 30 31 #ifndef ScrollAnimatorGtk_h 32 #define ScrollAnimatorGtk_h 31 #pragma once 33 32 34 33 #include "ScrollAnimator.h" … … 39 38 class ScrollAnimation; 40 39 41 class ScrollAnimatorG tkfinal : public ScrollAnimator {40 class ScrollAnimatorGeneric final : public ScrollAnimator { 42 41 public: 43 explicit ScrollAnimatorG tk(ScrollableArea&);44 virtual ~ScrollAnimatorG tk();42 explicit ScrollAnimatorGeneric(ScrollableArea&); 43 virtual ~ScrollAnimatorGeneric(); 45 44 46 45 private: … … 94 93 95 94 } // namespace WebCore 96 97 #endif // ScrollAnimatorGtk_h -
trunk/Source/WebCore/platform/glib/LowPowerModeNotifierGLib.cpp
r228888 r238675 23 23 #include <cstring> 24 24 #include <gio/gio.h> 25 #include <wtf/glib/GUniquePtr.h> 25 26 26 27 namespace WebCore { -
trunk/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp
r235560 r238675 112 112 } 113 113 114 FloatPoint PlatformWheelEvent::swipeVelocity() const 115 { 116 // The swiping velocity is stored in the deltas of the event declaring it. 117 return isTransitioningToMomentumScroll() ? FloatPoint(m_wheelTicksX, m_wheelTicksY) : FloatPoint(); 118 } 119 120 } 114 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.