mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1213601 - Implement kinetic/inertial scrolling (fling) for Gtk touchpads. r=botond,karlt
--HG-- extra : rebase_source : c89a97e40aa59e1038530becdb53c2d7b992db7b
This commit is contained in:
parent
d8aca5bfb7
commit
e6dc1a7382
@ -1821,8 +1821,8 @@ nsEventStatus AsyncPanZoomController::OnScaleEnd(
|
||||
}
|
||||
|
||||
nsEventStatus AsyncPanZoomController::HandleEndOfPan() {
|
||||
MOZ_ASSERT(GetCurrentTouchBlock());
|
||||
GetCurrentTouchBlock()->GetOverscrollHandoffChain()->FlushRepaints();
|
||||
MOZ_ASSERT(GetCurrentTouchBlock() || GetCurrentPanGestureBlock());
|
||||
GetCurrentInputBlock()->GetOverscrollHandoffChain()->FlushRepaints();
|
||||
ParentLayerPoint flingVelocity = GetVelocityVector();
|
||||
|
||||
// Clear our velocities; if DispatchFling() gives the fling to us,
|
||||
@ -1844,7 +1844,7 @@ nsEventStatus AsyncPanZoomController::HandleEndOfPan() {
|
||||
if (flingVelocity.Length() < gfxPrefs::APZFlingMinVelocityThreshold()) {
|
||||
// Relieve overscroll now if needed, since we will not transition to a fling
|
||||
// animation and then an overscroll animation, and relieve it then.
|
||||
GetCurrentTouchBlock()
|
||||
GetCurrentInputBlock()
|
||||
->GetOverscrollHandoffChain()
|
||||
->SnapBackOverscrolledApzc(this);
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
@ -1855,8 +1855,8 @@ nsEventStatus AsyncPanZoomController::HandleEndOfPan() {
|
||||
// which nulls out mTreeManager, could be called concurrently.
|
||||
if (APZCTreeManager* treeManagerLocal = GetApzcTreeManager()) {
|
||||
const FlingHandoffState handoffState{
|
||||
flingVelocity, GetCurrentTouchBlock()->GetOverscrollHandoffChain(),
|
||||
false /* not handoff */, GetCurrentTouchBlock()->GetScrolledApzc()};
|
||||
flingVelocity, GetCurrentInputBlock()->GetOverscrollHandoffChain(),
|
||||
false /* not handoff */, GetCurrentInputBlock()->GetScrolledApzc()};
|
||||
treeManagerLocal->DispatchFling(this, handoffState);
|
||||
}
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
@ -2555,6 +2555,35 @@ nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent,
|
||||
ScreenPoint physicalPanDisplacement = aEvent.mPanDisplacement;
|
||||
ParentLayerPoint logicalPanDisplacement =
|
||||
aEvent.UserMultipliedLocalPanDisplacement();
|
||||
if (aEvent.mDeltaType == PanGestureInput::PANDELTA_PAGE) {
|
||||
// Pan events with page units are used by Gtk, so this replicates Gtk:
|
||||
// https://gitlab.gnome.org/GNOME/gtk/blob/c734c7e9188b56f56c3a504abee05fa40c5475ac/gtk/gtkrange.c#L3065-3073
|
||||
CSSSize pageScrollSize;
|
||||
CSSToParentLayerScale2D zoom;
|
||||
{
|
||||
// Grab the lock to access the frame metrics.
|
||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
||||
pageScrollSize = mScrollMetadata.GetPageScrollAmount() /
|
||||
Metrics().GetDevPixelsPerCSSPixel();
|
||||
zoom = Metrics().GetZoom();
|
||||
}
|
||||
// scrollUnit* is in units of "ParentLayer pixels per page proportion"...
|
||||
auto scrollUnitWidth = std::min(std::pow(pageScrollSize.width, 2.0 / 3.0),
|
||||
pageScrollSize.width / 2.0) *
|
||||
zoom.xScale;
|
||||
auto scrollUnitHeight = std::min(std::pow(pageScrollSize.height, 2.0 / 3.0),
|
||||
pageScrollSize.height / 2.0) *
|
||||
zoom.yScale;
|
||||
// ... and pan displacements are in units of "page proportion count"
|
||||
// here, so the products of them and scrollUnit* are in ParentLayer pixels
|
||||
ParentLayerPoint physicalPanDisplacementPL(
|
||||
physicalPanDisplacement.x * scrollUnitWidth,
|
||||
physicalPanDisplacement.y * scrollUnitHeight);
|
||||
physicalPanDisplacement = ToScreenCoordinates(physicalPanDisplacementPL,
|
||||
aEvent.mLocalPanStartPoint);
|
||||
logicalPanDisplacement.x *= scrollUnitWidth;
|
||||
logicalPanDisplacement.y *= scrollUnitHeight;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(GetCurrentPanGestureBlock());
|
||||
AdjustDeltaForAllowedScrollDirections(
|
||||
@ -2571,9 +2600,9 @@ nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent,
|
||||
// aEvent.mLocalStartPoint) would mess up velocity calculation. (This is
|
||||
// the only caller of UpdateWithTouchAtDevicePoint() for pan events, so
|
||||
// there is no risk of other calls resetting the position.)
|
||||
mX.UpdateWithTouchAtDevicePoint(mX.GetPos() + logicalPanDisplacement.x,
|
||||
mX.UpdateWithTouchAtDevicePoint(mX.GetPos() - logicalPanDisplacement.x,
|
||||
aEvent.mTime);
|
||||
mY.UpdateWithTouchAtDevicePoint(mY.GetPos() + logicalPanDisplacement.y,
|
||||
mY.UpdateWithTouchAtDevicePoint(mY.GetPos() - logicalPanDisplacement.y,
|
||||
aEvent.mTime);
|
||||
|
||||
HandlePanningUpdate(physicalPanDisplacement);
|
||||
@ -2608,6 +2637,12 @@ nsEventStatus AsyncPanZoomController::OnPanEnd(const PanGestureInput& aEvent) {
|
||||
mX.EndTouch(aEvent.mTime);
|
||||
mY.EndTouch(aEvent.mTime);
|
||||
|
||||
// Use HandleEndOfPan for fling on platforms that don't
|
||||
// emit momentum events (Gtk).
|
||||
if (aEvent.mSimulateMomentum) {
|
||||
return HandleEndOfPan();
|
||||
}
|
||||
|
||||
// Drop any velocity on axes where we don't have room to scroll anyways
|
||||
// (in this APZC, or an APZC further in the handoff chain).
|
||||
// This ensures that we don't enlarge the display port unnecessarily.
|
||||
|
@ -160,25 +160,6 @@ struct ParamTraits<mozilla::layers::CompositableHandle> {
|
||||
}
|
||||
};
|
||||
|
||||
// Helper class for reading bitfields.
|
||||
// If T has bitfields members, derive ParamTraits<T> from BitfieldHelper<T>.
|
||||
template <typename ParamType>
|
||||
struct BitfieldHelper {
|
||||
// We need this helper because we can't get the address of a bitfield to
|
||||
// pass directly to ReadParam. So instead we read it into a temporary bool
|
||||
// and set the bitfield using a setter function
|
||||
static bool ReadBoolForBitfield(const Message* aMsg, PickleIterator* aIter,
|
||||
ParamType* aResult,
|
||||
void (ParamType::*aSetter)(bool)) {
|
||||
bool value;
|
||||
if (ReadParam(aMsg, aIter, &value)) {
|
||||
(aResult->*aSetter)(value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::FrameMetrics>
|
||||
: BitfieldHelper<mozilla::layers::FrameMetrics> {
|
||||
|
@ -1088,6 +1088,25 @@ struct ParamTraits<nsILoadInfo::CrossOriginPolicy>
|
||||
: EnumSerializer<nsILoadInfo::CrossOriginPolicy,
|
||||
CrossOriginPolicyValidator> {};
|
||||
|
||||
// Helper class for reading bitfields.
|
||||
// If T has bitfields members, derive ParamTraits<T> from BitfieldHelper<T>.
|
||||
template <typename ParamType>
|
||||
struct BitfieldHelper {
|
||||
// We need this helper because we can't get the address of a bitfield to
|
||||
// pass directly to ReadParam. So instead we read it into a temporary bool
|
||||
// and set the bitfield using a setter function
|
||||
static bool ReadBoolForBitfield(const Message* aMsg, PickleIterator* aIter,
|
||||
ParamType* aResult,
|
||||
void (ParamType::*aSetter)(bool)) {
|
||||
bool value;
|
||||
if (ReadParam(aMsg, aIter, &value)) {
|
||||
(aResult->*aSetter)(value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
} /* namespace IPC */
|
||||
|
||||
#endif /* __IPC_GLUE_IPCMESSAGEUTILS_H__ */
|
||||
|
@ -477,7 +477,6 @@ WidgetWheelEvent PanGestureInput::ToWidgetWheelEvent(nsIWidget* aWidget) const {
|
||||
mPanStartPoint,
|
||||
PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent));
|
||||
wheelEvent.mButtons = 0;
|
||||
wheelEvent.mDeltaMode = WheelEvent_Binding::DOM_DELTA_PIXEL;
|
||||
wheelEvent.mMayHaveMomentum = true; // pan inputs may have momentum
|
||||
wheelEvent.mIsMomentum = IsMomentum();
|
||||
wheelEvent.mLineOrPageDeltaX = mLineOrPageDeltaX;
|
||||
@ -486,6 +485,16 @@ WidgetWheelEvent PanGestureInput::ToWidgetWheelEvent(nsIWidget* aWidget) const {
|
||||
wheelEvent.mDeltaY = mPanDisplacement.y;
|
||||
wheelEvent.mFlags.mHandledByAPZ = mHandledByAPZ;
|
||||
wheelEvent.mFocusSequenceNumber = mFocusSequenceNumber;
|
||||
if (mDeltaType == PanGestureInput::PANDELTA_PAGE) {
|
||||
// Emulate legacy widget/gtk behavior
|
||||
wheelEvent.mDeltaMode = WheelEvent_Binding::DOM_DELTA_LINE;
|
||||
wheelEvent.mIsNoLineOrPageDelta = true;
|
||||
wheelEvent.mScrollType = WidgetWheelEvent::SCROLL_ASYNCHRONOUSELY;
|
||||
wheelEvent.mDeltaX *= 3;
|
||||
wheelEvent.mDeltaY *= 3;
|
||||
} else {
|
||||
wheelEvent.mDeltaMode = WheelEvent_Binding::DOM_DELTA_PIXEL;
|
||||
}
|
||||
return wheelEvent;
|
||||
}
|
||||
|
||||
@ -498,6 +507,14 @@ bool PanGestureInput::TransformToLocal(
|
||||
}
|
||||
mLocalPanStartPoint = *panStartPoint;
|
||||
|
||||
if (mDeltaType == PanGestureInput::PANDELTA_PAGE) {
|
||||
// Skip transforming the pan displacement because we want
|
||||
// raw page proportion counts.
|
||||
mLocalPanDisplacement.x = mPanDisplacement.x;
|
||||
mLocalPanDisplacement.y = mPanDisplacement.y;
|
||||
return true;
|
||||
}
|
||||
|
||||
Maybe<ParentLayerPoint> panDisplacement =
|
||||
UntransformVector(aTransform, mPanDisplacement, mPanStartPoint);
|
||||
if (!panDisplacement) {
|
||||
|
@ -332,6 +332,17 @@ class PanGestureInput : public InputData {
|
||||
// user has stopped the animation by putting their fingers on a touchpad.
|
||||
PANGESTURE_MOMENTUMEND
|
||||
));
|
||||
|
||||
MOZ_DEFINE_ENUM_AT_CLASS_SCOPE(
|
||||
PanDeltaType, (
|
||||
// There are three kinds of scroll delta modes in Gecko: "page", "line"
|
||||
// and "pixel". Touchpad pan gestures only support "page" and "pixel".
|
||||
//
|
||||
// NOTE: PANDELTA_PAGE currently replicates Gtk behavior
|
||||
// (see AsyncPanZoomController::OnPan).
|
||||
PANDELTA_PAGE,
|
||||
PANDELTA_PIXEL
|
||||
));
|
||||
// clang-format on
|
||||
|
||||
PanGestureInput(PanGestureType aType, uint32_t aTime, TimeStamp aTimeStamp,
|
||||
@ -368,11 +379,13 @@ class PanGestureInput : public InputData {
|
||||
double mUserDeltaMultiplierX;
|
||||
double mUserDeltaMultiplierY;
|
||||
|
||||
bool mHandledByAPZ;
|
||||
PanDeltaType mDeltaType = PANDELTA_PIXEL;
|
||||
|
||||
bool mHandledByAPZ : 1;
|
||||
|
||||
// true if this is a PANGESTURE_END event that will be followed by a
|
||||
// PANGESTURE_MOMENTUMSTART event.
|
||||
bool mFollowedByMomentum;
|
||||
bool mFollowedByMomentum : 1;
|
||||
|
||||
// If this is true, and this event started a new input block that couldn't
|
||||
// find a scrollable target which is scrollable in the horizontal component
|
||||
@ -380,15 +393,32 @@ class PanGestureInput : public InputData {
|
||||
// hold until a content response has arrived, even if the block has a
|
||||
// confirmed target.
|
||||
// This is used by events that can result in a swipe instead of a scroll.
|
||||
bool mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection;
|
||||
bool mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection : 1;
|
||||
|
||||
// This is used by APZ to communicate to the macOS widget code whether
|
||||
// the overscroll-behavior of the scroll frame handling this swipe allows
|
||||
// non-local overscroll behaviors in the horizontal direction (such as
|
||||
// swipe navigation).
|
||||
bool mOverscrollBehaviorAllowsSwipe;
|
||||
bool mOverscrollBehaviorAllowsSwipe : 1;
|
||||
|
||||
// XXX: If adding any more bools, switch to using bitfields instead.
|
||||
// true if APZ should do a fling animation after this pan ends, like
|
||||
// it would with touchscreens. (For platforms that don't emit momentum
|
||||
// events.)
|
||||
bool mSimulateMomentum : 1;
|
||||
|
||||
void SetHandledByAPZ(bool aHandled) { mHandledByAPZ = aHandled; }
|
||||
void SetFollowedByMomentum(bool aFollowed) {
|
||||
mFollowedByMomentum = aFollowed;
|
||||
}
|
||||
void SetRequiresContentResponseIfCannotScrollHorizontallyInStartDirection(
|
||||
bool aRequires) {
|
||||
mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection =
|
||||
aRequires;
|
||||
}
|
||||
void SetOverscrollBehaviorAllowsSwipe(bool aAllows) {
|
||||
mOverscrollBehaviorAllowsSwipe = aAllows;
|
||||
}
|
||||
void SetSimulateMomentum(bool aSimulate) { mSimulateMomentum = aSimulate; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -119,6 +119,9 @@ using namespace mozilla::widget;
|
||||
#include "mozilla/layers/CompositorThread.h"
|
||||
#include "mozilla/layers/KnowsCompositor.h"
|
||||
|
||||
#include "mozilla/layers/APZInputBridge.h"
|
||||
#include "mozilla/layers/IAPZCTreeManager.h"
|
||||
|
||||
#ifdef MOZ_X11
|
||||
# include "GLContextGLX.h" // for GLContextGLX::FindVisual()
|
||||
# include "GtkCompositorWidget.h"
|
||||
@ -3000,6 +3003,7 @@ void nsWindow::OnScrollEvent(GdkEventScroll* aEvent) {
|
||||
if (aEvent->direction != GDK_SCROLL_SMOOTH &&
|
||||
mLastScrollEventTime == aEvent->time)
|
||||
return;
|
||||
mLastScrollEventTime = aEvent->time;
|
||||
#endif
|
||||
WidgetWheelEvent wheelEvent(true, eWheel, this);
|
||||
wheelEvent.mDeltaMode = dom::WheelEvent_Binding::DOM_DELTA_LINE;
|
||||
@ -3007,21 +3011,52 @@ void nsWindow::OnScrollEvent(GdkEventScroll* aEvent) {
|
||||
#if GTK_CHECK_VERSION(3, 4, 0)
|
||||
case GDK_SCROLL_SMOOTH: {
|
||||
// As of GTK 3.4, all directional scroll events are provided by
|
||||
// the GDK_SCROLL_SMOOTH direction on XInput2 devices.
|
||||
mLastScrollEventTime = aEvent->time;
|
||||
// the GDK_SCROLL_SMOOTH direction on XInput2 and Wayland devices.
|
||||
|
||||
// Special handling for touchpads to support flings
|
||||
// (also known as kinetic/inertial/momentum scrolling)
|
||||
GdkDevice* device = gdk_event_get_source_device((GdkEvent*)aEvent);
|
||||
GdkInputSource source = gdk_device_get_source(device);
|
||||
if (source == GDK_SOURCE_TOUCHSCREEN || source == GDK_SOURCE_TOUCHPAD) {
|
||||
if (gtk_check_version(3, 20, 0) == nullptr) {
|
||||
static auto sGdkEventIsScrollStopEvent =
|
||||
(gboolean(*)(const GdkEvent*))dlsym(
|
||||
RTLD_DEFAULT, "gdk_event_is_scroll_stop_event");
|
||||
|
||||
PanGestureInput::PanGestureType eventType =
|
||||
PanGestureInput::PANGESTURE_PAN;
|
||||
if (sGdkEventIsScrollStopEvent((GdkEvent*)aEvent)) {
|
||||
eventType = PanGestureInput::PANGESTURE_END;
|
||||
mPanInProgress = false;
|
||||
} else if (!mPanInProgress) {
|
||||
eventType = PanGestureInput::PANGESTURE_START;
|
||||
mPanInProgress = true;
|
||||
}
|
||||
|
||||
LayoutDeviceIntPoint touchPoint = GetRefPoint(this, aEvent);
|
||||
PanGestureInput panEvent(
|
||||
eventType, aEvent->time, GetEventTimeStamp(aEvent->time),
|
||||
ScreenPoint(touchPoint.x, touchPoint.y),
|
||||
ScreenPoint(aEvent->delta_x, aEvent->delta_y),
|
||||
KeymapWrapper::ComputeKeyModifiers(aEvent->state));
|
||||
panEvent.mDeltaType = PanGestureInput::PANDELTA_PAGE;
|
||||
panEvent.mSimulateMomentum = true;
|
||||
|
||||
DispatchPanGestureInput(panEvent);
|
||||
|
||||
return;
|
||||
}
|
||||
// Older GTK doesn't support stop events, so we can't support fling
|
||||
// there
|
||||
wheelEvent.mScrollType = WidgetWheelEvent::SCROLL_ASYNCHRONOUSELY;
|
||||
}
|
||||
|
||||
// TODO - use a more appropriate scrolling unit than lines.
|
||||
// Multiply event deltas by 3 to emulate legacy behaviour.
|
||||
wheelEvent.mDeltaX = aEvent->delta_x * 3;
|
||||
wheelEvent.mDeltaY = aEvent->delta_y * 3;
|
||||
wheelEvent.mIsNoLineOrPageDelta = true;
|
||||
// This next step manually unsets smooth scrolling for touch devices
|
||||
// that trigger GDK_SCROLL_SMOOTH. We use the slave device, which
|
||||
// represents the actual input.
|
||||
GdkDevice* device = gdk_event_get_source_device((GdkEvent*)aEvent);
|
||||
GdkInputSource source = gdk_device_get_source(device);
|
||||
if (source == GDK_SOURCE_TOUCHSCREEN || source == GDK_SOURCE_TOUCHPAD) {
|
||||
wheelEvent.mScrollType = WidgetWheelEvent::SCROLL_ASYNCHRONOUSELY;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
@ -4242,7 +4277,8 @@ LayoutDeviceIntSize nsWindow::GetSafeWindowSize(LayoutDeviceIntSize aSize) {
|
||||
LayoutDeviceIntSize result = aSize;
|
||||
int32_t maxSize = 32767;
|
||||
if (mLayerManager && mLayerManager->AsKnowsCompositor()) {
|
||||
maxSize = std::min(maxSize, mLayerManager->AsKnowsCompositor()->GetMaxTextureSize());
|
||||
maxSize = std::min(maxSize,
|
||||
mLayerManager->AsKnowsCompositor()->GetMaxTextureSize());
|
||||
}
|
||||
if (result.width > maxSize) {
|
||||
result.width = maxSize;
|
||||
|
@ -491,6 +491,8 @@ class nsWindow final : public nsBaseWidget {
|
||||
// This field omits duplicate scroll events caused by GNOME bug 726878.
|
||||
guint32 mLastScrollEventTime;
|
||||
|
||||
bool mPanInProgress = false;
|
||||
|
||||
// for touch event handling
|
||||
nsRefPtrHashtable<nsPtrHashKey<GdkEventSequence>, mozilla::dom::Touch>
|
||||
mTouches;
|
||||
|
@ -1096,6 +1096,29 @@ void nsBaseWidget::DispatchTouchInput(MultiTouchInput& aInput) {
|
||||
}
|
||||
}
|
||||
|
||||
void nsBaseWidget::DispatchPanGestureInput(PanGestureInput& aInput) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (mAPZC) {
|
||||
MOZ_ASSERT(APZThreadUtils::IsControllerThread());
|
||||
uint64_t inputBlockId = 0;
|
||||
ScrollableLayerGuid guid;
|
||||
|
||||
nsEventStatus result =
|
||||
mAPZC->InputBridge()->ReceiveInputEvent(aInput, &guid, &inputBlockId);
|
||||
if (result == nsEventStatus_eConsumeNoDefault) {
|
||||
return;
|
||||
}
|
||||
|
||||
WidgetWheelEvent event = aInput.ToWidgetWheelEvent(this);
|
||||
ProcessUntransformedAPZEvent(&event, guid, inputBlockId, result);
|
||||
} else {
|
||||
WidgetWheelEvent event = aInput.ToWidgetWheelEvent(this);
|
||||
|
||||
nsEventStatus status;
|
||||
DispatchEvent(&event, status);
|
||||
}
|
||||
}
|
||||
|
||||
nsEventStatus nsBaseWidget::DispatchInputEvent(WidgetInputEvent* aEvent) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (mAPZC) {
|
||||
|
@ -618,6 +618,14 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
|
||||
*/
|
||||
void DispatchTouchInput(mozilla::MultiTouchInput& aInput);
|
||||
|
||||
/**
|
||||
* Dispatch the given PanGestureInput through APZ to Gecko (if APZ is enabled)
|
||||
* or directly to gecko (if APZ is not enabled). This function must only
|
||||
* be called from the main thread, and if APZ is enabled, that must also be
|
||||
* the APZ controller thread.
|
||||
*/
|
||||
void DispatchPanGestureInput(mozilla::PanGestureInput& aInput);
|
||||
|
||||
#if defined(XP_WIN)
|
||||
void UpdateScrollCapture() override;
|
||||
|
||||
|
@ -1211,7 +1211,15 @@ struct ParamTraits<mozilla::PanGestureInput::PanGestureType>
|
||||
mozilla::PanGestureInput::sHighestPanGestureType> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::PanGestureInput> {
|
||||
struct ParamTraits<mozilla::PanGestureInput::PanDeltaType>
|
||||
: public ContiguousEnumSerializerInclusive<
|
||||
mozilla::PanGestureInput::PanDeltaType,
|
||||
mozilla::PanGestureInput::PanDeltaType::PANDELTA_PAGE,
|
||||
mozilla::PanGestureInput::sHighestPanDeltaType> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::PanGestureInput>
|
||||
: BitfieldHelper<mozilla::PanGestureInput> {
|
||||
typedef mozilla::PanGestureInput paramType;
|
||||
|
||||
static void Write(Message* aMsg, const paramType& aParam) {
|
||||
@ -1225,6 +1233,7 @@ struct ParamTraits<mozilla::PanGestureInput> {
|
||||
WriteParam(aMsg, aParam.mLineOrPageDeltaY);
|
||||
WriteParam(aMsg, aParam.mUserDeltaMultiplierX);
|
||||
WriteParam(aMsg, aParam.mUserDeltaMultiplierY);
|
||||
WriteParam(aMsg, aParam.mDeltaType);
|
||||
WriteParam(aMsg, aParam.mHandledByAPZ);
|
||||
WriteParam(aMsg, aParam.mFollowedByMomentum);
|
||||
WriteParam(
|
||||
@ -1232,6 +1241,7 @@ struct ParamTraits<mozilla::PanGestureInput> {
|
||||
aParam
|
||||
.mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection);
|
||||
WriteParam(aMsg, aParam.mOverscrollBehaviorAllowsSwipe);
|
||||
WriteParam(aMsg, aParam.mSimulateMomentum);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
||||
@ -1246,13 +1256,19 @@ struct ParamTraits<mozilla::PanGestureInput> {
|
||||
ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaY) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierX) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierY) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mHandledByAPZ) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mFollowedByMomentum) &&
|
||||
ReadParam(
|
||||
aMsg, aIter,
|
||||
&aResult
|
||||
->mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mOverscrollBehaviorAllowsSwipe);
|
||||
ReadParam(aMsg, aIter, &aResult->mDeltaType) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult,
|
||||
¶mType::SetHandledByAPZ) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult,
|
||||
¶mType::SetFollowedByMomentum) &&
|
||||
ReadBoolForBitfield(
|
||||
aMsg, aIter, aResult,
|
||||
¶mType::
|
||||
SetRequiresContentResponseIfCannotScrollHorizontallyInStartDirection) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult,
|
||||
¶mType::SetOverscrollBehaviorAllowsSwipe) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult,
|
||||
¶mType::SetSimulateMomentum);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user