2016-01-08 22:17:39 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2017-10-28 02:10:06 +03:00
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2016-01-08 22:17:39 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "mozilla/layers/APZChild.h"
|
2016-08-11 02:51:45 +03:00
|
|
|
#include "mozilla/layers/GeckoContentController.h"
|
2016-01-08 22:17:39 +03:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
#include "mozilla/dom/BrowserChild.h"
|
2016-01-08 22:17:39 +03:00
|
|
|
#include "mozilla/layers/APZCCallbackHelper.h"
|
|
|
|
|
2016-08-11 02:51:45 +03:00
|
|
|
#include "InputData.h" // for InputData
|
|
|
|
|
2016-01-08 22:17:39 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2016-08-11 02:51:45 +03:00
|
|
|
APZChild::APZChild(RefPtr<GeckoContentController> aController)
|
|
|
|
: mController(aController) {
|
|
|
|
MOZ_ASSERT(mController);
|
2016-08-11 02:51:45 +03:00
|
|
|
}
|
|
|
|
|
2016-08-25 00:15:35 +03:00
|
|
|
APZChild::~APZChild() {
|
2016-08-11 02:51:45 +03:00
|
|
|
if (mController) {
|
|
|
|
mController->Destroy();
|
|
|
|
mController = nullptr;
|
2016-08-25 00:15:35 +03:00
|
|
|
}
|
2016-08-11 02:51:45 +03:00
|
|
|
}
|
|
|
|
|
2019-03-09 23:33:17 +03:00
|
|
|
mozilla::ipc::IPCResult APZChild::RecvLayerTransforms(
|
|
|
|
const nsTArray<MatrixMessage>& aTransforms) {
|
|
|
|
mController->NotifyLayerTransforms(aTransforms);
|
|
|
|
return IPC_OK();
|
|
|
|
}
|
|
|
|
|
2018-09-19 21:50:20 +03:00
|
|
|
mozilla::ipc::IPCResult APZChild::RecvRequestContentRepaint(
|
|
|
|
const RepaintRequest& aRequest) {
|
2016-08-11 02:51:45 +03:00
|
|
|
MOZ_ASSERT(mController->IsRepaintThread());
|
|
|
|
|
2018-09-19 21:50:20 +03:00
|
|
|
mController->RequestContentRepaint(aRequest);
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-01-08 22:17:39 +03:00
|
|
|
}
|
|
|
|
|
2016-08-11 02:51:45 +03:00
|
|
|
mozilla::ipc::IPCResult APZChild::RecvUpdateOverscrollVelocity(
|
|
|
|
const float& aX, const float& aY, const bool& aIsRootContent) {
|
|
|
|
mController->UpdateOverscrollVelocity(aX, aY, aIsRootContent);
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-08-11 02:51:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
mozilla::ipc::IPCResult APZChild::RecvUpdateOverscrollOffset(
|
|
|
|
const float& aX, const float& aY, const bool& aIsRootContent) {
|
|
|
|
mController->UpdateOverscrollOffset(aX, aY, aIsRootContent);
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-08-11 02:51:45 +03:00
|
|
|
}
|
|
|
|
|
2016-08-11 02:51:45 +03:00
|
|
|
mozilla::ipc::IPCResult APZChild::RecvNotifyMozMouseScrollEvent(
|
2016-08-02 09:59:00 +03:00
|
|
|
const ViewID& aScrollId, const nsString& aEvent) {
|
2016-08-11 02:51:45 +03:00
|
|
|
mController->NotifyMozMouseScrollEvent(aScrollId, aEvent);
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-08-02 09:59:00 +03:00
|
|
|
}
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult APZChild::RecvNotifyAPZStateChange(
|
2016-08-11 02:51:45 +03:00
|
|
|
const ScrollableLayerGuid& aGuid, const APZStateChange& aChange,
|
2016-01-08 22:17:39 +03:00
|
|
|
const int& aArg) {
|
2016-08-11 02:51:45 +03:00
|
|
|
mController->NotifyAPZStateChange(aGuid, aChange, aArg);
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-01-08 22:17:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
mozilla::ipc::IPCResult APZChild::RecvNotifyFlushComplete() {
|
2016-08-11 02:51:45 +03:00
|
|
|
MOZ_ASSERT(mController->IsRepaintThread());
|
|
|
|
|
|
|
|
mController->NotifyFlushComplete();
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-01-08 22:17:39 +03:00
|
|
|
}
|
|
|
|
|
2018-11-22 21:00:49 +03:00
|
|
|
mozilla::ipc::IPCResult APZChild::RecvNotifyAsyncScrollbarDragInitiated(
|
|
|
|
const uint64_t& aDragBlockId, const ViewID& aScrollId,
|
|
|
|
const ScrollDirection& aDirection) {
|
|
|
|
mController->NotifyAsyncScrollbarDragInitiated(aDragBlockId, aScrollId,
|
|
|
|
aDirection);
|
|
|
|
return IPC_OK();
|
|
|
|
}
|
|
|
|
|
2017-01-28 02:02:22 +03:00
|
|
|
mozilla::ipc::IPCResult APZChild::RecvNotifyAsyncScrollbarDragRejected(
|
|
|
|
const ViewID& aScrollId) {
|
|
|
|
mController->NotifyAsyncScrollbarDragRejected(aScrollId);
|
|
|
|
return IPC_OK();
|
|
|
|
}
|
|
|
|
|
2017-10-19 01:18:13 +03:00
|
|
|
mozilla::ipc::IPCResult APZChild::RecvNotifyAsyncAutoscrollRejected(
|
|
|
|
const ViewID& aScrollId) {
|
|
|
|
mController->NotifyAsyncAutoscrollRejected(aScrollId);
|
2017-07-27 02:32:57 +03:00
|
|
|
return IPC_OK();
|
|
|
|
}
|
|
|
|
|
2016-04-19 00:25:25 +03:00
|
|
|
mozilla::ipc::IPCResult APZChild::RecvDestroy() {
|
2016-08-11 02:51:45 +03:00
|
|
|
// mController->Destroy will be called in the destructor
|
2016-08-22 03:43:08 +03:00
|
|
|
PAPZChild::Send__delete__(this);
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-04-19 00:25:25 +03:00
|
|
|
}
|
|
|
|
|
2016-01-08 22:17:39 +03:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|