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

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

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

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

@ -3556,8 +3556,7 @@ bool BrowserParent::StartApzAutoscroll(float aAnchorX, float aAnchorY,
if (mRemoteLayerTreeOwner.IsInitialized()) { if (mRemoteLayerTreeOwner.IsInitialized()) {
layers::LayersId layersId = mRemoteLayerTreeOwner.GetLayersId(); layers::LayersId layersId = mRemoteLayerTreeOwner.GetLayersId();
if (nsCOMPtr<nsIWidget> widget = GetWidget()) { if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
SLGuidAndRenderRoot guid(layersId, aPresShellId, aScrollId, ScrollableLayerGuid guid(layersId, aPresShellId, aScrollId);
gfxUtils::GetContentRenderRoot());
// The anchor coordinates that are passed in are relative to the origin // 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 // 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()) { if (mRemoteLayerTreeOwner.IsInitialized()) {
layers::LayersId layersId = mRemoteLayerTreeOwner.GetLayersId(); layers::LayersId layersId = mRemoteLayerTreeOwner.GetLayersId();
if (nsCOMPtr<nsIWidget> widget = GetWidget()) { if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
SLGuidAndRenderRoot guid(layersId, aPresShellId, aScrollId, ScrollableLayerGuid guid(layersId, aPresShellId, aScrollId);
gfxUtils::GetContentRenderRoot());
widget->StopAsyncAutoscroll(guid); widget->StopAsyncAutoscroll(guid);
} }

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

@ -267,13 +267,6 @@ void AppendToString(std::stringstream& aStream, const ScrollableLayerGuid& s,
<< sfx; << 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, void AppendToString(std::stringstream& aStream, const ZoomConstraints& z,
const char* pfx, const char* sfx) { const char* pfx, const char* sfx) {
aStream << pfx aStream << pfx

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

@ -12,7 +12,6 @@
#include "mozilla/gfx/Point.h" // for IntSize, etc #include "mozilla/gfx/Point.h" // for IntSize, etc
#include "mozilla/gfx/TiledRegion.h" // for TiledRegion #include "mozilla/gfx/TiledRegion.h" // for TiledRegion
#include "mozilla/gfx/Types.h" // for SamplingFilter, SurfaceFormat #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/CompositorTypes.h" // for TextureFlags
#include "mozilla/layers/WebRenderLayersLogging.h" #include "mozilla/layers/WebRenderLayersLogging.h"
#include "mozilla/layers/ZoomConstraints.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, void AppendToString(std::stringstream& aStream, const ScrollableLayerGuid& s,
const char* pfx = "", const char* sfx = ""); 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, void AppendToString(std::stringstream& aStream, const ZoomConstraints& z,
const char* pfx = "", const char* sfx = ""); 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 "base/platform_thread.h" // for PlatformThreadId
#include "LayersTypes.h" #include "LayersTypes.h"
#include "APZTypes.h"
#include "mozilla/layers/APZTestData.h" #include "mozilla/layers/APZTestData.h"
#include "mozilla/layers/WebRenderScrollData.h" #include "mozilla/layers/WebRenderScrollData.h"
#include "mozilla/StaticMutex.h" #include "mozilla/StaticMutex.h"

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

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

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

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

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

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

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

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

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

@ -239,17 +239,6 @@ class TestAPZCTreeManager : public APZCTreeManager {
**/ **/
void CancelAnimation() { EXPECT_TRUE(false); } 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: protected:
AsyncPanZoomController* NewAPZCInstance( AsyncPanZoomController* NewAPZCInstance(
LayersId aLayersId, GeckoContentController* aController) override; LayersId aLayersId, GeckoContentController* aController) override;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -130,7 +130,7 @@ class LayerTransactionParent final : public PLayerTransactionParent,
mozilla::ipc::IPCResult RecvRequestProperty(const nsString& aProperty, mozilla::ipc::IPCResult RecvRequestProperty(const nsString& aProperty,
float* aValue); float* aValue);
mozilla::ipc::IPCResult RecvSetConfirmedTargetAPZC( 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 RecvRecordPaintTimes(const PaintTiming& aTiming);
mozilla::ipc::IPCResult RecvGetTextureFactoryIdentifier( mozilla::ipc::IPCResult RecvGetTextureFactoryIdentifier(
TextureFactoryIdentifier* aIdentifier); TextureFactoryIdentifier* aIdentifier);

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

@ -23,7 +23,6 @@
#include "mozilla/ServoBindings.h" #include "mozilla/ServoBindings.h"
#include "mozilla/ipc/ByteBufUtils.h" #include "mozilla/ipc/ByteBufUtils.h"
#include "mozilla/layers/APZInputBridge.h" #include "mozilla/layers/APZInputBridge.h"
#include "mozilla/layers/APZTypes.h"
#include "mozilla/layers/AsyncDragMetrics.h" #include "mozilla/layers/AsyncDragMetrics.h"
#include "mozilla/layers/CompositorOptions.h" #include "mozilla/layers/CompositorOptions.h"
#include "mozilla/layers/CompositorTypes.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 <> template <>
struct ParamTraits<mozilla::layers::ZoomConstraints> { struct ParamTraits<mozilla::layers::ZoomConstraints> {
typedef mozilla::layers::ZoomConstraints paramType; typedef mozilla::layers::ZoomConstraints paramType;

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

@ -14,9 +14,8 @@ using LayoutDeviceCoord from "Units.h";
using mozilla::LayoutDevicePoint from "Units.h"; using mozilla::LayoutDevicePoint from "Units.h";
using ScreenPoint from "Units.h"; using ScreenPoint from "Units.h";
using mozilla::layers::MaybeZoomConstraints from "mozilla/layers/ZoomConstraints.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 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::TouchBehaviorFlags from "mozilla/layers/LayersTypes.h";
using mozilla::layers::AsyncDragMetrics from "mozilla/layers/AsyncDragMetrics.h"; using mozilla::layers::AsyncDragMetrics from "mozilla/layers/AsyncDragMetrics.h";
using mozilla::layers::GeckoContentController::TapType from "mozilla/layers/GeckoContentController.h"; using mozilla::layers::GeckoContentController::TapType from "mozilla/layers/GeckoContentController.h";
@ -47,13 +46,13 @@ parent:
// These messages correspond to the methods // These messages correspond to the methods
// on the IAPZCTreeManager interface // 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 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); async SetKeyboardMap(KeyboardMap aKeyboardMap);
@ -61,11 +60,11 @@ parent:
async SetAllowedTouchBehavior(uint64_t aInputBlockId, TouchBehaviorFlags[] aValues); 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); 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::void_t from "ipc/IPCMessageUtils.h";
using struct mozilla::null_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 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 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 struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h"; using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h";
using mozilla::layers::LayerHandle 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 // Tell the compositor to notify APZ that a layer has been confirmed for an
// input event. // input event.
async SetConfirmedTargetAPZC(uint64_t aInputBlockId, SLGuidAndRenderRoot[] aTargets); async SetConfirmedTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);
// Testing APIs // Testing APIs

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

@ -15,7 +15,7 @@ include protocol PCompositorBridge;
include protocol PTexture; include protocol PTexture;
using mozilla::layers::APZTestData from "mozilla/layers/APZTestData.h"; 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::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h"; using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
using mozilla::layers::CompositionPayload from "mozilla/layers/LayersTypes.h"; using mozilla::layers::CompositionPayload from "mozilla/layers/LayersTypes.h";
@ -83,7 +83,7 @@ parent:
// These correspond exactly to the equivalent APIs in PLayerTransaction - // These correspond exactly to the equivalent APIs in PLayerTransaction -
// see those for documentation. // 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. // More copied from PLayerTransaction, but these are only used for testing.
sync SetTestSampleTime(TimeStamp sampleTime); sync SetTestSampleTime(TimeStamp sampleTime);
sync LeaveTestMode(); sync LeaveTestMode();

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

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

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

@ -2141,17 +2141,10 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvSyncWithCompositor() {
} }
mozilla::ipc::IPCResult WebRenderBridgeParent::RecvSetConfirmedTargetAPZC( 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++) { for (size_t i = 0; i < aTargets.Length(); i++) {
// Guard against bad data from hijacked child processes // Guard against bad data from hijacked child processes
if (aTargets[i].mRenderRoot > wr::kHighestRenderRoot || if (aTargets[i].mLayersId != GetLayersId()) {
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()) {
NS_ERROR( NS_ERROR(
"Unexpected layers id in RecvSetConfirmedTargetAPZC; dropping " "Unexpected layers id in RecvSetConfirmedTargetAPZC; dropping "
"message..."); "message...");

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

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

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

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

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

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

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

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

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

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

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

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