Bug 1622360 - Remove SLGuidAndRenderRoot and convert remaining uses to ScrollableLayerGuid. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D68400

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2020-03-27 17:44:21 +00:00
Родитель dda847f4e7
Коммит 7d2c8af30b
37 изменённых файлов: 129 добавлений и 267 удалений

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

@ -453,7 +453,7 @@ void BrowserChild::ContentReceivedInputBlock(uint64_t aInputBlockId,
void BrowserChild::SetTargetAPZC(
uint64_t aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) const {
const nsTArray<ScrollableLayerGuid>& aTargets) const {
if (mApzcTreeManager) {
mApzcTreeManager->SetTargetAPZC(aInputBlockId, aTargets);
}
@ -474,8 +474,8 @@ bool BrowserChild::DoUpdateZoomConstraints(
return false;
}
SLGuidAndRenderRoot guid = SLGuidAndRenderRoot(
mLayersId, aPresShellId, aViewId, gfxUtils::GetContentRenderRoot());
ScrollableLayerGuid guid =
ScrollableLayerGuid(mLayersId, aPresShellId, aViewId);
mApzcTreeManager->UpdateZoomConstraints(guid, aConstraints);
return true;
@ -1379,8 +1379,7 @@ void BrowserChild::HandleDoubleTap(const CSSPoint& aPoint,
if (APZCCallbackHelper::GetOrCreateScrollIdentifiers(
document->GetDocumentElement(), &presShellId, &viewId) &&
mApzcTreeManager) {
SLGuidAndRenderRoot guid(mLayersId, presShellId, viewId,
gfxUtils::GetContentRenderRoot());
ScrollableLayerGuid guid(mLayersId, presShellId, viewId);
mApzcTreeManager->ZoomToRect(guid, zoomToRect, DEFAULT_BEHAVIOR);
}
@ -1466,9 +1465,8 @@ bool BrowserChild::NotifyAPZStateChange(
void BrowserChild::StartScrollbarDrag(
const layers::AsyncDragMetrics& aDragMetrics) {
SLGuidAndRenderRoot guid(mLayersId, aDragMetrics.mPresShellId,
aDragMetrics.mViewId,
gfxUtils::GetContentRenderRoot());
ScrollableLayerGuid guid(mLayersId, aDragMetrics.mPresShellId,
aDragMetrics.mViewId);
if (mApzcTreeManager) {
mApzcTreeManager->StartScrollbarDrag(guid, aDragMetrics);
@ -1478,8 +1476,7 @@ void BrowserChild::StartScrollbarDrag(
void BrowserChild::ZoomToRect(const uint32_t& aPresShellId,
const ScrollableLayerGuid::ViewID& aViewId,
const CSSRect& aRect, const uint32_t& aFlags) {
SLGuidAndRenderRoot guid(mLayersId, aPresShellId, aViewId,
gfxUtils::GetContentRenderRoot());
ScrollableLayerGuid guid(mLayersId, aPresShellId, aViewId);
if (mApzcTreeManager) {
mApzcTreeManager->ZoomToRect(guid, aRect, aFlags);

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

@ -585,7 +585,7 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
bool aPreventDefault) const;
void SetTargetAPZC(
uint64_t aInputBlockId,
const nsTArray<layers::SLGuidAndRenderRoot>& aTargets) const;
const nsTArray<layers::ScrollableLayerGuid>& aTargets) const;
MOZ_CAN_RUN_SCRIPT_BOUNDARY
mozilla::ipc::IPCResult RecvHandleTap(
const layers::GeckoContentController::TapType& aType,

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

@ -3556,8 +3556,7 @@ bool BrowserParent::StartApzAutoscroll(float aAnchorX, float aAnchorY,
if (mRemoteLayerTreeOwner.IsInitialized()) {
layers::LayersId layersId = mRemoteLayerTreeOwner.GetLayersId();
if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
SLGuidAndRenderRoot guid(layersId, aPresShellId, aScrollId,
gfxUtils::GetContentRenderRoot());
ScrollableLayerGuid guid(layersId, aPresShellId, aScrollId);
// The anchor coordinates that are passed in are relative to the origin
// of the screen, but we are sending them to APZ which only knows about
@ -3585,8 +3584,7 @@ void BrowserParent::StopApzAutoscroll(nsViewID aScrollId,
if (mRemoteLayerTreeOwner.IsInitialized()) {
layers::LayersId layersId = mRemoteLayerTreeOwner.GetLayersId();
if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
SLGuidAndRenderRoot guid(layersId, aPresShellId, aScrollId,
gfxUtils::GetContentRenderRoot());
ScrollableLayerGuid guid(layersId, aPresShellId, aScrollId);
widget->StopAsyncAutoscroll(guid);
}

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

@ -267,13 +267,6 @@ void AppendToString(std::stringstream& aStream, const ScrollableLayerGuid& s,
<< sfx;
}
void AppendToString(std::stringstream& aStream, const SLGuidAndRenderRoot& s,
const char* pfx, const char* sfx) {
aStream << pfx << "{ ";
AppendToString(aStream, s.mScrollableLayerGuid, "s=");
aStream << nsPrintfCString(", r=%d }", (int)s.mRenderRoot).get() << sfx;
}
void AppendToString(std::stringstream& aStream, const ZoomConstraints& z,
const char* pfx, const char* sfx) {
aStream << pfx

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

@ -12,7 +12,6 @@
#include "mozilla/gfx/Point.h" // for IntSize, etc
#include "mozilla/gfx/TiledRegion.h" // for TiledRegion
#include "mozilla/gfx/Types.h" // for SamplingFilter, SurfaceFormat
#include "mozilla/layers/APZTypes.h" // for SLGuidAndRenderRoot
#include "mozilla/layers/CompositorTypes.h" // for TextureFlags
#include "mozilla/layers/WebRenderLayersLogging.h"
#include "mozilla/layers/ZoomConstraints.h"
@ -185,9 +184,6 @@ void AppendToString(std::stringstream& aStream, const FrameMetrics& m,
void AppendToString(std::stringstream& aStream, const ScrollableLayerGuid& s,
const char* pfx = "", const char* sfx = "");
void AppendToString(std::stringstream& aStream, const SLGuidAndRenderRoot& s,
const char* pfx = "", const char* sfx = "");
void AppendToString(std::stringstream& aStream, const ZoomConstraints& z,
const char* pfx = "", const char* sfx = "");

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

@ -1,52 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef mozilla_layers_APZTypes_h
#define mozilla_layers_APZTypes_h
#include "LayersTypes.h"
#include "mozilla/layers/ScrollableLayerGuid.h"
#include "mozilla/webrender/WebRenderTypes.h"
namespace mozilla {
namespace layers {
// This a simple structure that wraps a ScrollableLayerGuid and a RenderRoot.
// It is needed on codepaths shared with WebRender, where we need to propagate
// the RenderRoot information along with the ScrollableLayerGuid (as each
// scrollable frame belongs to exactly one RenderRoot, and APZ needs to record
// that information on the APZC instances).
struct SLGuidAndRenderRoot {
ScrollableLayerGuid mScrollableLayerGuid;
wr::RenderRoot mRenderRoot;
// needed for IPDL, but shouldn't be used otherwise!
SLGuidAndRenderRoot() : mRenderRoot(wr::RenderRoot::Default) {}
SLGuidAndRenderRoot(LayersId aLayersId, uint32_t aPresShellId,
ScrollableLayerGuid::ViewID aScrollId,
wr::RenderRoot aRenderRoot)
: mScrollableLayerGuid(aLayersId, aPresShellId, aScrollId),
mRenderRoot(aRenderRoot) {}
SLGuidAndRenderRoot(const ScrollableLayerGuid& other,
wr::RenderRoot aRenderRoot)
: mScrollableLayerGuid(other), mRenderRoot(aRenderRoot) {}
};
template <int LogLevel>
gfx::Log<LogLevel>& operator<<(gfx::Log<LogLevel>& log,
const SLGuidAndRenderRoot& aGuid) {
return log << '(' << aGuid.mScrollableLayerGuid << ','
<< (int)aGuid.mRenderRoot << ')';
}
} // namespace layers
} // namespace mozilla
#endif /* mozilla_layers_APZTypes_h */

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

@ -12,7 +12,6 @@
#include "base/platform_thread.h" // for PlatformThreadId
#include "LayersTypes.h"
#include "APZTypes.h"
#include "mozilla/layers/APZTestData.h"
#include "mozilla/layers/WebRenderScrollData.h"
#include "mozilla/StaticMutex.h"

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

@ -9,7 +9,6 @@
#include <stdint.h> // for uint64_t, uint32_t
#include "mozilla/layers/APZTypes.h"
#include "mozilla/layers/LayersTypes.h" // for TouchBehaviorFlags
#include "mozilla/layers/ScrollableLayerGuid.h" // for ScrollableLayerGuid, etc
#include "mozilla/layers/ZoomConstraints.h" // for ZoomConstraints
@ -56,7 +55,7 @@ class IAPZCTreeManager {
* up. |aRect| must be given in CSS pixels, relative to the document.
* |aFlags| is a combination of the ZoomToRectBehavior enum values.
*/
virtual void ZoomToRect(const SLGuidAndRenderRoot& aGuid,
virtual void ZoomToRect(const ScrollableLayerGuid& aGuid,
const CSSRect& aRect,
const uint32_t aFlags = DEFAULT_BEHAVIOR) = 0;
@ -82,7 +81,7 @@ class IAPZCTreeManager {
* should be set to ScrollableLayerGuid::NULL_SCROLL_ID.
*/
virtual void SetTargetAPZC(uint64_t aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) = 0;
const nsTArray<ScrollableLayerGuid>& aTargets) = 0;
/**
* Updates any zoom constraints contained in the <meta name="viewport"> tag.
@ -90,7 +89,7 @@ class IAPZCTreeManager {
* the given |aGuid| are cleared.
*/
virtual void UpdateZoomConstraints(
const SLGuidAndRenderRoot& aGuid,
const ScrollableLayerGuid& aGuid,
const Maybe<ZoomConstraints>& aConstraints) = 0;
virtual void SetDPI(float aDpiValue) = 0;
@ -107,13 +106,13 @@ class IAPZCTreeManager {
virtual void SetAllowedTouchBehavior(
uint64_t aInputBlockId, const nsTArray<TouchBehaviorFlags>& aValues) = 0;
virtual void StartScrollbarDrag(const SLGuidAndRenderRoot& aGuid,
virtual void StartScrollbarDrag(const ScrollableLayerGuid& aGuid,
const AsyncDragMetrics& aDragMetrics) = 0;
virtual bool StartAutoscroll(const SLGuidAndRenderRoot& aGuid,
virtual bool StartAutoscroll(const ScrollableLayerGuid& aGuid,
const ScreenPoint& aAnchorLocation) = 0;
virtual void StopAutoscroll(const SLGuidAndRenderRoot& aGuid) = 0;
virtual void StopAutoscroll(const ScrollableLayerGuid& aGuid) = 0;
/**
* Function used to disable LongTap gestures.

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

@ -1064,14 +1064,13 @@ static EventRegionsOverride GetEventRegionsOverride(HitTestingTreeNode* aParent,
return result;
}
void APZCTreeManager::StartScrollbarDrag(const SLGuidAndRenderRoot& aGuid,
void APZCTreeManager::StartScrollbarDrag(const ScrollableLayerGuid& aGuid,
const AsyncDragMetrics& aDragMetrics) {
APZThreadUtils::AssertOnControllerThread();
RefPtr<AsyncPanZoomController> apzc =
GetTargetAPZC(aGuid.mScrollableLayerGuid);
RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aGuid);
if (!apzc) {
NotifyScrollbarDragRejected(aGuid.mScrollableLayerGuid);
NotifyScrollbarDragRejected(aGuid);
return;
}
@ -1079,19 +1078,18 @@ void APZCTreeManager::StartScrollbarDrag(const SLGuidAndRenderRoot& aGuid,
mInputQueue->ConfirmDragBlock(inputBlockId, apzc, aDragMetrics);
}
bool APZCTreeManager::StartAutoscroll(const SLGuidAndRenderRoot& aGuid,
bool APZCTreeManager::StartAutoscroll(const ScrollableLayerGuid& aGuid,
const ScreenPoint& aAnchorLocation) {
APZThreadUtils::AssertOnControllerThread();
RefPtr<AsyncPanZoomController> apzc =
GetTargetAPZC(aGuid.mScrollableLayerGuid);
RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aGuid);
if (!apzc) {
if (XRE_IsGPUProcess()) {
// If we're in the compositor process, the "return false" will be
// ignored because the query comes over the PAPZCTreeManager protocol
// via an async message. In this case, send an explicit rejection
// message to content.
NotifyAutoscrollRejected(aGuid.mScrollableLayerGuid);
NotifyAutoscrollRejected(aGuid);
}
return false;
}
@ -1100,11 +1098,10 @@ bool APZCTreeManager::StartAutoscroll(const SLGuidAndRenderRoot& aGuid,
return true;
}
void APZCTreeManager::StopAutoscroll(const SLGuidAndRenderRoot& aGuid) {
void APZCTreeManager::StopAutoscroll(const ScrollableLayerGuid& aGuid) {
APZThreadUtils::AssertOnControllerThread();
if (RefPtr<AsyncPanZoomController> apzc =
GetTargetAPZC(aGuid.mScrollableLayerGuid)) {
if (RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aGuid)) {
apzc->StopAutoscroll();
}
}
@ -2403,15 +2400,14 @@ void APZCTreeManager::SetKeyboardMap(const KeyboardMap& aKeyboardMap) {
mKeyboardMap = aKeyboardMap;
}
void APZCTreeManager::ZoomToRect(const SLGuidAndRenderRoot& aGuid,
void APZCTreeManager::ZoomToRect(const ScrollableLayerGuid& aGuid,
const CSSRect& aRect, const uint32_t aFlags) {
// We could probably move this to run on the updater thread if needed, but
// either way we should restrict it to a single thread. For now let's use the
// controller thread.
APZThreadUtils::AssertOnControllerThread();
RefPtr<AsyncPanZoomController> apzc =
GetTargetAPZC(aGuid.mScrollableLayerGuid);
RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aGuid);
if (apzc) {
apzc->ZoomToRect(aRect, aFlags);
}
@ -2425,23 +2421,22 @@ void APZCTreeManager::ContentReceivedInputBlock(uint64_t aInputBlockId,
}
void APZCTreeManager::SetTargetAPZC(
uint64_t aInputBlockId, const nsTArray<SLGuidAndRenderRoot>& aTargets) {
uint64_t aInputBlockId, const nsTArray<ScrollableLayerGuid>& aTargets) {
APZThreadUtils::AssertOnControllerThread();
RefPtr<AsyncPanZoomController> target = nullptr;
if (aTargets.Length() > 0) {
target = GetTargetAPZC(aTargets[0].mScrollableLayerGuid);
target = GetTargetAPZC(aTargets[0]);
}
for (size_t i = 1; i < aTargets.Length(); i++) {
RefPtr<AsyncPanZoomController> apzc =
GetTargetAPZC(aTargets[i].mScrollableLayerGuid);
RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aTargets[i]);
target = GetZoomableTarget(target, apzc);
}
mInputQueue->SetConfirmedTargetApzc(aInputBlockId, target);
}
void APZCTreeManager::UpdateZoomConstraints(
const SLGuidAndRenderRoot& aGuid,
const ScrollableLayerGuid& aGuid,
const Maybe<ZoomConstraints>& aConstraints) {
if (!GetUpdater()->IsUpdaterThread()) {
// This can happen if we're in the UI process and got a call directly from
@ -2451,8 +2446,8 @@ void APZCTreeManager::UpdateZoomConstraints(
// enabled, since the call will go over PAPZCTreeManager and arrive on the
// compositor thread in the GPU process.
GetUpdater()->RunOnUpdaterThread(
aGuid.mScrollableLayerGuid.mLayersId,
NewRunnableMethod<SLGuidAndRenderRoot, Maybe<ZoomConstraints>>(
aGuid.mLayersId,
NewRunnableMethod<ScrollableLayerGuid, Maybe<ZoomConstraints>>(
"APZCTreeManager::UpdateZoomConstraints", this,
&APZCTreeManager::UpdateZoomConstraints, aGuid, aConstraints));
return;
@ -2460,9 +2455,8 @@ void APZCTreeManager::UpdateZoomConstraints(
AssertOnUpdaterThread();
ScrollableLayerGuid guid = aGuid.mScrollableLayerGuid;
RecursiveMutexAutoLock lock(mTreeLock);
RefPtr<HitTestingTreeNode> node = GetTargetNode(guid, nullptr);
RefPtr<HitTestingTreeNode> node = GetTargetNode(aGuid, nullptr);
MOZ_ASSERT(!node || node->GetApzc()); // any node returned must have an APZC
// Propagate the zoom constraints down to the subtree, stopping at APZCs
@ -2470,11 +2464,11 @@ void APZCTreeManager::UpdateZoomConstraints(
if (aConstraints) {
APZCTM_LOG("Recording constraints %s for guid %s\n",
Stringify(aConstraints.value()).c_str(),
Stringify(guid).c_str());
mZoomConstraints[guid] = aConstraints.ref();
Stringify(aGuid).c_str());
mZoomConstraints[aGuid] = aConstraints.ref();
} else {
APZCTM_LOG("Removing constraints for guid %s\n", Stringify(guid).c_str());
mZoomConstraints.erase(guid);
APZCTM_LOG("Removing constraints for guid %s\n", Stringify(aGuid).c_str());
mZoomConstraints.erase(aGuid);
}
if (node && aConstraints) {
ForEachNode<ReverseIterator>(

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

@ -229,7 +229,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
* up. |aRect| must be given in CSS pixels, relative to the document.
* |aFlags| is a combination of the ZoomToRectBehavior enum values.
*/
void ZoomToRect(const SLGuidAndRenderRoot& aGuid, const CSSRect& aRect,
void ZoomToRect(const ScrollableLayerGuid& aGuid, const CSSRect& aRect,
const uint32_t aFlags = DEFAULT_BEHAVIOR) override;
/**
@ -261,7 +261,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
* arrive.
*/
void SetTargetAPZC(uint64_t aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) override;
const nsTArray<ScrollableLayerGuid>& aTargets) override;
/**
* Updates any zoom constraints contained in the <meta name="viewport"> tag.
@ -269,7 +269,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
* the given |aGuid| are cleared.
*/
void UpdateZoomConstraints(
const SLGuidAndRenderRoot& aGuid,
const ScrollableLayerGuid& aGuid,
const Maybe<ZoomConstraints>& aConstraints) override;
/**
@ -410,13 +410,13 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
ParentLayerPoint DispatchFling(AsyncPanZoomController* aApzc,
const FlingHandoffState& aHandoffState);
void StartScrollbarDrag(const SLGuidAndRenderRoot& aGuid,
void StartScrollbarDrag(const ScrollableLayerGuid& aGuid,
const AsyncDragMetrics& aDragMetrics) override;
bool StartAutoscroll(const SLGuidAndRenderRoot& aGuid,
bool StartAutoscroll(const ScrollableLayerGuid& aGuid,
const ScreenPoint& aAnchorLocation) override;
void StopAutoscroll(const SLGuidAndRenderRoot& aGuid) override;
void StopAutoscroll(const ScrollableLayerGuid& aGuid) override;
/*
* Build the chain of APZCs that will handle overscroll for a pan starting at

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

@ -47,7 +47,6 @@ namespace layers {
class AsyncDragMetrics;
class APZCTreeManager;
struct ScrollableLayerGuid;
struct SLGuidAndRenderRoot;
class CompositorController;
class MetricsSharingController;
class GestureEventListener;

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

@ -239,17 +239,6 @@ class TestAPZCTreeManager : public APZCTreeManager {
**/
void CancelAnimation() { EXPECT_TRUE(false); }
using APZCTreeManager::SetTargetAPZC; // silence clang warning about overload
void SetTargetAPZC(uint64_t aInputBlockId,
const nsTArray<ScrollableLayerGuid>& aTargets) {
nsTArray<SLGuidAndRenderRoot> wrapped;
for (const ScrollableLayerGuid& target : aTargets) {
wrapped.AppendElement(
SLGuidAndRenderRoot(target, wr::RenderRoot::Default));
}
this->SetTargetAPZC(aInputBlockId, wrapped);
}
protected:
AsyncPanZoomController* NewAPZCInstance(
LayersId aLayersId, GeckoContentController* aController) override;

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

@ -664,9 +664,8 @@ using FrameForPointOption = nsLayoutUtils::FrameForPointOption;
static bool PrepareForSetTargetAPZCNotification(
nsIWidget* aWidget, const LayersId& aLayersId, nsIFrame* aRootFrame,
const LayoutDeviceIntPoint& aRefPoint,
nsTArray<SLGuidAndRenderRoot>* aTargets) {
SLGuidAndRenderRoot guid(aLayersId, 0, ScrollableLayerGuid::NULL_SCROLL_ID,
wr::RenderRoot::Default);
nsTArray<ScrollableLayerGuid>* aTargets) {
ScrollableLayerGuid guid(aLayersId, 0, ScrollableLayerGuid::NULL_SCROLL_ID);
nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo(
aWidget, aRefPoint, aRootFrame);
EnumSet<FrameForPointOption> options;
@ -689,13 +688,6 @@ static bool PrepareForSetTargetAPZCNotification(
scrollAncestor ? GetDisplayportElementFor(scrollAncestor)
: GetRootDocumentElementFor(aWidget);
if (XRE_IsContentProcess()) {
guid.mRenderRoot = gfxUtils::GetContentRenderRoot();
} else {
guid.mRenderRoot = gfxUtils::RecursivelyGetRenderRootForFrame(
target ? target : aRootFrame);
}
if (MOZ_LOG_TEST(sApzHlpLog, LogLevel::Debug)) {
nsAutoString dpElementDesc;
if (dpElement) {
@ -707,8 +699,7 @@ static bool PrepareForSetTargetAPZCNotification(
}
bool guidIsValid = APZCCallbackHelper::GetOrCreateScrollIdentifiers(
dpElement, &(guid.mScrollableLayerGuid.mPresShellId),
&(guid.mScrollableLayerGuid.mScrollId));
dpElement, &(guid.mPresShellId), &(guid.mScrollId));
aTargets->AppendElement(guid);
if (!guidIsValid) {
@ -747,7 +738,7 @@ static bool PrepareForSetTargetAPZCNotification(
static void SendLayersDependentApzcTargetConfirmation(
PresShell* aPresShell, uint64_t aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) {
const nsTArray<ScrollableLayerGuid>& aTargets) {
LayerManager* lm = aPresShell->GetLayerManager();
if (!lm) {
return;
@ -777,7 +768,7 @@ static void SendLayersDependentApzcTargetConfirmation(
DisplayportSetListener::DisplayportSetListener(
nsIWidget* aWidget, PresShell* aPresShell, const uint64_t& aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets)
const nsTArray<ScrollableLayerGuid>& aTargets)
: mWidget(aWidget),
mPresShell(aPresShell),
mInputBlockId(aInputBlockId),
@ -848,7 +839,7 @@ APZCCallbackHelper::SendSetTargetAPZCNotification(nsIWidget* aWidget,
rootFrame = UpdateRootFrameForTouchTargetDocument(rootFrame);
bool waitForRefresh = false;
nsTArray<SLGuidAndRenderRoot> targets;
nsTArray<ScrollableLayerGuid> targets;
if (const WidgetTouchEvent* touchEvent = aEvent.AsTouchEvent()) {
for (size_t i = 0; i < touchEvent->mTouches.Length(); i++) {

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

@ -9,7 +9,6 @@
#include "InputData.h"
#include "LayersTypes.h"
#include "mozilla/EventForwards.h"
#include "mozilla/layers/APZTypes.h"
#include "mozilla/layers/APZUtils.h"
#include "mozilla/layers/MatrixMessage.h"
#include "mozilla/layers/RepaintRequest.h"
@ -39,7 +38,7 @@ class DisplayportSetListener : public nsAPostRefreshObserver {
public:
DisplayportSetListener(nsIWidget* aWidget, PresShell* aPresShell,
const uint64_t& aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets);
const nsTArray<ScrollableLayerGuid>& aTargets);
virtual ~DisplayportSetListener();
bool Register();
void DidRefresh() override;
@ -48,7 +47,7 @@ class DisplayportSetListener : public nsAPostRefreshObserver {
RefPtr<nsIWidget> mWidget;
RefPtr<PresShell> mPresShell;
uint64_t mInputBlockId;
nsTArray<SLGuidAndRenderRoot> mTargets;
nsTArray<ScrollableLayerGuid> mTargets;
};
/* This class contains some helper methods that facilitate implementing the

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

@ -153,11 +153,10 @@ void ChromeProcessController::HandleDoubleTap(
if (APZCCallbackHelper::GetOrCreateScrollIdentifiers(
document->GetDocumentElement(), &presShellId, &viewId)) {
APZThreadUtils::RunOnControllerThread(
NewRunnableMethod<SLGuidAndRenderRoot, CSSRect, uint32_t>(
NewRunnableMethod<ScrollableLayerGuid, CSSRect, uint32_t>(
"IAPZCTreeManager::ZoomToRect", mAPZCTreeManager,
&IAPZCTreeManager::ZoomToRect,
SLGuidAndRenderRoot(aGuid.mLayersId, presShellId, viewId,
wr::RenderRoot::Default),
ScrollableLayerGuid(aGuid.mLayersId, presShellId, viewId),
zoomToRect, ZoomToRectBehavior::DEFAULT_BEHAVIOR));
}
}

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

@ -48,7 +48,7 @@ void APZCTreeManagerChild::SetKeyboardMap(const KeyboardMap& aKeyboardMap) {
SendSetKeyboardMap(aKeyboardMap);
}
void APZCTreeManagerChild::ZoomToRect(const SLGuidAndRenderRoot& aGuid,
void APZCTreeManagerChild::ZoomToRect(const ScrollableLayerGuid& aGuid,
const CSSRect& aRect,
const uint32_t aFlags) {
SendZoomToRect(aGuid, aRect, aFlags);
@ -60,12 +60,12 @@ void APZCTreeManagerChild::ContentReceivedInputBlock(uint64_t aInputBlockId,
}
void APZCTreeManagerChild::SetTargetAPZC(
uint64_t aInputBlockId, const nsTArray<SLGuidAndRenderRoot>& aTargets) {
uint64_t aInputBlockId, const nsTArray<ScrollableLayerGuid>& aTargets) {
SendSetTargetAPZC(aInputBlockId, aTargets);
}
void APZCTreeManagerChild::UpdateZoomConstraints(
const SLGuidAndRenderRoot& aGuid,
const ScrollableLayerGuid& aGuid,
const Maybe<ZoomConstraints>& aConstraints) {
if (mIPCOpen) {
SendUpdateZoomConstraints(aGuid, aConstraints);
@ -80,16 +80,16 @@ void APZCTreeManagerChild::SetAllowedTouchBehavior(
}
void APZCTreeManagerChild::StartScrollbarDrag(
const SLGuidAndRenderRoot& aGuid, const AsyncDragMetrics& aDragMetrics) {
const ScrollableLayerGuid& aGuid, const AsyncDragMetrics& aDragMetrics) {
SendStartScrollbarDrag(aGuid, aDragMetrics);
}
bool APZCTreeManagerChild::StartAutoscroll(const SLGuidAndRenderRoot& aGuid,
bool APZCTreeManagerChild::StartAutoscroll(const ScrollableLayerGuid& aGuid,
const ScreenPoint& aAnchorLocation) {
return SendStartAutoscroll(aGuid, aAnchorLocation);
}
void APZCTreeManagerChild::StopAutoscroll(const SLGuidAndRenderRoot& aGuid) {
void APZCTreeManagerChild::StopAutoscroll(const ScrollableLayerGuid& aGuid) {
SendStopAutoscroll(aGuid);
}

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

@ -30,17 +30,17 @@ class APZCTreeManagerChild : public IAPZCTreeManager,
void SetKeyboardMap(const KeyboardMap& aKeyboardMap) override;
void ZoomToRect(const SLGuidAndRenderRoot& aGuid, const CSSRect& aRect,
void ZoomToRect(const ScrollableLayerGuid& aGuid, const CSSRect& aRect,
const uint32_t aFlags = DEFAULT_BEHAVIOR) override;
void ContentReceivedInputBlock(uint64_t aInputBlockId,
bool aPreventDefault) override;
void SetTargetAPZC(uint64_t aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) override;
const nsTArray<ScrollableLayerGuid>& aTargets) override;
void UpdateZoomConstraints(
const SLGuidAndRenderRoot& aGuid,
const ScrollableLayerGuid& aGuid,
const Maybe<ZoomConstraints>& aConstraints) override;
void SetDPI(float aDpiValue) override;
@ -49,13 +49,13 @@ class APZCTreeManagerChild : public IAPZCTreeManager,
uint64_t aInputBlockId,
const nsTArray<TouchBehaviorFlags>& aValues) override;
void StartScrollbarDrag(const SLGuidAndRenderRoot& aGuid,
void StartScrollbarDrag(const ScrollableLayerGuid& aGuid,
const AsyncDragMetrics& aDragMetrics) override;
bool StartAutoscroll(const SLGuidAndRenderRoot& aGuid,
bool StartAutoscroll(const ScrollableLayerGuid& aGuid,
const ScreenPoint& aAnchorLocation) override;
void StopAutoscroll(const SLGuidAndRenderRoot& aGuid) override;
void StopAutoscroll(const ScrollableLayerGuid& aGuid) override;
void SetLongTapEnabled(bool aTapGestureEnabled) override;

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

@ -46,15 +46,15 @@ mozilla::ipc::IPCResult APZCTreeManagerParent::RecvSetKeyboardMap(
}
mozilla::ipc::IPCResult APZCTreeManagerParent::RecvZoomToRect(
const SLGuidAndRenderRoot& aGuid, const CSSRect& aRect,
const ScrollableLayerGuid& aGuid, const CSSRect& aRect,
const uint32_t& aFlags) {
if (!IsGuidValid(aGuid)) {
return IPC_FAIL_NO_REASON(this);
}
mUpdater->RunOnControllerThread(
aGuid.mScrollableLayerGuid.mLayersId,
NewRunnableMethod<SLGuidAndRenderRoot, CSSRect, uint32_t>(
aGuid.mLayersId,
NewRunnableMethod<ScrollableLayerGuid, CSSRect, uint32_t>(
"layers::IAPZCTreeManager::ZoomToRect", mTreeManager,
&IAPZCTreeManager::ZoomToRect, aGuid, aRect, aFlags));
return IPC_OK();
@ -72,11 +72,11 @@ mozilla::ipc::IPCResult APZCTreeManagerParent::RecvContentReceivedInputBlock(
}
mozilla::ipc::IPCResult APZCTreeManagerParent::RecvSetTargetAPZC(
const uint64_t& aInputBlockId, nsTArray<SLGuidAndRenderRoot>&& aTargets) {
const uint64_t& aInputBlockId, nsTArray<ScrollableLayerGuid>&& aTargets) {
mUpdater->RunOnControllerThread(
mLayersId,
NewRunnableMethod<uint64_t,
StoreCopyPassByRRef<nsTArray<SLGuidAndRenderRoot>>>(
StoreCopyPassByRRef<nsTArray<ScrollableLayerGuid>>>(
"layers::IAPZCTreeManager::SetTargetAPZC", mTreeManager,
&IAPZCTreeManager::SetTargetAPZC, aInputBlockId, aTargets));
@ -84,7 +84,7 @@ mozilla::ipc::IPCResult APZCTreeManagerParent::RecvSetTargetAPZC(
}
mozilla::ipc::IPCResult APZCTreeManagerParent::RecvUpdateZoomConstraints(
const SLGuidAndRenderRoot& aGuid,
const ScrollableLayerGuid& aGuid,
const MaybeZoomConstraints& aConstraints) {
if (!IsGuidValid(aGuid)) {
return IPC_FAIL_NO_REASON(this);
@ -117,14 +117,14 @@ mozilla::ipc::IPCResult APZCTreeManagerParent::RecvSetAllowedTouchBehavior(
}
mozilla::ipc::IPCResult APZCTreeManagerParent::RecvStartScrollbarDrag(
const SLGuidAndRenderRoot& aGuid, const AsyncDragMetrics& aDragMetrics) {
const ScrollableLayerGuid& aGuid, const AsyncDragMetrics& aDragMetrics) {
if (!IsGuidValid(aGuid)) {
return IPC_FAIL_NO_REASON(this);
}
mUpdater->RunOnControllerThread(
aGuid.mScrollableLayerGuid.mLayersId,
NewRunnableMethod<SLGuidAndRenderRoot, AsyncDragMetrics>(
aGuid.mLayersId,
NewRunnableMethod<ScrollableLayerGuid, AsyncDragMetrics>(
"layers::IAPZCTreeManager::StartScrollbarDrag", mTreeManager,
&IAPZCTreeManager::StartScrollbarDrag, aGuid, aDragMetrics));
@ -132,7 +132,7 @@ mozilla::ipc::IPCResult APZCTreeManagerParent::RecvStartScrollbarDrag(
}
mozilla::ipc::IPCResult APZCTreeManagerParent::RecvStartAutoscroll(
const SLGuidAndRenderRoot& aGuid, const ScreenPoint& aAnchorLocation) {
const ScrollableLayerGuid& aGuid, const ScreenPoint& aAnchorLocation) {
// Unlike RecvStartScrollbarDrag(), this message comes from the parent
// process (via nsBaseWidget::mAPZC) rather than from the child process
// (via BrowserChild::mApzcTreeManager), so there is no need to check the
@ -142,7 +142,7 @@ mozilla::ipc::IPCResult APZCTreeManagerParent::RecvStartAutoscroll(
mUpdater->RunOnControllerThread(
mLayersId,
NewRunnableMethod<SLGuidAndRenderRoot, ScreenPoint>(
NewRunnableMethod<ScrollableLayerGuid, ScreenPoint>(
"layers::IAPZCTreeManager::StartAutoscroll", mTreeManager,
&IAPZCTreeManager::StartAutoscroll, aGuid, aAnchorLocation));
@ -150,11 +150,11 @@ mozilla::ipc::IPCResult APZCTreeManagerParent::RecvStartAutoscroll(
}
mozilla::ipc::IPCResult APZCTreeManagerParent::RecvStopAutoscroll(
const SLGuidAndRenderRoot& aGuid) {
const ScrollableLayerGuid& aGuid) {
// See RecvStartAutoscroll() for why we don't check the layers id.
mUpdater->RunOnControllerThread(
mLayersId, NewRunnableMethod<SLGuidAndRenderRoot>(
mLayersId, NewRunnableMethod<ScrollableLayerGuid>(
"layers::IAPZCTreeManager::StopAutoscroll", mTreeManager,
&IAPZCTreeManager::StopAutoscroll, aGuid));
@ -172,8 +172,8 @@ mozilla::ipc::IPCResult APZCTreeManagerParent::RecvSetLongTapEnabled(
return IPC_OK();
}
bool APZCTreeManagerParent::IsGuidValid(const SLGuidAndRenderRoot& aGuid) {
if (aGuid.mScrollableLayerGuid.mLayersId != mLayersId) {
bool APZCTreeManagerParent::IsGuidValid(const ScrollableLayerGuid& aGuid) {
if (aGuid.mLayersId != mLayersId) {
NS_ERROR("Unexpected layers id");
return false;
}

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

@ -33,7 +33,7 @@ class APZCTreeManagerParent : public PAPZCTreeManagerParent {
mozilla::ipc::IPCResult RecvSetKeyboardMap(const KeyboardMap& aKeyboardMap);
mozilla::ipc::IPCResult RecvZoomToRect(const SLGuidAndRenderRoot& aGuid,
mozilla::ipc::IPCResult RecvZoomToRect(const ScrollableLayerGuid& aGuid,
const CSSRect& aRect,
const uint32_t& aFlags);
@ -41,10 +41,10 @@ class APZCTreeManagerParent : public PAPZCTreeManagerParent {
const uint64_t& aInputBlockId, const bool& aPreventDefault);
mozilla::ipc::IPCResult RecvSetTargetAPZC(
const uint64_t& aInputBlockId, nsTArray<SLGuidAndRenderRoot>&& aTargets);
const uint64_t& aInputBlockId, nsTArray<ScrollableLayerGuid>&& aTargets);
mozilla::ipc::IPCResult RecvUpdateZoomConstraints(
const SLGuidAndRenderRoot& aGuid,
const ScrollableLayerGuid& aGuid,
const MaybeZoomConstraints& aConstraints);
mozilla::ipc::IPCResult RecvSetDPI(const float& aDpiValue);
@ -53,19 +53,19 @@ class APZCTreeManagerParent : public PAPZCTreeManagerParent {
const uint64_t& aInputBlockId, nsTArray<TouchBehaviorFlags>&& aValues);
mozilla::ipc::IPCResult RecvStartScrollbarDrag(
const SLGuidAndRenderRoot& aGuid, const AsyncDragMetrics& aDragMetrics);
const ScrollableLayerGuid& aGuid, const AsyncDragMetrics& aDragMetrics);
mozilla::ipc::IPCResult RecvStartAutoscroll(
const SLGuidAndRenderRoot& aGuid, const ScreenPoint& aAnchorLocation);
const ScrollableLayerGuid& aGuid, const ScreenPoint& aAnchorLocation);
mozilla::ipc::IPCResult RecvStopAutoscroll(const SLGuidAndRenderRoot& aGuid);
mozilla::ipc::IPCResult RecvStopAutoscroll(const ScrollableLayerGuid& aGuid);
mozilla::ipc::IPCResult RecvSetLongTapEnabled(const bool& aTapGestureEnabled);
void ActorDestroy(ActorDestroyReason aWhy) override {}
private:
bool IsGuidValid(const SLGuidAndRenderRoot& aGuid);
bool IsGuidValid(const ScrollableLayerGuid& aGuid);
LayersId mLayersId;
RefPtr<APZCTreeManager> mTreeManager;

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

@ -1428,16 +1428,16 @@ void CompositorBridgeParent::GetAPZTestData(const LayersId& aLayersId,
void CompositorBridgeParent::SetConfirmedTargetAPZC(
const LayersId& aLayersId, const uint64_t& aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) {
const nsTArray<ScrollableLayerGuid>& aTargets) {
if (!mApzcTreeManager || !mApzUpdater) {
return;
}
// Need to specifically bind this since it's overloaded.
void (APZCTreeManager::*setTargetApzcFunc)(
uint64_t, const nsTArray<SLGuidAndRenderRoot>&) =
uint64_t, const nsTArray<ScrollableLayerGuid>&) =
&APZCTreeManager::SetTargetAPZC;
RefPtr<Runnable> task = NewRunnableMethod<
uint64_t, StoreCopyPassByConstLRef<nsTArray<SLGuidAndRenderRoot>>>(
uint64_t, StoreCopyPassByConstLRef<nsTArray<ScrollableLayerGuid>>>(
"layers::CompositorBridgeParent::SetConfirmedTargetAPZC",
mApzcTreeManager.get(), setTargetApzcFunc, aInputBlockId, aTargets);
mApzUpdater->RunOnControllerThread(aLayersId, task.forget());

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

@ -149,7 +149,7 @@ class CompositorBridgeParentBase : public PCompositorBridgeParent,
APZTestData* aOutData) {}
virtual void SetConfirmedTargetAPZC(
const LayersId& aLayersId, const uint64_t& aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) = 0;
const nsTArray<ScrollableLayerGuid>& aTargets) = 0;
virtual void UpdatePaintTime(LayerTransactionParent* aLayerTree,
const TimeDuration& aPaintTime) {}
virtual void RegisterPayloads(LayerTransactionParent* aLayerTree,
@ -421,7 +421,7 @@ class CompositorBridgeParent final : public CompositorBridgeParentBase,
APZTestData* aOutData) override;
void SetConfirmedTargetAPZC(
const LayersId& aLayersId, const uint64_t& aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) override;
const nsTArray<ScrollableLayerGuid>& aTargets) override;
AsyncCompositionManager* GetCompositionManager(
LayerTransactionParent* aLayerTree) override {
return mCompositionManager;

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

@ -564,7 +564,7 @@ void ContentCompositorBridgeParent::GetAPZTestData(const LayersId& aLayersId,
void ContentCompositorBridgeParent::SetConfirmedTargetAPZC(
const LayersId& aLayersId, const uint64_t& aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) {
const nsTArray<ScrollableLayerGuid>& aTargets) {
MOZ_ASSERT(aLayersId.IsValid());
const CompositorBridgeParent::LayerTreeState* state =
CompositorBridgeParent::GetIndirectShadowTree(aLayersId);

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

@ -153,7 +153,7 @@ class ContentCompositorBridgeParent final : public CompositorBridgeParentBase {
APZTestData* aOutData) override;
void SetConfirmedTargetAPZC(
const LayersId& aLayersId, const uint64_t& aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) override;
const nsTArray<ScrollableLayerGuid>& aTargets) override;
AsyncCompositionManager* GetCompositionManager(
LayerTransactionParent* aParent) override;

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

@ -780,16 +780,10 @@ mozilla::ipc::IPCResult LayerTransactionParent::RecvRequestProperty(
}
mozilla::ipc::IPCResult LayerTransactionParent::RecvSetConfirmedTargetAPZC(
const uint64_t& aBlockId, nsTArray<SLGuidAndRenderRoot>&& aTargets) {
const uint64_t& aBlockId, nsTArray<ScrollableLayerGuid>&& aTargets) {
for (size_t i = 0; i < aTargets.Length(); i++) {
// Guard against bad data from hijacked child processes
if (aTargets[i].mRenderRoot != wr::RenderRoot::Default) {
NS_ERROR(
"Unexpected render root in RecvSetConfirmedTargetAPZC; dropping "
"message...");
return IPC_FAIL(this, "Bad render root");
}
if (aTargets[i].mScrollableLayerGuid.mLayersId != GetId()) {
if (aTargets[i].mLayersId != GetId()) {
NS_ERROR(
"Unexpected layers id in RecvSetConfirmedTargetAPZC; dropping "
"message...");

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

@ -130,7 +130,7 @@ class LayerTransactionParent final : public PLayerTransactionParent,
mozilla::ipc::IPCResult RecvRequestProperty(const nsString& aProperty,
float* aValue);
mozilla::ipc::IPCResult RecvSetConfirmedTargetAPZC(
const uint64_t& aBlockId, nsTArray<SLGuidAndRenderRoot>&& aTargets);
const uint64_t& aBlockId, nsTArray<ScrollableLayerGuid>&& aTargets);
mozilla::ipc::IPCResult RecvRecordPaintTimes(const PaintTiming& aTiming);
mozilla::ipc::IPCResult RecvGetTextureFactoryIdentifier(
TextureFactoryIdentifier* aIdentifier);

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

@ -23,7 +23,6 @@
#include "mozilla/ServoBindings.h"
#include "mozilla/ipc/ByteBufUtils.h"
#include "mozilla/layers/APZInputBridge.h"
#include "mozilla/layers/APZTypes.h"
#include "mozilla/layers/AsyncDragMetrics.h"
#include "mozilla/layers/CompositorOptions.h"
#include "mozilla/layers/CompositorTypes.h"
@ -557,22 +556,6 @@ struct ParamTraits<mozilla::layers::APZEventResult> {
}
};
template <>
struct ParamTraits<mozilla::layers::SLGuidAndRenderRoot> {
typedef mozilla::layers::SLGuidAndRenderRoot paramType;
static void Write(Message* aMsg, const paramType& aParam) {
WriteParam(aMsg, aParam.mScrollableLayerGuid);
WriteParam(aMsg, aParam.mRenderRoot);
}
static bool Read(const Message* aMsg, PickleIterator* aIter,
paramType* aResult) {
return (ReadParam(aMsg, aIter, &aResult->mScrollableLayerGuid) &&
ReadParam(aMsg, aIter, &aResult->mRenderRoot));
}
};
template <>
struct ParamTraits<mozilla::layers::ZoomConstraints> {
typedef mozilla::layers::ZoomConstraints paramType;

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

@ -14,9 +14,8 @@ using LayoutDeviceCoord from "Units.h";
using mozilla::LayoutDevicePoint from "Units.h";
using ScreenPoint from "Units.h";
using mozilla::layers::MaybeZoomConstraints from "mozilla/layers/ZoomConstraints.h";
using struct mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h";
using mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h";
using mozilla::layers::ScrollableLayerGuid::ViewID from "mozilla/layers/ScrollableLayerGuid.h";
using struct mozilla::layers::SLGuidAndRenderRoot from "mozilla/layers/APZTypes.h";
using mozilla::layers::TouchBehaviorFlags from "mozilla/layers/LayersTypes.h";
using mozilla::layers::AsyncDragMetrics from "mozilla/layers/AsyncDragMetrics.h";
using mozilla::layers::GeckoContentController::TapType from "mozilla/layers/GeckoContentController.h";
@ -47,13 +46,13 @@ parent:
// These messages correspond to the methods
// on the IAPZCTreeManager interface
async ZoomToRect(SLGuidAndRenderRoot aGuid, CSSRect aRect, uint32_t Flags);
async ZoomToRect(ScrollableLayerGuid aGuid, CSSRect aRect, uint32_t Flags);
async ContentReceivedInputBlock(uint64_t aInputBlockId, bool PreventDefault);
async SetTargetAPZC(uint64_t aInputBlockId, SLGuidAndRenderRoot[] Targets);
async SetTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] Targets);
async UpdateZoomConstraints(SLGuidAndRenderRoot aGuid, MaybeZoomConstraints aConstraints);
async UpdateZoomConstraints(ScrollableLayerGuid aGuid, MaybeZoomConstraints aConstraints);
async SetKeyboardMap(KeyboardMap aKeyboardMap);
@ -61,11 +60,11 @@ parent:
async SetAllowedTouchBehavior(uint64_t aInputBlockId, TouchBehaviorFlags[] aValues);
async StartScrollbarDrag(SLGuidAndRenderRoot aGuid, AsyncDragMetrics aDragMetrics);
async StartScrollbarDrag(ScrollableLayerGuid aGuid, AsyncDragMetrics aDragMetrics);
async StartAutoscroll(SLGuidAndRenderRoot aGuid, ScreenPoint aAnchorLocation);
async StartAutoscroll(ScrollableLayerGuid aGuid, ScreenPoint aAnchorLocation);
async StopAutoscroll(SLGuidAndRenderRoot aGuid);
async StopAutoscroll(ScrollableLayerGuid aGuid);
async SetLongTapEnabled(bool aTapGestureEnabled);

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

@ -17,8 +17,8 @@ using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
using class mozilla::layers::APZTestData from "mozilla/layers/APZTestData.h";
using mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h";
using mozilla::layers::ScrollableLayerGuid::ViewID from "mozilla/layers/ScrollableLayerGuid.h";
using struct mozilla::layers::SLGuidAndRenderRoot from "mozilla/layers/APZTypes.h";
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h";
using mozilla::layers::LayerHandle from "mozilla/layers/LayersTypes.h";
@ -66,7 +66,7 @@ parent:
// Tell the compositor to notify APZ that a layer has been confirmed for an
// input event.
async SetConfirmedTargetAPZC(uint64_t aInputBlockId, SLGuidAndRenderRoot[] aTargets);
async SetConfirmedTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);
// Testing APIs

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

@ -15,7 +15,7 @@ include protocol PCompositorBridge;
include protocol PTexture;
using mozilla::layers::APZTestData from "mozilla/layers/APZTestData.h";
using struct mozilla::layers::SLGuidAndRenderRoot from "mozilla/layers/APZTypes.h";
using mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h";
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
using mozilla::layers::CompositionPayload from "mozilla/layers/LayersTypes.h";
@ -83,7 +83,7 @@ parent:
// These correspond exactly to the equivalent APIs in PLayerTransaction -
// see those for documentation.
async SetConfirmedTargetAPZC(uint64_t aInputBlockId, SLGuidAndRenderRoot[] aTargets);
async SetConfirmedTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);
// More copied from PLayerTransaction, but these are only used for testing.
sync SetTestSampleTime(TimeStamp sampleTime);
sync LeaveTestMode();

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

@ -95,7 +95,6 @@ EXPORTS.mozilla.layers += [
'AnimationInfo.h',
'apz/public/APZInputBridge.h',
'apz/public/APZSampler.h',
'apz/public/APZTypes.h',
'apz/public/APZUpdater.h',
'apz/public/CompositorController.h',
'apz/public/GeckoContentController.h',

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

@ -2141,17 +2141,10 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvSyncWithCompositor() {
}
mozilla::ipc::IPCResult WebRenderBridgeParent::RecvSetConfirmedTargetAPZC(
const uint64_t& aBlockId, nsTArray<SLGuidAndRenderRoot>&& aTargets) {
const uint64_t& aBlockId, nsTArray<ScrollableLayerGuid>&& aTargets) {
for (size_t i = 0; i < aTargets.Length(); i++) {
// Guard against bad data from hijacked child processes
if (aTargets[i].mRenderRoot > wr::kHighestRenderRoot ||
aTargets[i].mRenderRoot != wr::RenderRoot::Default) {
NS_ERROR(
"Unexpected render root in RecvSetConfirmedTargetAPZC; dropping "
"message...");
return IPC_FAIL(this, "Bad render root");
}
if (aTargets[i].mScrollableLayerGuid.mLayersId != GetLayersId()) {
if (aTargets[i].mLayersId != GetLayersId()) {
NS_ERROR(
"Unexpected layers id in RecvSetConfirmedTargetAPZC; dropping "
"message...");

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

@ -197,7 +197,7 @@ class WebRenderBridgeParent final
mozilla::ipc::IPCResult RecvSetConfirmedTargetAPZC(
const uint64_t& aBlockId,
nsTArray<SLGuidAndRenderRoot>&& aTargets) override;
nsTArray<ScrollableLayerGuid>&& aTargets) override;
mozilla::ipc::IPCResult RecvSetTestSampleTime(
const TimeStamp& aTime) override;

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

@ -510,7 +510,7 @@ nsresult PuppetWidget::ClearNativeTouchSequence(nsIObserver* aObserver) {
void PuppetWidget::SetConfirmedTargetAPZC(
uint64_t aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) const {
const nsTArray<ScrollableLayerGuid>& aTargets) const {
if (mBrowserChild) {
mBrowserChild->SetTargetAPZC(aInputBlockId, aTargets);
}

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

@ -148,7 +148,7 @@ class PuppetWidget : public nsBaseWidget,
nsEventStatus DispatchInputEvent(WidgetInputEvent* aEvent) override;
void SetConfirmedTargetAPZC(
uint64_t aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) const override;
const nsTArray<ScrollableLayerGuid>& aTargets) const override;
void UpdateZoomConstraints(
const uint32_t& aPresShellId, const ScrollableLayerGuid::ViewID& aViewId,
const mozilla::Maybe<ZoomConstraints>& aConstraints) override;

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

@ -923,10 +923,10 @@ void nsBaseWidget::ConfigureAPZControllerThread() {
void nsBaseWidget::SetConfirmedTargetAPZC(
uint64_t aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) const {
const nsTArray<ScrollableLayerGuid>& aTargets) const {
APZThreadUtils::RunOnControllerThread(
NewRunnableMethod<uint64_t,
StoreCopyPassByRRef<nsTArray<SLGuidAndRenderRoot>>>(
StoreCopyPassByRRef<nsTArray<ScrollableLayerGuid>>>(
"layers::IAPZCTreeManager::SetTargetAPZC", mAPZC,
&IAPZCTreeManager::SetTargetAPZC, aInputBlockId, aTargets));
}
@ -953,9 +953,7 @@ void nsBaseWidget::UpdateZoomConstraints(
}
LayersId layersId = mCompositorSession->RootLayerTreeId();
mAPZC->UpdateZoomConstraints(
SLGuidAndRenderRoot(layersId, aPresShellId, aViewId,
wr::RenderRoot::Default),
aConstraints);
ScrollableLayerGuid(layersId, aPresShellId, aViewId), aConstraints);
}
bool nsBaseWidget::AsyncPanZoomEnabled() const { return !!mAPZC; }
@ -1786,12 +1784,10 @@ void nsBaseWidget::ZoomToRect(const uint32_t& aPresShellId,
}
LayersId layerId = mCompositorSession->RootLayerTreeId();
APZThreadUtils::RunOnControllerThread(
NewRunnableMethod<SLGuidAndRenderRoot, CSSRect, uint32_t>(
NewRunnableMethod<ScrollableLayerGuid, CSSRect, uint32_t>(
"layers::IAPZCTreeManager::ZoomToRect", mAPZC,
&IAPZCTreeManager::ZoomToRect,
SLGuidAndRenderRoot(layerId, aPresShellId, aViewId,
wr::RenderRoot::Default),
aRect, aFlags));
ScrollableLayerGuid(layerId, aPresShellId, aViewId), aRect, aFlags));
}
#ifdef ACCESSIBILITY
@ -1829,23 +1825,23 @@ void nsBaseWidget::StartAsyncScrollbarDrag(
MOZ_ASSERT(XRE_IsParentProcess() && mCompositorSession);
LayersId layersId = mCompositorSession->RootLayerTreeId();
SLGuidAndRenderRoot guid(layersId, aDragMetrics.mPresShellId,
aDragMetrics.mViewId, wr::RenderRoot::Default);
ScrollableLayerGuid guid(layersId, aDragMetrics.mPresShellId,
aDragMetrics.mViewId);
APZThreadUtils::RunOnControllerThread(
NewRunnableMethod<SLGuidAndRenderRoot, AsyncDragMetrics>(
NewRunnableMethod<ScrollableLayerGuid, AsyncDragMetrics>(
"layers::IAPZCTreeManager::StartScrollbarDrag", mAPZC,
&IAPZCTreeManager::StartScrollbarDrag, guid, aDragMetrics));
}
bool nsBaseWidget::StartAsyncAutoscroll(const ScreenPoint& aAnchorLocation,
const SLGuidAndRenderRoot& aGuid) {
const ScrollableLayerGuid& aGuid) {
MOZ_ASSERT(XRE_IsParentProcess() && AsyncPanZoomEnabled());
return mAPZC->StartAutoscroll(aGuid, aAnchorLocation);
}
void nsBaseWidget::StopAsyncAutoscroll(const SLGuidAndRenderRoot& aGuid) {
void nsBaseWidget::StopAsyncAutoscroll(const ScrollableLayerGuid& aGuid) {
MOZ_ASSERT(XRE_IsParentProcess() && AsyncPanZoomEnabled());
mAPZC->StopAutoscroll(aGuid);

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

@ -128,7 +128,6 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
typedef mozilla::layers::CompositorBridgeParent CompositorBridgeParent;
typedef mozilla::layers::IAPZCTreeManager IAPZCTreeManager;
typedef mozilla::layers::GeckoContentController GeckoContentController;
typedef mozilla::layers::SLGuidAndRenderRoot SLGuidAndRenderRoot;
typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
typedef mozilla::layers::APZEventState APZEventState;
typedef mozilla::layers::SetAllowedTouchBehaviorCallback
@ -330,7 +329,7 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
void SetConfirmedTargetAPZC(
uint64_t aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) const override;
const nsTArray<ScrollableLayerGuid>& aTargets) const override;
void UpdateZoomConstraints(
const uint32_t& aPresShellId, const ScrollableLayerGuid::ViewID& aViewId,
@ -386,9 +385,9 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
const AsyncDragMetrics& aDragMetrics) override;
virtual bool StartAsyncAutoscroll(const ScreenPoint& aAnchorLocation,
const SLGuidAndRenderRoot& aGuid) override;
const ScrollableLayerGuid& aGuid) override;
virtual void StopAsyncAutoscroll(const SLGuidAndRenderRoot& aGuid) override;
virtual void StopAsyncAutoscroll(const ScrollableLayerGuid& aGuid) override;
/**
* Use this when GetLayerManager() returns a BasicLayerManager

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

@ -67,7 +67,6 @@ struct FrameMetrics;
class LayerManager;
class LayerManagerComposite;
class PLayerTransactionChild;
struct SLGuidAndRenderRoot;
class WebRenderBridgeChild;
} // namespace layers
namespace gfx {
@ -352,7 +351,6 @@ class nsIWidget : public nsISupports {
typedef mozilla::layers::LayerManagerComposite LayerManagerComposite;
typedef mozilla::layers::LayersBackend LayersBackend;
typedef mozilla::layers::PLayerTransactionChild PLayerTransactionChild;
typedef mozilla::layers::SLGuidAndRenderRoot SLGuidAndRenderRoot;
typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
typedef mozilla::layers::ZoomConstraints ZoomConstraints;
typedef mozilla::widget::IMEMessage IMEMessage;
@ -1437,7 +1435,7 @@ class nsIWidget : public nsISupports {
*/
virtual void SetConfirmedTargetAPZC(
uint64_t aInputBlockId,
const nsTArray<SLGuidAndRenderRoot>& aTargets) const = 0;
const nsTArray<ScrollableLayerGuid>& aTargets) const = 0;
/**
* Returns true if APZ is in use, false otherwise.
@ -1704,13 +1702,13 @@ class nsIWidget : public nsISupports {
* @return true if APZ has been successfully notified
*/
virtual bool StartAsyncAutoscroll(const ScreenPoint& aAnchorLocation,
const SLGuidAndRenderRoot& aGuid) = 0;
const ScrollableLayerGuid& aGuid) = 0;
/**
* Notify APZ to stop autoscrolling.
* @param aGuid identifies the scroll frame which is being autoscrolled.
*/
virtual void StopAsyncAutoscroll(const SLGuidAndRenderRoot& aGuid) = 0;
virtual void StopAsyncAutoscroll(const ScrollableLayerGuid& aGuid) = 0;
// If this widget supports out-of-process compositing, it can override
// this method to provide additional information to the compositor.