From 3e82ac05b113eee4a08510600dd02c7c695f0b88 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 15 May 2020 11:04:41 +0000 Subject: Issue #80- De-unify gfx/layers Excludes layers/ipc/CompositorBridgeParent and CrossProcessCompositorBridgeParent because the latter purposely uses functions implemented in the former. See also code comment in CrossProcessCompositorBridgeParent.cpp Note: likely dead code for us anyway; likely not worth investing in to solve. --- gfx/layers/apz/src/APZCTreeManager.cpp | 15 +++++++++++++++ gfx/layers/apz/src/AsyncPanZoomController.cpp | 11 ++++++++++- gfx/layers/apz/src/GestureEventListener.cpp | 1 + gfx/layers/apz/src/InputBlockState.h | 1 + gfx/layers/apz/util/ContentProcessController.h | 1 + 5 files changed, 28 insertions(+), 1 deletion(-) (limited to 'gfx/layers/apz') diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index f54326360..00eb3f183 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -85,6 +85,21 @@ struct APZCTreeManager::TreeBuildingState { std::map mApzcMap; }; +// Returns whether or not a wheel event action will be (or was) performed by +// APZ. If this returns true, the event must not perform a synchronous +// scroll. +// +// Even if this returns false, all wheel events in APZ-aware widgets must +// be sent through APZ so they are transformed correctly for TabParent. +static bool +WillHandleWheelEvent(WidgetWheelEvent* aEvent) +{ + return EventStateManager::WheelEventIsScrollAction(aEvent) && + (aEvent->mDeltaMode == nsIDOMWheelEvent::DOM_DELTA_LINE || + aEvent->mDeltaMode == nsIDOMWheelEvent::DOM_DELTA_PIXEL || + aEvent->mDeltaMode == nsIDOMWheelEvent::DOM_DELTA_PAGE); +} + class APZCTreeManager::CheckerboardFlushObserver : public nsIObserver { public: NS_DECL_ISUPPORTS diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 3d4112395..d9ad3ae78 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -33,6 +33,7 @@ #include "mozilla/ClearOnShutdown.h" // for ClearOnShutdown #include "mozilla/ComputedTimingFunction.h" // for ComputedTimingFunction #include "mozilla/EventForwards.h" // for nsEventStatus_* +#include "mozilla/EventStateManager.h" #include "mozilla/MouseEvents.h" // for WidgetWheelEvent #include "mozilla/Preferences.h" // for Preferences #include "mozilla/ReentrantMonitor.h" // for ReentrantMonitorAutoEnter, etc @@ -44,6 +45,7 @@ #include "mozilla/dom/Touch.h" // for Touch #include "mozilla/gfx/BasePoint.h" // for BasePoint #include "mozilla/gfx/BaseRect.h" // for BaseRect +#include "mozilla/gfx/Coord.h" #include "mozilla/gfx/Point.h" // for Point, RoundedToInt, etc #include "mozilla/gfx/Rect.h" // for RoundedIn #include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor @@ -102,7 +104,12 @@ typedef GeckoContentController::APZStateChange APZStateChange; typedef GeckoContentController::TapType TapType; typedef mozilla::gfx::Point Point; typedef mozilla::gfx::Matrix4x4 Matrix4x4; +using mozilla::gfx::CoordTyped; +using mozilla::gfx::IntCoordTyped; +using mozilla::gfx::IntRectTyped; using mozilla::gfx::PointTyped; +using mozilla::gfx::RectTyped; +using mozilla::gfx::ScaleFactors2D; // Choose between platform-specific implementations. #ifdef MOZ_WIDGET_ANDROID @@ -833,7 +840,9 @@ AsyncPanZoomController::ArePointerEventsConsumable(TouchBlockState* aBlock, uint } template -static CoordTyped GetAxisStart(AsyncDragMetrics::DragDirection aDir, const PointTyped& aValue) { +static CoordTyped GetAxisStart( +AsyncDragMetrics::DragDirection aDir, +const PointTyped& aValue) { if (aDir == AsyncDragMetrics::HORIZONTAL) { return aValue.x; } else { diff --git a/gfx/layers/apz/src/GestureEventListener.cpp b/gfx/layers/apz/src/GestureEventListener.cpp index 7fd07f3ff..0bacc8778 100644 --- a/gfx/layers/apz/src/GestureEventListener.cpp +++ b/gfx/layers/apz/src/GestureEventListener.cpp @@ -13,6 +13,7 @@ #include "mozilla/SizePrintfMacros.h" // for PRIuSIZE #include "nsDebug.h" // for NS_WARNING #include "nsMathUtils.h" // for NS_hypot +#include "InputBlockState.h" // for TouchBlockState #define GEL_LOG(...) // #define GEL_LOG(...) printf_stderr("GEL: " __VA_ARGS__) diff --git a/gfx/layers/apz/src/InputBlockState.h b/gfx/layers/apz/src/InputBlockState.h index 86fb0d03f..528609947 100644 --- a/gfx/layers/apz/src/InputBlockState.h +++ b/gfx/layers/apz/src/InputBlockState.h @@ -16,6 +16,7 @@ #include "mozilla/TimeStamp.h" // for TimeStamp #include "nsTArray.h" // for nsTArray #include "TouchCounter.h" +#include "OverscrollHandoffState.h" namespace mozilla { namespace layers { diff --git a/gfx/layers/apz/util/ContentProcessController.h b/gfx/layers/apz/util/ContentProcessController.h index 07d113c9e..bb1a86d3f 100644 --- a/gfx/layers/apz/util/ContentProcessController.h +++ b/gfx/layers/apz/util/ContentProcessController.h @@ -8,6 +8,7 @@ #define mozilla_layers_ContentProcessController_h #include "mozilla/layers/GeckoContentController.h" +#include "mozilla/dom/ipc/IdType.h" class nsIObserver; -- cgit v1.2.3