Skip to content
Permalink
Browse files
Make generic ScrollAnimator
https://bugs.webkit.org/show_bug.cgi?id=192128

Reviewed by Michael Catanzaro.

No new tests. No change in behavior.

Moves ScrollAnimatorGtk into ScrollAnimatorGeneric where it can be used
by other implementations. Fixed some compilation issues around using
this as a default implementation.

Removing ScrollAnimatorSmooth since it is dead code and doesn't even
compile at this time.

Fixing a compilation issue within LowPowerModeNotifierGLib
implementation that appeared due to unified sources changes.

* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/LowPowerModeNotifier.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::swipeVelocity const):
* platform/ScrollAnimatorSmooth.cpp: Removed.
* platform/ScrollAnimatorSmooth.h: Removed.
* platform/generic/ScrollAnimatorGeneric.cpp: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp.
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric):
(WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation):
(WebCore::ScrollAnimatorGeneric::scroll):
(WebCore::ScrollAnimatorGeneric::scrollToOffsetWithoutAnimation):
(WebCore::ScrollAnimatorGeneric::computeVelocity):
(WebCore::ScrollAnimatorGeneric::handleWheelEvent):
(WebCore::ScrollAnimatorGeneric::willEndLiveResize):
(WebCore::ScrollAnimatorGeneric::updatePosition):
(WebCore::ScrollAnimatorGeneric::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorGeneric::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorGeneric::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorGeneric::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorGeneric::updateOverlayScrollbarsOpacity):
(WebCore::ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired):
(WebCore::ScrollAnimatorGeneric::showOverlayScrollbars):
(WebCore::ScrollAnimatorGeneric::hideOverlayScrollbars):
(WebCore::ScrollAnimatorGeneric::mouseEnteredContentArea):
(WebCore::ScrollAnimatorGeneric::mouseExitedContentArea):
(WebCore::ScrollAnimatorGeneric::mouseMovedInContentArea):
(WebCore::ScrollAnimatorGeneric::contentAreaDidShow):
(WebCore::ScrollAnimatorGeneric::contentAreaDidHide):
(WebCore::ScrollAnimatorGeneric::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorGeneric::lockOverlayScrollbarStateToHidden):
* platform/generic/ScrollAnimatorGeneric.h: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.h.
* platform/glib/LowPowerModeNotifierGLib.cpp:
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::swipeVelocity const): Deleted.


Canonical link: https://commits.webkit.org/206825@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
donny-dont committed Nov 29, 2018
1 parent 1200f99 commit caa1d45932f1180a54ee59edcc58c238ceb675f5
Showing 11 changed files with 104 additions and 226 deletions.
@@ -1,3 +1,59 @@
2018-11-29 Don Olmstead <don.olmstead@sony.com>

Make generic ScrollAnimator
https://bugs.webkit.org/show_bug.cgi?id=192128

Reviewed by Michael Catanzaro.

No new tests. No change in behavior.

Moves ScrollAnimatorGtk into ScrollAnimatorGeneric where it can be used
by other implementations. Fixed some compilation issues around using
this as a default implementation.

Removing ScrollAnimatorSmooth since it is dead code and doesn't even
compile at this time.

Fixing a compilation issue within LowPowerModeNotifierGLib
implementation that appeared due to unified sources changes.

* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/LowPowerModeNotifier.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::swipeVelocity const):
* platform/ScrollAnimatorSmooth.cpp: Removed.
* platform/ScrollAnimatorSmooth.h: Removed.
* platform/generic/ScrollAnimatorGeneric.cpp: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp.
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric):
(WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation):
(WebCore::ScrollAnimatorGeneric::scroll):
(WebCore::ScrollAnimatorGeneric::scrollToOffsetWithoutAnimation):
(WebCore::ScrollAnimatorGeneric::computeVelocity):
(WebCore::ScrollAnimatorGeneric::handleWheelEvent):
(WebCore::ScrollAnimatorGeneric::willEndLiveResize):
(WebCore::ScrollAnimatorGeneric::updatePosition):
(WebCore::ScrollAnimatorGeneric::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorGeneric::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorGeneric::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorGeneric::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorGeneric::updateOverlayScrollbarsOpacity):
(WebCore::ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired):
(WebCore::ScrollAnimatorGeneric::showOverlayScrollbars):
(WebCore::ScrollAnimatorGeneric::hideOverlayScrollbars):
(WebCore::ScrollAnimatorGeneric::mouseEnteredContentArea):
(WebCore::ScrollAnimatorGeneric::mouseExitedContentArea):
(WebCore::ScrollAnimatorGeneric::mouseMovedInContentArea):
(WebCore::ScrollAnimatorGeneric::contentAreaDidShow):
(WebCore::ScrollAnimatorGeneric::contentAreaDidHide):
(WebCore::ScrollAnimatorGeneric::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorGeneric::lockOverlayScrollbarStateToHidden):
* platform/generic/ScrollAnimatorGeneric.h: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.h.
* platform/glib/LowPowerModeNotifierGLib.cpp:
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::swipeVelocity const): Deleted.

