Issue #80 - Re-unify most of gfx

This commit is contained in:
Moonchild 2022-09-08 16:50:40 +00:00 committed by roytam1
commit f801bd1847
9 changed files with 65 additions and 57 deletions

View file

@ -9,21 +9,11 @@
#include "InputData.h" // for InputData, etc
#include "mozilla/EventStateManager.h" // for WheelPrefs
#include "mozilla/layers/APZThreadUtils.h" // for AssertOnCompositorThread, etc
#include "mozilla/MouseEvents.h" // for WidgetMouseEvent
#include "mozilla/TouchEvents.h" // for WidgetTouchEvent
namespace mozilla {
namespace layers {
static bool
WillHandleMouseEvent(const WidgetMouseEventBase& aEvent)
{
return aEvent.mMessage == eMouseMove ||
aEvent.mMessage == eMouseDown ||
aEvent.mMessage == eMouseUp ||
aEvent.mMessage == eDragEnd;
}
// 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.

View file

@ -11,6 +11,7 @@
#include "FrameMetrics.h" // for FrameMetrics, etc
#include "mozilla/EventForwards.h" // for WidgetInputEvent, nsEventStatus
#include "mozilla/layers/APZUtils.h" // for HitTestResult
#include "mozilla/MouseEvents.h" // for WidgetMouseEvent
#include "nsTArrayForwardDeclare.h" // for nsTArray, nsTArray_Impl, etc
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
#include "Units.h" // for CSSPoint, CSSRect, etc
@ -38,6 +39,15 @@ enum ZoomToRectBehavior : uint32_t {
class AsyncDragMetrics;
static bool
WillHandleMouseEvent(const WidgetMouseEventBase& aEvent)
{
return aEvent.mMessage == eMouseMove ||
aEvent.mMessage == eMouseDown ||
aEvent.mMessage == eMouseUp ||
aEvent.mMessage == eDragEnd;
}
class IAPZCTreeManager {
NS_INLINE_DECL_THREADSAFE_VIRTUAL_REFCOUNTING(IAPZCTreeManager)

View file

@ -85,21 +85,6 @@ struct APZCTreeManager::TreeBuildingState {
std::map<ScrollableLayerGuid, AsyncPanZoomController*> 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