Bug 1130535 - Remove codepath that does an APZ untransform on events in RenderFrameParent. r=dvander,botond CLOSED TREE

--HG--
extra : amend_source : 5a48b8a406f9b916b9ee2ef9d79a0519964cfffc
This commit is contained in:
Kartikaya Gupta 2015-02-06 13:46:46 -08:00
Родитель 5f363f569b
Коммит b35a751abd
4 изменённых файлов: 12 добавлений и 65 удалений

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

@ -1153,9 +1153,7 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
if (mIsDestroyed) {
return false;
}
nsEventStatus status = MaybeForwardEventToRenderFrame(event, nullptr, nullptr);
if (status == nsEventStatus_eConsumeNoDefault ||
!MapEventCoordinatesForChildProcess(&event)) {
if (!MapEventCoordinatesForChildProcess(&event)) {
return false;
}
return PBrowserParent::SendRealMouseEvent(event);
@ -1224,10 +1222,8 @@ bool TabParent::SendMouseWheelEvent(WidgetWheelEvent& event)
ScrollableLayerGuid guid;
uint64_t blockId;
nsEventStatus status = MaybeForwardEventToRenderFrame(event, &guid, &blockId);
if (status == nsEventStatus_eConsumeNoDefault ||
!MapEventCoordinatesForChildProcess(&event))
{
ApzAwareEventRoutingToChild(&guid, &blockId);
if (!MapEventCoordinatesForChildProcess(&event)) {
return false;
}
return PBrowserParent::SendMouseWheelEvent(event, guid, blockId);
@ -1279,7 +1275,6 @@ bool TabParent::SendRealKeyEvent(WidgetKeyboardEvent& event)
if (mIsDestroyed) {
return false;
}
MaybeForwardEventToRenderFrame(event, nullptr, nullptr);
if (!MapEventCoordinatesForChildProcess(&event)) {
return false;
}
@ -1348,9 +1343,9 @@ bool TabParent::SendRealTouchEvent(WidgetTouchEvent& event)
ScrollableLayerGuid guid;
uint64_t blockId;
nsEventStatus status = MaybeForwardEventToRenderFrame(event, &guid, &blockId);
ApzAwareEventRoutingToChild(&guid, &blockId);
if (status == nsEventStatus_eConsumeNoDefault || mIsDestroyed) {
if (mIsDestroyed) {
return false;
}
@ -2403,20 +2398,11 @@ TabParent::UseAsyncPanZoom()
GetScrollingBehavior() == ASYNC_PAN_ZOOM);
}
nsEventStatus
TabParent::MaybeForwardEventToRenderFrame(WidgetInputEvent& aEvent,
ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId)
void
TabParent::ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId)
{
if (aEvent.mClass == eWheelEventClass
#ifdef MOZ_WIDGET_GONK
|| aEvent.mClass == eTouchEventClass
#endif
) {
// Wheel events must be sent to APZ directly from the widget. New APZ-
// aware events should follow suit and move there as well. However, we
// do need to inform the child process of the correct target and block
// id.
if (gfxPrefs::AsyncPanZoomEnabled()) {
if (aOutTargetGuid) {
*aOutTargetGuid = InputAPZContext::GetTargetLayerGuid();
@ -2438,14 +2424,7 @@ TabParent::MaybeForwardEventToRenderFrame(WidgetInputEvent& aEvent,
// Let the widget know that the event will be sent to the child process,
// which will (hopefully) send a confirmation notice back to APZ.
InputAPZContext::SetRoutedToChildProcess();
return nsEventStatus_eIgnore;
}
if (RenderFrameParent* rfp = GetRenderFrame()) {
return rfp->NotifyInputEvent(aEvent, aOutTargetGuid, aOutInputBlockId);
}
return nsEventStatus_eIgnore;
}
bool

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

@ -445,19 +445,15 @@ private:
// When true, we create a pan/zoom controller for our frame and
// notify it of input events targeting us.
bool UseAsyncPanZoom();
// If we have a render frame currently, notify it that we're about
// to dispatch |aEvent| to our child. If there's a relevant
// transform in place, |aEvent| will be transformed in-place so that
// it is ready to be dispatched to content.
// Update state prior to routing an APZ-aware event to the child process.
// |aOutTargetGuid| will contain the identifier
// of the APZC instance that handled the event. aOutTargetGuid may be
// null.
// |aOutInputBlockId| will contain the identifier of the input block
// that this event was added to, if there was one. aOutInputBlockId may
// be null.
nsEventStatus MaybeForwardEventToRenderFrame(WidgetInputEvent& aEvent,
ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId);
void ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId);
// The offset for the child process which is sampled at touch start. This
// means that the touch events are relative to where the frame was at the
// start of the touch. We need to look for a better solution to this

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

@ -418,18 +418,6 @@ RenderFrameParent::OwnerContentChanged(nsIContent* aContent)
}
}
nsEventStatus
RenderFrameParent::NotifyInputEvent(WidgetInputEvent& aEvent,
ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId)
{
if (GetApzcTreeManager()) {
return GetApzcTreeManager()->ReceiveInputEvent(
aEvent, aOutTargetGuid, aOutInputBlockId);
}
return nsEventStatus_eIgnore;
}
void
RenderFrameParent::ActorDestroy(ActorDestroyReason why)
{

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

@ -80,22 +80,6 @@ public:
void SetBackgroundColor(nscolor aColor) { mBackgroundColor = gfxRGBA(aColor); };
/**
* Notify the APZ code of an input event, and get back the untransformed event.
* @param aEvent the input event; this is modified in-place so that the async
* transforms are unapplied. This can be passed to Gecko for hit testing
* and normal event dispatch.
* @param aOutTargetGuid An out-parameter that will contain the identifier
* of the APZC instance that handled the event, if one was found. This
* argument may be null.
* @param aOutInputBlockId An out-parameter that will contain the identifier
* of the input block that this event was added to, if there was on.
* This argument may be null.
*/
nsEventStatus NotifyInputEvent(WidgetInputEvent& aEvent,
ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId);
void ZoomToRect(uint32_t aPresShellId, ViewID aViewId, const CSSRect& aRect);
void ContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,