2018-11-28 Dean Jackson <dino@apple.com>

[ES Modules] Allow .mjs content when loaded from file://
@@ -20,6 +20,7 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/accessibility/atk"
"${WEBCORE_DIR}/editing/atk"
"${WEBCORE_DIR}/page/gtk"
"${WEBCORE_DIR}/platform/generic"
"${WEBCORE_DIR}/platform/geoclue"
"${WEBCORE_DIR}/platform/gtk"
"${WEBCORE_DIR}/platform/graphics/egl"
@@ -59,6 +59,8 @@ platform/ScrollAnimationKinetic.cpp
platform/ScrollAnimationSmooth.cpp
platform/UserAgentQuirks.cpp

platform/generic/ScrollAnimatorGeneric.cpp

platform/geoclue/GeolocationProviderGeoclue.cpp

platform/graphics/GLContext.cpp @no-unify
@@ -89,7 +91,6 @@ platform/graphics/x11/XUniqueResource.cpp @no-unify
platform/gtk/DragDataGtk.cpp
platform/gtk/LocalizedStringsGtk.cpp
platform/gtk/PasteboardGtk.cpp
platform/gtk/ScrollAnimatorGtk.cpp
platform/gtk/SelectionData.cpp

platform/text/Hyphenation.cpp
@@ -34,7 +34,7 @@ OBJC_CLASS WebLowPowerModeObserver;

#if USE(GLIB)
#include <wtf/glib/GRefPtr.h>
typedef _GDBusProxy GDBusProxy;
typedef struct _GDBusProxy GDBusProxy;
#endif

namespace WebCore {
@@ -126,7 +126,6 @@ class PlatformWheelEvent : public PlatformEvent {

#if PLATFORM(GTK)
explicit PlatformWheelEvent(GdkEventScroll*);
FloatPoint swipeVelocity() const;
#endif

#if PLATFORM(COCOA)
@@ -151,6 +150,7 @@ class PlatformWheelEvent : public PlatformEvent {
PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }
bool isEndOfNonMomentumScroll() const;
bool isTransitioningToMomentumScroll() const;
FloatPoint swipeVelocity() const;
#endif

#if PLATFORM(WIN)
@@ -209,10 +209,6 @@ inline bool PlatformWheelEvent::isEndOfMomentumScroll() const
return m_phase == PlatformWheelEventPhaseNone && m_momentumPhase == PlatformWheelEventPhaseEnded;
}

#endif

#if PLATFORM(COCOA) || PLATFORM(GTK)

inline bool PlatformWheelEvent::isEndOfNonMomentumScroll() const
{
return m_phase == PlatformWheelEventPhaseEnded && m_momentumPhase == PlatformWheelEventPhaseNone;
@@ -222,6 +218,13 @@ inline bool PlatformWheelEvent::isTransitioningToMomentumScroll() const
{
return m_phase == PlatformWheelEventPhaseNone && m_momentumPhase == PlatformWheelEventPhaseBegan;
}
#endif

inline FloatPoint PlatformWheelEvent::swipeVelocity() const
{
// The swiping velocity is stored in the deltas of the event declaring it.
return isTransitioningToMomentumScroll() ? FloatPoint(m_wheelTicksX, m_wheelTicksY) : FloatPoint();
}

#endif // ENABLE(ASYNC_SCROLLING)

} // namespace WebCore

This file was deleted.

This file was deleted.

0 comments on commit caa1d45

Please sign in to comment.