mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1083395 - Move to a single input queue owned by the APZCTM instead of many queues owned by APZC instances. r=botond
This commit is contained in:
parent
47a070d91c
commit
d9a2995ade
@ -72,7 +72,8 @@ APZCTreeManager::CalculatePendingDisplayPort(
|
||||
}
|
||||
|
||||
APZCTreeManager::APZCTreeManager()
|
||||
: mTreeLock("APZCTreeLock"),
|
||||
: mInputQueue(new InputQueue()),
|
||||
mTreeLock("APZCTreeLock"),
|
||||
mInOverscrolledApzc(false),
|
||||
mRetainedTouchIdentifier(-1),
|
||||
mTouchCount(0),
|
||||
@ -110,14 +111,10 @@ APZCTreeManager::GetAllowedTouchBehavior(WidgetInputEvent* aEvent,
|
||||
}
|
||||
|
||||
void
|
||||
APZCTreeManager::SetAllowedTouchBehavior(const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
APZCTreeManager::SetAllowedTouchBehavior(uint64_t aInputBlockId,
|
||||
const nsTArray<TouchBehaviorFlags> &aValues)
|
||||
{
|
||||
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aGuid);
|
||||
if (apzc) {
|
||||
apzc->SetAllowedTouchBehavior(aInputBlockId, aValues);
|
||||
}
|
||||
mInputQueue->SetAllowedTouchBehavior(aInputBlockId, aValues);
|
||||
}
|
||||
|
||||
/* Flatten the tree of APZC instances into the given nsTArray */
|
||||
@ -302,7 +299,7 @@ APZCTreeManager::PrepareAPZCForLayer(const LayerMetricsWrapper& aLayer,
|
||||
// a new one.
|
||||
bool newApzc = (apzc == nullptr || apzc->IsDestroyed());
|
||||
if (newApzc) {
|
||||
apzc = new AsyncPanZoomController(aLayersId, this, state->mController,
|
||||
apzc = new AsyncPanZoomController(aLayersId, this, mInputQueue, state->mController,
|
||||
AsyncPanZoomController::USE_GESTURE_DETECTOR);
|
||||
apzc->SetCompositorParent(aState.mCompositor);
|
||||
if (state->mCrossProcessParent != nullptr) {
|
||||
@ -546,7 +543,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
|
||||
PanGestureInput inputForApzc(panInput);
|
||||
transformToApzc = GetScreenToApzcTransform(apzc);
|
||||
ApplyTransform(&(inputForApzc.mPanStartPoint), transformToApzc);
|
||||
result = apzc->ReceiveInputEvent(inputForApzc, aOutInputBlockId);
|
||||
result = mInputQueue->ReceiveInputEvent(apzc, inputForApzc, aOutInputBlockId);
|
||||
|
||||
// Update the out-parameters so they are what the caller expects.
|
||||
apzc->GetGuid(aOutTargetGuid);
|
||||
@ -564,7 +561,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
|
||||
PinchGestureInput inputForApzc(pinchInput);
|
||||
transformToApzc = GetScreenToApzcTransform(apzc);
|
||||
ApplyTransform(&(inputForApzc.mFocusPoint), transformToApzc);
|
||||
result = apzc->ReceiveInputEvent(inputForApzc, aOutInputBlockId);
|
||||
result = mInputQueue->ReceiveInputEvent(apzc, inputForApzc, aOutInputBlockId);
|
||||
|
||||
// Update the out-parameters so they are what the caller expects.
|
||||
apzc->GetGuid(aOutTargetGuid);
|
||||
@ -582,7 +579,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
|
||||
TapGestureInput inputForApzc(tapInput);
|
||||
transformToApzc = GetScreenToApzcTransform(apzc);
|
||||
ApplyTransform(&(inputForApzc.mPoint), transformToApzc);
|
||||
result = apzc->ReceiveInputEvent(inputForApzc, aOutInputBlockId);
|
||||
result = mInputQueue->ReceiveInputEvent(apzc, inputForApzc, aOutInputBlockId);
|
||||
|
||||
// Update the out-parameters so they are what the caller expects.
|
||||
apzc->GetGuid(aOutTargetGuid);
|
||||
@ -662,7 +659,7 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
|
||||
// in the middle of a panning touch block (for example) and not clean up properly.
|
||||
if (mApzcForInputBlock) {
|
||||
MultiTouchInput cancel(MultiTouchInput::MULTITOUCH_CANCEL, 0, TimeStamp::Now(), 0);
|
||||
mApzcForInputBlock->ReceiveInputEvent(cancel, nullptr);
|
||||
mInputQueue->ReceiveInputEvent(mApzcForInputBlock, cancel, nullptr);
|
||||
}
|
||||
mApzcForInputBlock = apzc;
|
||||
}
|
||||
@ -711,7 +708,7 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
|
||||
for (size_t i = 0; i < inputForApzc.mTouches.Length(); i++) {
|
||||
ApplyTransform(&(inputForApzc.mTouches[i].mScreenPoint), transformToApzc);
|
||||
}
|
||||
result = mApzcForInputBlock->ReceiveInputEvent(inputForApzc, aOutInputBlockId);
|
||||
result = mInputQueue->ReceiveInputEvent(mApzcForInputBlock, inputForApzc, aOutInputBlockId);
|
||||
|
||||
// For computing the event to pass back to Gecko, use the up-to-date transforms.
|
||||
// This ensures that transformToApzc and transformToGecko are in sync
|
||||
@ -840,14 +837,10 @@ APZCTreeManager::ZoomToRect(const ScrollableLayerGuid& aGuid,
|
||||
}
|
||||
|
||||
void
|
||||
APZCTreeManager::ContentReceivedTouch(const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
APZCTreeManager::ContentReceivedTouch(uint64_t aInputBlockId,
|
||||
bool aPreventDefault)
|
||||
{
|
||||
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aGuid);
|
||||
if (apzc) {
|
||||
apzc->ContentReceivedTouch(aInputBlockId, aPreventDefault);
|
||||
}
|
||||
mInputQueue->ContentReceivedTouch(aInputBlockId, aPreventDefault);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -46,6 +46,7 @@ class APZPaintLogHelper;
|
||||
class OverscrollHandoffChain;
|
||||
struct OverscrollHandoffState;
|
||||
class LayerMetricsWrapper;
|
||||
class InputQueue;
|
||||
|
||||
/**
|
||||
* ****************** NOTE ON LOCK ORDERING IN APZ **************************
|
||||
@ -207,8 +208,7 @@ public:
|
||||
* that have come in. If |aPreventDefault| is true, any touch events in the
|
||||
* queue will be discarded.
|
||||
*/
|
||||
void ContentReceivedTouch(const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
void ContentReceivedTouch(uint64_t aInputBlockId,
|
||||
bool aPreventDefault);
|
||||
|
||||
/**
|
||||
@ -269,14 +269,13 @@ public:
|
||||
|
||||
/**
|
||||
* Sets allowed touch behavior values for current touch-session for specific
|
||||
* apzc and input block (determined by aGuid and aInputBlock).
|
||||
* input block (determined by aInputBlock).
|
||||
* Should be invoked by the widget. Each value of the aValues arrays
|
||||
* corresponds to the different touch point that is currently active.
|
||||
* Must be called after receiving the TOUCH_START event that starts the
|
||||
* touch-session.
|
||||
*/
|
||||
void SetAllowedTouchBehavior(const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
void SetAllowedTouchBehavior(uint64_t aInputBlockId,
|
||||
const nsTArray<TouchBehaviorFlags>& aValues);
|
||||
|
||||
/**
|
||||
@ -360,6 +359,7 @@ public:
|
||||
* Build the chain of APZCs that will handle overscroll for a pan starting at |aInitialTarget|.
|
||||
*/
|
||||
nsRefPtr<const OverscrollHandoffChain> BuildOverscrollHandoffChain(const nsRefPtr<AsyncPanZoomController>& aInitialTarget);
|
||||
|
||||
protected:
|
||||
// Protected destructor, to discourage deletion outside of Release():
|
||||
virtual ~APZCTreeManager();
|
||||
@ -425,6 +425,13 @@ private:
|
||||
|
||||
void PrintAPZCInfo(const LayerMetricsWrapper& aLayer,
|
||||
const AsyncPanZoomController* apzc);
|
||||
|
||||
protected:
|
||||
/* The input queue where input events are held until we know enough to
|
||||
* figure out where they're going. Protected so gtests can access it.
|
||||
*/
|
||||
nsRefPtr<InputQueue> mInputQueue;
|
||||
|
||||
private:
|
||||
/* Whenever walking or mutating the tree rooted at mRootApzc, mTreeLock must be held.
|
||||
* This lock does not need to be held while manipulating a single APZC instance in
|
||||
|
@ -867,6 +867,7 @@ AsyncPanZoomController::InitializeGlobalState()
|
||||
|
||||
AsyncPanZoomController::AsyncPanZoomController(uint64_t aLayersId,
|
||||
APZCTreeManager* aTreeManager,
|
||||
const nsRefPtr<InputQueue>& aInputQueue,
|
||||
GeckoContentController* aGeckoContentController,
|
||||
GestureBehavior aGestures)
|
||||
: mLayersId(aLayersId),
|
||||
@ -886,7 +887,7 @@ AsyncPanZoomController::AsyncPanZoomController(uint64_t aLayersId,
|
||||
mAsyncScrollTimeoutTask(nullptr),
|
||||
mState(NOTHING),
|
||||
mNotificationBlockers(0),
|
||||
mInputQueue(new InputQueue()),
|
||||
mInputQueue(aInputQueue),
|
||||
mTreeManager(aTreeManager),
|
||||
mAPZCId(sAsyncPanZoomControllerCount++),
|
||||
mSharedLock(nullptr),
|
||||
@ -927,10 +928,8 @@ AsyncPanZoomController::GetGestureEventListener() const {
|
||||
return listener.forget();
|
||||
}
|
||||
|
||||
nsRefPtr<InputQueue>
|
||||
const nsRefPtr<InputQueue>&
|
||||
AsyncPanZoomController::GetInputQueue() const {
|
||||
MonitorAutoLock lock(mRefPtrMonitor);
|
||||
MOZ_ASSERT(mInputQueue);
|
||||
return mInputQueue;
|
||||
}
|
||||
|
||||
@ -945,7 +944,6 @@ AsyncPanZoomController::Destroy()
|
||||
MonitorAutoLock lock(mRefPtrMonitor);
|
||||
mGeckoContentController = nullptr;
|
||||
mGestureEventListener = nullptr;
|
||||
mInputQueue = nullptr; // XXX this is temporary and will be removed in a future patch
|
||||
}
|
||||
mPrevSibling = nullptr;
|
||||
mLastChild = nullptr;
|
||||
|
@ -96,6 +96,7 @@ public:
|
||||
|
||||
AsyncPanZoomController(uint64_t aLayersId,
|
||||
APZCTreeManager* aTreeManager,
|
||||
const nsRefPtr<InputQueue>& aInputQueue,
|
||||
GeckoContentController* aController,
|
||||
GestureBehavior aGestures = DEFAULT_GESTURES);
|
||||
|
||||
@ -630,7 +631,7 @@ protected:
|
||||
/* Utility functions that return a addrefed pointer to the corresponding fields. */
|
||||
already_AddRefed<GeckoContentController> GetGeckoContentController() const;
|
||||
already_AddRefed<GestureEventListener> GetGestureEventListener() const;
|
||||
nsRefPtr<InputQueue> GetInputQueue() const;
|
||||
const nsRefPtr<InputQueue>& GetInputQueue() const;
|
||||
|
||||
// If we are sharing our frame metrics with content across processes
|
||||
bool mSharingFrameMetricsAcrossProcesses;
|
||||
|
@ -39,7 +39,7 @@ InputQueue::ReceiveInputEvent(const nsRefPtr<AsyncPanZoomController>& aTarget, c
|
||||
TouchBlockState* block = nullptr;
|
||||
if (aEvent.AsMultiTouchInput().mType == MultiTouchInput::MULTITOUCH_START) {
|
||||
block = StartNewTouchBlock(aTarget, false);
|
||||
INPQ_LOG("%p started new touch block %p for target %p\n", this, block, aTarget.get());
|
||||
INPQ_LOG("started new touch block %p for target %p\n", block, aTarget.get());
|
||||
|
||||
// We want to cancel animations here as soon as possible (i.e. without waiting for
|
||||
// content responses) because a finger has gone down and we don't want to keep moving
|
||||
@ -64,7 +64,7 @@ InputQueue::ReceiveInputEvent(const nsRefPtr<AsyncPanZoomController>& aTarget, c
|
||||
// Content won't prevent-default this, so we can just pretend like we scheduled
|
||||
// a timeout and it expired. Note that we will still receive a ContentReceivedTouch
|
||||
// callback for this block, and so we need to make sure we adjust the touch balance.
|
||||
INPQ_LOG("%p not waiting for content response on block %p\n", this, block);
|
||||
INPQ_LOG("not waiting for content response on block %p\n", block);
|
||||
block->TimeoutContentResponse();
|
||||
}
|
||||
} else if (mTouchBlockQueue.IsEmpty()) {
|
||||
@ -72,7 +72,7 @@ InputQueue::ReceiveInputEvent(const nsRefPtr<AsyncPanZoomController>& aTarget, c
|
||||
} else {
|
||||
// this touch is part of the most-recently created block
|
||||
block = mTouchBlockQueue.LastElement().get();
|
||||
INPQ_LOG("%p received new event in block %p\n", this, block);
|
||||
INPQ_LOG("received new event in block %p\n", block);
|
||||
}
|
||||
|
||||
if (!block) {
|
||||
@ -87,8 +87,8 @@ InputQueue::ReceiveInputEvent(const nsRefPtr<AsyncPanZoomController>& aTarget, c
|
||||
: nsEventStatus_eIgnore;
|
||||
|
||||
if (block == CurrentTouchBlock() && block->IsReadyForHandling()) {
|
||||
INPQ_LOG("%p's current touch block is ready with preventdefault %d\n",
|
||||
this, block->IsDefaultPrevented());
|
||||
INPQ_LOG("current touch block is ready with preventdefault %d\n",
|
||||
block->IsDefaultPrevented());
|
||||
if (block->IsDefaultPrevented()) {
|
||||
return result;
|
||||
}
|
||||
@ -123,7 +123,7 @@ InputQueue::StartNewTouchBlock(const nsRefPtr<AsyncPanZoomController>& aTarget,
|
||||
// See corresponding comment in ProcessPendingInputBlocks.
|
||||
while (!mTouchBlockQueue.IsEmpty()) {
|
||||
if (mTouchBlockQueue[0]->IsReadyForHandling() && !mTouchBlockQueue[0]->HasEvents()) {
|
||||
INPQ_LOG("%p discarding depleted touch block %p\n", this, mTouchBlockQueue[0].get());
|
||||
INPQ_LOG("discarding depleted touch block %p\n", mTouchBlockQueue[0].get());
|
||||
mTouchBlockQueue.RemoveElementAt(0);
|
||||
} else {
|
||||
break;
|
||||
@ -152,7 +152,7 @@ InputQueue::HasReadyTouchBlock() const
|
||||
|
||||
void
|
||||
InputQueue::ScheduleContentResponseTimeout(const nsRefPtr<AsyncPanZoomController>& aTarget, uint64_t aInputBlockId) {
|
||||
INPQ_LOG("%p scheduling content response timeout for target %p\n", this, aTarget.get());
|
||||
INPQ_LOG("scheduling content response timeout for target %p\n", aTarget.get());
|
||||
aTarget->PostDelayedTask(
|
||||
NewRunnableMethod(this, &InputQueue::ContentResponseTimeout, aInputBlockId),
|
||||
gfxPrefs::APZContentResponseTimeout());
|
||||
@ -162,7 +162,7 @@ void
|
||||
InputQueue::ContentResponseTimeout(const uint64_t& aInputBlockId) {
|
||||
AsyncPanZoomController::AssertOnControllerThread();
|
||||
|
||||
INPQ_LOG("%p got a content response timeout; block=%llu\n", this, aInputBlockId);
|
||||
INPQ_LOG("got a content response timeout; block=%llu\n", aInputBlockId);
|
||||
bool success = false;
|
||||
for (size_t i = 0; i < mTouchBlockQueue.Length(); i++) {
|
||||
if (mTouchBlockQueue[i]->GetBlockId() == aInputBlockId) {
|
||||
@ -179,7 +179,7 @@ void
|
||||
InputQueue::ContentReceivedTouch(uint64_t aInputBlockId, bool aPreventDefault) {
|
||||
AsyncPanZoomController::AssertOnControllerThread();
|
||||
|
||||
INPQ_LOG("%p got a content response; block=%llu\n", this, aInputBlockId);
|
||||
INPQ_LOG("got a content response; block=%llu\n", aInputBlockId);
|
||||
bool success = false;
|
||||
for (size_t i = 0; i < mTouchBlockQueue.Length(); i++) {
|
||||
if (mTouchBlockQueue[i]->GetBlockId() == aInputBlockId) {
|
||||
@ -196,7 +196,7 @@ void
|
||||
InputQueue::SetAllowedTouchBehavior(uint64_t aInputBlockId, const nsTArray<TouchBehaviorFlags>& aBehaviors) {
|
||||
AsyncPanZoomController::AssertOnControllerThread();
|
||||
|
||||
INPQ_LOG("%p got allowed touch behaviours; block=%llu\n", this, aInputBlockId);
|
||||
INPQ_LOG("got allowed touch behaviours; block=%llu\n", aInputBlockId);
|
||||
bool success = false;
|
||||
for (size_t i = 0; i < mTouchBlockQueue.Length(); i++) {
|
||||
if (mTouchBlockQueue[i]->GetBlockId() == aInputBlockId) {
|
||||
@ -221,8 +221,8 @@ InputQueue::ProcessPendingInputBlocks() {
|
||||
break;
|
||||
}
|
||||
|
||||
INPQ_LOG("%p processing input block %p; preventDefault %d target %p\n",
|
||||
this, curBlock, curBlock->IsDefaultPrevented(),
|
||||
INPQ_LOG("processing input block %p; preventDefault %d target %p\n",
|
||||
curBlock, curBlock->IsDefaultPrevented(),
|
||||
curBlock->GetTargetApzc().get());
|
||||
nsRefPtr<AsyncPanZoomController> target = curBlock->GetTargetApzc();
|
||||
if (curBlock->IsDefaultPrevented()) {
|
||||
@ -245,7 +245,7 @@ InputQueue::ProcessPendingInputBlocks() {
|
||||
|
||||
// If we get here, we know there are more touch blocks in the queue after
|
||||
// |curBlock|, so we can remove |curBlock| and try to process the next one.
|
||||
INPQ_LOG("%p discarding depleted touch block %p\n", this, curBlock);
|
||||
INPQ_LOG("discarding depleted touch block %p\n", curBlock);
|
||||
mTouchBlockQueue.RemoveElementAt(0);
|
||||
}
|
||||
}
|
||||
|
@ -119,12 +119,19 @@ private:
|
||||
nsTArray<Task*> mTaskQueue;
|
||||
};
|
||||
|
||||
class TestAPZCTreeManager : public APZCTreeManager {
|
||||
public:
|
||||
nsRefPtr<InputQueue> GetInputQueue() const {
|
||||
return mInputQueue;
|
||||
}
|
||||
};
|
||||
|
||||
class TestAsyncPanZoomController : public AsyncPanZoomController {
|
||||
public:
|
||||
TestAsyncPanZoomController(uint64_t aLayersId, MockContentController* aMcc,
|
||||
APZCTreeManager* aTreeManager = nullptr,
|
||||
TestAPZCTreeManager* aTreeManager,
|
||||
GestureBehavior aBehavior = DEFAULT_GESTURES)
|
||||
: AsyncPanZoomController(aLayersId, aTreeManager, aMcc, aBehavior)
|
||||
: AsyncPanZoomController(aLayersId, aTreeManager, aTreeManager->GetInputQueue(), aMcc, aBehavior)
|
||||
{}
|
||||
|
||||
void SetFrameMetrics(const FrameMetrics& metrics) {
|
||||
@ -169,9 +176,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class TestAPZCTreeManager : public APZCTreeManager {
|
||||
};
|
||||
|
||||
static FrameMetrics
|
||||
TestFrameMetrics()
|
||||
{
|
||||
|
@ -540,7 +540,7 @@ RenderFrameParent::ContentReceivedTouch(const ScrollableLayerGuid& aGuid,
|
||||
return;
|
||||
}
|
||||
if (GetApzcTreeManager()) {
|
||||
GetApzcTreeManager()->ContentReceivedTouch(aGuid, aInputBlockId, aPreventDefault);
|
||||
GetApzcTreeManager()->ContentReceivedTouch(aInputBlockId, aPreventDefault);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,7 @@ APZCCallbackHandler::SetNativePanZoomController(jobject obj)
|
||||
}
|
||||
|
||||
void
|
||||
APZCCallbackHandler::NotifyDefaultPrevented(const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
APZCCallbackHandler::NotifyDefaultPrevented(uint64_t aInputBlockId,
|
||||
bool aDefaultPrevented)
|
||||
{
|
||||
if (!AndroidBridge::IsJavaUiThread()) {
|
||||
@ -46,14 +45,14 @@ APZCCallbackHandler::NotifyDefaultPrevented(const ScrollableLayerGuid& aGuid,
|
||||
// have to throw it onto the other thread.
|
||||
AndroidBridge::Bridge()->PostTaskToUiThread(NewRunnableMethod(
|
||||
this, &APZCCallbackHandler::NotifyDefaultPrevented,
|
||||
aGuid, aInputBlockId, aDefaultPrevented), 0);
|
||||
aInputBlockId, aDefaultPrevented), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
|
||||
APZCTreeManager* controller = nsWindow::GetAPZCTreeManager();
|
||||
if (controller) {
|
||||
controller->ContentReceivedTouch(aGuid, aInputBlockId, aDefaultPrevented);
|
||||
controller->ContentReceivedTouch(aInputBlockId, aDefaultPrevented);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
}
|
||||
|
||||
NativePanZoomController* SetNativePanZoomController(jobject obj);
|
||||
void NotifyDefaultPrevented(const mozilla::layers::ScrollableLayerGuid& aGuid, uint64_t aInputBlockId, bool aDefaultPrevented);
|
||||
void NotifyDefaultPrevented(uint64_t aInputBlockId, bool aDefaultPrevented);
|
||||
|
||||
public: // GeckoContentController methods
|
||||
void RequestContentRepaint(const mozilla::layers::FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
|
||||
|
@ -1096,7 +1096,7 @@ bool nsWindow::OnMultitouchEvent(AndroidGeckoEvent *ae)
|
||||
// previous block should not be default-prevented
|
||||
bool defaultPrevented = isDownEvent ? false : preventDefaultActions;
|
||||
if (ae->Type() == AndroidGeckoEvent::APZ_INPUT_EVENT) {
|
||||
mozilla::widget::android::APZCCallbackHandler::GetInstance()->NotifyDefaultPrevented(ae->ApzGuid(), ae->ApzInputBlockId(), defaultPrevented);
|
||||
mozilla::widget::android::APZCCallbackHandler::GetInstance()->NotifyDefaultPrevented(ae->ApzInputBlockId(), defaultPrevented);
|
||||
} else {
|
||||
mozilla::widget::android::GeckoAppShell::NotifyDefaultPrevented(defaultPrevented);
|
||||
}
|
||||
@ -1109,7 +1109,7 @@ bool nsWindow::OnMultitouchEvent(AndroidGeckoEvent *ae)
|
||||
if (isDownEvent) {
|
||||
if (preventDefaultActions) {
|
||||
if (ae->Type() == AndroidGeckoEvent::APZ_INPUT_EVENT) {
|
||||
mozilla::widget::android::APZCCallbackHandler::GetInstance()->NotifyDefaultPrevented(ae->ApzGuid(), ae->ApzInputBlockId(), true);
|
||||
mozilla::widget::android::APZCCallbackHandler::GetInstance()->NotifyDefaultPrevented(ae->ApzInputBlockId(), true);
|
||||
} else {
|
||||
mozilla::widget::android::GeckoAppShell::NotifyDefaultPrevented(true);
|
||||
}
|
||||
|
@ -86,12 +86,12 @@ APZController::SetPendingResponseFlusher(APZPendingResponseFlusher* aFlusher)
|
||||
}
|
||||
|
||||
void
|
||||
APZController::ContentReceivedTouch(const ScrollableLayerGuid& aGuid, const uint64_t aInputBlockId, bool aPreventDefault)
|
||||
APZController::ContentReceivedTouch(const uint64_t aInputBlockId, bool aPreventDefault)
|
||||
{
|
||||
if (!sAPZC) {
|
||||
return;
|
||||
}
|
||||
sAPZC->ContentReceivedTouch(aGuid, aInputBlockId, aPreventDefault);
|
||||
sAPZC->ContentReceivedTouch(aInputBlockId, aPreventDefault);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -215,13 +215,13 @@ APZController::HandleSingleTap(const CSSPoint& aPoint,
|
||||
void
|
||||
APZController::HandleLongTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId)
|
||||
{
|
||||
if (mFlusher) {
|
||||
mFlusher->FlushPendingContentResponse();
|
||||
}
|
||||
ContentReceivedTouch(aGuid, aInputBlockId, false);
|
||||
ContentReceivedTouch(aInputBlockId, false);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
bool HitTestAPZC(mozilla::ScreenIntPoint& aPoint);
|
||||
void TransformCoordinateToGecko(const mozilla::ScreenIntPoint& aPoint,
|
||||
LayoutDeviceIntPoint* aRefPointOut);
|
||||
void ContentReceivedTouch(const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId, bool aPreventDefault);
|
||||
void ContentReceivedTouch(uint64_t aInputBlockId, bool aPreventDefault);
|
||||
nsEventStatus ReceiveInputEvent(mozilla::WidgetInputEvent* aEvent,
|
||||
ScrollableLayerGuid* aOutTargetGuid,
|
||||
uint64_t* aOutInputBlockId);
|
||||
|
@ -1236,7 +1236,7 @@ MetroInput::HandleTouchStartEvent(WidgetTouchEvent* aEvent)
|
||||
// action values from. E.g. for zooming we're taking parent apzc of a few ones
|
||||
// that were touched but touch behaviors would be taken from childs.
|
||||
DUMP_ALLOWED_TOUCH_BEHAVIOR(touchBehaviors);
|
||||
mWidget->ApzcSetAllowedTouchBehavior(mTargetAPZCGuid, mInputBlockId, touchBehaviors);
|
||||
mWidget->ApzcSetAllowedTouchBehavior(mInputBlockId, touchBehaviors);
|
||||
}
|
||||
|
||||
// Pass the event on to content
|
||||
@ -1246,7 +1246,7 @@ MetroInput::HandleTouchStartEvent(WidgetTouchEvent* aEvent)
|
||||
if (nsEventStatus_eConsumeNoDefault == contentStatus) {
|
||||
// Content consumed the event, so we need to notify the APZ
|
||||
// to not do anything with this touch block.
|
||||
mWidget->ApzContentConsumingTouch(mTargetAPZCGuid, mInputBlockId);
|
||||
mWidget->ApzContentConsumingTouch(mInputBlockId);
|
||||
mCancelable = false;
|
||||
|
||||
// Also cancel the gesture detection.
|
||||
@ -1290,9 +1290,9 @@ MetroInput::HandleFirstTouchMoveEvent(WidgetTouchEvent* aEvent)
|
||||
// Let the apz know if content wants to consume touch events.
|
||||
if (mCancelable) {
|
||||
if (nsEventStatus_eConsumeNoDefault == contentStatus) {
|
||||
mWidget->ApzContentConsumingTouch(mTargetAPZCGuid, mInputBlockId);
|
||||
mWidget->ApzContentConsumingTouch(mInputBlockId);
|
||||
} else {
|
||||
mWidget->ApzContentIgnoringTouch(mTargetAPZCGuid, mInputBlockId);
|
||||
mWidget->ApzContentIgnoringTouch(mInputBlockId);
|
||||
if (apzcStatus == nsEventStatus_eConsumeDoDefault) {
|
||||
SendPointerCancelToContent(transformedEvent);
|
||||
}
|
||||
@ -1328,7 +1328,7 @@ MetroInput::SendPendingResponseToApz()
|
||||
// If this is called, content has missed its chance to consume this event block
|
||||
// so we should notify the APZ that content is ignoring this touch block.
|
||||
if (mCancelable) {
|
||||
mWidget->ApzContentIgnoringTouch(mTargetAPZCGuid, mInputBlockId);
|
||||
mWidget->ApzContentIgnoringTouch(mInputBlockId);
|
||||
mCancelable = false;
|
||||
return true;
|
||||
}
|
||||
|
@ -1073,35 +1073,34 @@ MetroWidget::ApzcGetAllowedTouchBehavior(WidgetInputEvent* aTransformedEvent,
|
||||
}
|
||||
|
||||
void
|
||||
MetroWidget::ApzcSetAllowedTouchBehavior(const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
MetroWidget::ApzcSetAllowedTouchBehavior(uint64_t aInputBlockId,
|
||||
nsTArray<TouchBehaviorFlags>& aBehaviors)
|
||||
{
|
||||
LogFunction();
|
||||
if (!APZController::sAPZC) {
|
||||
return;
|
||||
}
|
||||
APZController::sAPZC->SetAllowedTouchBehavior(aGuid, aInputBlockId, aBehaviors);
|
||||
APZController::sAPZC->SetAllowedTouchBehavior(aInputBlockId, aBehaviors);
|
||||
}
|
||||
|
||||
void
|
||||
MetroWidget::ApzContentConsumingTouch(const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId)
|
||||
MetroWidget::ApzContentConsumingTouch(uint64_t aInputBlockId)
|
||||
{
|
||||
LogFunction();
|
||||
if (!mController) {
|
||||
return;
|
||||
}
|
||||
mController->ContentReceivedTouch(aGuid, aInputBlockId, true);
|
||||
mController->ContentReceivedTouch(aInputBlockId, true);
|
||||
}
|
||||
|
||||
void
|
||||
MetroWidget::ApzContentIgnoringTouch(const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId)
|
||||
MetroWidget::ApzContentIgnoringTouch(uint64_t aInputBlockId)
|
||||
{
|
||||
LogFunction();
|
||||
if (!mController) {
|
||||
return;
|
||||
}
|
||||
mController->ContentReceivedTouch(aGuid, aInputBlockId, false);
|
||||
mController->ContentReceivedTouch(aInputBlockId, false);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -209,7 +209,7 @@ public:
|
||||
|
||||
// apzc controller related api
|
||||
void ApzcGetAllowedTouchBehavior(mozilla::WidgetInputEvent* aTransformedEvent, nsTArray<TouchBehaviorFlags>& aOutBehaviors);
|
||||
void ApzcSetAllowedTouchBehavior(const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId, nsTArray<TouchBehaviorFlags>& aBehaviors);
|
||||
void ApzcSetAllowedTouchBehavior(uint64_t aInputBlockId, nsTArray<TouchBehaviorFlags>& aBehaviors);
|
||||
|
||||
// Hit test a point to see if an apzc would consume input there
|
||||
bool ApzHitTest(mozilla::ScreenIntPoint& pt);
|
||||
@ -218,8 +218,8 @@ public:
|
||||
void ApzTransformGeckoCoordinate(const mozilla::ScreenIntPoint& pt,
|
||||
mozilla::LayoutDeviceIntPoint* aRefPointOut);
|
||||
// send ContentRecievedTouch calls to the apz with appropriate preventDefault params
|
||||
void ApzContentConsumingTouch(const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId);
|
||||
void ApzContentIgnoringTouch(const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId);
|
||||
void ApzContentConsumingTouch(uint64_t aInputBlockId);
|
||||
void ApzContentIgnoringTouch(uint64_t aInputBlockId);
|
||||
// Input handling
|
||||
nsEventStatus ApzReceiveInputEvent(mozilla::WidgetInputEvent* aEvent,
|
||||
ScrollableLayerGuid* aOutTargetGuid,
|
||||
|
Loading…
Reference in New Issue
Block a user