Bug 1217818 - Add support for the mHandledByAPZ flag on touch events as well. r=botond

--HG--
extra : commitid : Dcfgar8CZOi
This commit is contained in:
Kartikaya Gupta 2015-10-28 12:53:34 -04:00
parent 792a61aa26
commit eee88093b7
5 changed files with 13 additions and 3 deletions

View File

@ -688,6 +688,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
switch (aEvent.mInputType) {
case MULTITOUCH_INPUT: {
MultiTouchInput& touchInput = aEvent.AsMultiTouchInput();
touchInput.mHandledByAPZ = true;
result = ProcessTouchInput(touchInput, aOutTargetGuid, aOutInputBlockId);
break;
} case MOUSE_INPUT: {

View File

@ -113,7 +113,7 @@ public:
bool mWantReplyFromContentProcess : 1;
// The event's action will be handled by APZ. The main thread should not
// perform its associated action. This is currently only relevant for
// wheel events.
// wheel and touch events.
bool mHandledByAPZ : 1;
// If the event is being handled in target phase, returns true.

View File

@ -86,6 +86,7 @@ MouseInput::TransformToLocal(const gfx::Matrix4x4& aTransform)
MultiTouchInput::MultiTouchInput(const WidgetTouchEvent& aTouchEvent)
: InputData(MULTITOUCH_INPUT, aTouchEvent.time, aTouchEvent.timeStamp,
aTouchEvent.modifiers)
, mHandledByAPZ(aTouchEvent.mFlags.mHandledByAPZ)
{
MOZ_ASSERT(NS_IsMainThread(),
"Can only copy from WidgetTouchEvent on main thread");
@ -163,6 +164,7 @@ MultiTouchInput::ToWidgetTouchEvent(nsIWidget* aWidget) const
event.modifiers = this->modifiers;
event.time = this->mTime;
event.timeStamp = this->mTimeStamp;
event.mFlags.mHandledByAPZ = mHandledByAPZ;
for (size_t i = 0; i < mTouches.Length(); i++) {
*event.touches.AppendElement() = mTouches[i].ToNewDOMTouch();
@ -205,6 +207,7 @@ MultiTouchInput::ToWidgetMouseEvent(nsIWidget* aWidget) const
event.button = WidgetMouseEvent::eLeftButton;
event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
event.modifiers = modifiers;
event.mFlags.mHandledByAPZ = mHandledByAPZ;
if (mouseEventMessage != eMouseMove) {
event.clickCount = 1;
@ -233,6 +236,7 @@ MultiTouchInput::IndexOfTouch(int32_t aTouchIdentifier)
MultiTouchInput::MultiTouchInput(const WidgetMouseEvent& aMouseEvent)
: InputData(MULTITOUCH_INPUT, aMouseEvent.time, aMouseEvent.timeStamp,
aMouseEvent.modifiers)
, mHandledByAPZ(aMouseEvent.mFlags.mHandledByAPZ)
{
MOZ_ASSERT(NS_IsMainThread(),
"Can only copy from WidgetMouseEvent on main thread");

View File

@ -208,13 +208,15 @@ public:
MultiTouchInput(MultiTouchType aType, uint32_t aTime, TimeStamp aTimeStamp,
Modifiers aModifiers)
: InputData(MULTITOUCH_INPUT, aTime, aTimeStamp, aModifiers),
mType(aType)
: InputData(MULTITOUCH_INPUT, aTime, aTimeStamp, aModifiers)
, mType(aType)
, mHandledByAPZ(false)
{
}
MultiTouchInput()
: InputData(MULTITOUCH_INPUT)
, mHandledByAPZ(false)
{
}
@ -222,6 +224,7 @@ public:
: InputData(MULTITOUCH_INPUT, aOther.mTime,
aOther.mTimeStamp, aOther.modifiers)
, mType(aOther.mType)
, mHandledByAPZ(aOther.mHandledByAPZ)
{
mTouches.AppendElements(aOther.mTouches);
}
@ -246,6 +249,7 @@ public:
MultiTouchType mType;
nsTArray<SingleTouchData> mTouches;
bool mHandledByAPZ;
};
class MouseInput : public InputData

View File

@ -174,6 +174,7 @@ public:
timeStamp = aOther.timeStamp;
touches.AppendElements(aOther.touches);
mFlags.mCancelable = mMessage != eTouchCancel;
mFlags.mHandledByAPZ = aOther.mFlags.mHandledByAPZ;
MOZ_COUNT_CTOR(WidgetTouchEvent);
}