Bug 915213 - Add a new apzc ReceiveInput method that transforms gecko events inline. r=kats

This commit is contained in:
Jim Mathies 2013-09-24 16:17:26 -05:00
Родитель 4c3d3b4205
Коммит 7dbdca5904
2 изменённых файлов: 34 добавлений и 0 удалений

Просмотреть файл

@ -427,6 +427,32 @@ APZCTreeManager::ReceiveInputEvent(const nsInputEvent& aEvent,
}
}
nsEventStatus
APZCTreeManager::ReceiveInputEvent(nsInputEvent& aEvent)
{
MOZ_ASSERT(NS_IsMainThread());
switch (aEvent.eventStructType) {
case NS_TOUCH_EVENT: {
nsTouchEvent& touchEvent = static_cast<nsTouchEvent&>(aEvent);
if (!touchEvent.touches.Length()) {
return nsEventStatus_eIgnore;
}
if (touchEvent.message == NS_TOUCH_START) {
ScreenPoint point = ScreenPoint(touchEvent.touches[0]->mRefPoint.x, touchEvent.touches[0]->mRefPoint.y);
mApzcForInputBlock = GetTouchInputBlockAPZC(touchEvent, point);
}
if (!mApzcForInputBlock) {
return nsEventStatus_eIgnore;
}
return ProcessTouchEvent(touchEvent, &touchEvent);
}
default: {
return ProcessEvent(aEvent, &aEvent);
}
}
}
void
APZCTreeManager::UpdateCompositionBounds(const ScrollableLayerGuid& aGuid,
const ScreenIntRect& aCompositionBounds)

Просмотреть файл

@ -163,6 +163,14 @@ public:
nsEventStatus ReceiveInputEvent(const nsInputEvent& aEvent,
nsInputEvent* aOutEvent);
/**
* nsInputEvent handler with inline dom transform of the passed in
* nsInputEvent. Must be called on the main thread.
*
* @param aEvent input event object
*/
nsEventStatus ReceiveInputEvent(nsInputEvent& aEvent);
/**
* Updates the composition bounds, i.e. the dimensions of the final size of
* the frame this is tied to during composition onto, in device pixels. In