Bug 1127066 - Apply the APZ callback transform to touch events targeted to the root process. r=kats

--HG--
extra : source : 0df1683cb64100e03e4afd23a3d5e158788f082b
This commit is contained in:
Botond Ballo 2015-02-04 12:52:18 -05:00
parent 286bd7e59d
commit c6a3af10a1

View File

@ -49,6 +49,7 @@
#include "mozilla/layers/APZThreadUtils.h"
#include "mozilla/layers/ChromeProcessController.h"
#include "mozilla/layers/InputAPZContext.h"
#include "mozilla/layers/APZCCallbackHelper.h"
#include "mozilla/dom/TabParent.h"
#include "nsRefPtrHashtable.h"
#ifdef ACCESSIBILITY
@ -937,6 +938,17 @@ nsBaseWidget::DispatchEventForAPZ(WidgetGUIEvent* aEvent,
MOZ_ASSERT(NS_IsMainThread());
InputAPZContext context(aGuid, aInputBlockId);
// If this is a touch event and APZ has targeted it to an APZC in the root
// process, apply that APZC's callback-transform before dispatching the
// event. If the event is instead targeted to an APZC in the child process,
// the transform will be applied in the child process before dispatching
// the event there (see e.g. TabChild::RecvRealTouchEvent()).
// TODO: Do other types of events (than touch) need this?
if (aEvent->AsTouchEvent() && aGuid.mLayersId == mCompositorParent->RootLayerTreeId()) {
APZCCallbackHelper::ApplyCallbackTransform(*aEvent->AsTouchEvent(), aGuid,
GetDefaultScale(), 1.0f);
}
nsEventStatus status;
DispatchEvent(aEvent, status);