Bug 1622360 - Downgrade WRRootId to LayersId in some of APZCTreeManager. r=botond

Depends on D67868

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2020-03-23 22:05:48 +00:00
Родитель f5680c938b
Коммит d33180ab09
3 изменённых файлов: 21 добавлений и 21 удалений

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

@ -76,10 +76,10 @@ typedef CompositorBridgeParent::LayerTreeState LayerTreeState;
struct APZCTreeManager::TreeBuildingState {
TreeBuildingState(LayersId aRootLayersId, bool aIsFirstPaint,
WRRootId aOriginatingWrRootId, APZTestData* aTestData,
LayersId aOriginatingLayersId, APZTestData* aTestData,
uint32_t aPaintSequence)
: mIsFirstPaint(aIsFirstPaint),
mOriginatingWrRootId(aOriginatingWrRootId),
mOriginatingLayersId(aOriginatingLayersId),
mPaintLogger(aTestData, aPaintSequence) {
CompositorBridgeParent::CallWithIndirectShadowTree(
aRootLayersId, [this](LayerTreeState& aState) -> void {
@ -95,7 +95,7 @@ struct APZCTreeManager::TreeBuildingState {
RefPtr<CompositorController> mCompositorController;
RefPtr<MetricsSharingController> mInProcessSharingController;
const bool mIsFirstPaint;
const WRRootId mOriginatingWrRootId;
const LayersId mOriginatingLayersId;
const APZPaintLogHelper mPaintLogger;
// State that is updated as we perform the tree build
@ -371,7 +371,7 @@ template <class ScrollNode>
void // ScrollNode is a LayerMetricsWrapper or a WebRenderScrollDataWrapper
APZCTreeManager::UpdateHitTestingTreeImpl(const ScrollNode& aRoot,
bool aIsFirstPaint,
WRRootId aOriginatingWrRootId,
LayersId aOriginatingLayersId,
uint32_t aPaintSequenceNumber) {
RecursiveMutexAutoLock lock(mTreeLock);
@ -381,13 +381,13 @@ APZCTreeManager::UpdateHitTestingTreeImpl(const ScrollNode& aRoot,
if (StaticPrefs::apz_test_logging_enabled()) {
MutexAutoLock lock(mTestDataLock);
UniquePtr<APZTestData> ptr = MakeUnique<APZTestData>();
auto result = mTestData.insert(
std::make_pair(aOriginatingWrRootId.mLayersId, std::move(ptr)));
auto result =
mTestData.insert(std::make_pair(aOriginatingLayersId, std::move(ptr)));
testData = result.first->second.get();
testData->StartNewPaint(aPaintSequenceNumber);
}
TreeBuildingState state(mRootLayersId, aIsFirstPaint, aOriginatingWrRootId,
TreeBuildingState state(mRootLayersId, aIsFirstPaint, aOriginatingLayersId,
testData, aPaintSequenceNumber);
// We do this business with collecting the entire tree into an array because
@ -684,17 +684,16 @@ void APZCTreeManager::UpdateHitTestingTree(Layer* aRoot, bool aIsFirstPaint,
AssertOnUpdaterThread();
LayerMetricsWrapper root(aRoot);
UpdateHitTestingTreeImpl(root, aIsFirstPaint,
WRRootId::NonWebRender(aOriginatingLayersId),
UpdateHitTestingTreeImpl(root, aIsFirstPaint, aOriginatingLayersId,
aPaintSequenceNumber);
}
void APZCTreeManager::UpdateHitTestingTree(
const WebRenderScrollDataWrapper& aScrollWrapper, bool aIsFirstPaint,
WRRootId aOriginatingWrRootId, uint32_t aPaintSequenceNumber) {
LayersId aOriginatingLayersId, uint32_t aPaintSequenceNumber) {
AssertOnUpdaterThread();
UpdateHitTestingTreeImpl(aScrollWrapper, aIsFirstPaint, aOriginatingWrRootId,
UpdateHitTestingTreeImpl(aScrollWrapper, aIsFirstPaint, aOriginatingLayersId,
aPaintSequenceNumber);
}
@ -1306,9 +1305,8 @@ HitTestingTreeNode* APZCTreeManager::PrepareNodeForLayer(
"Using APZC %p for layer %p with identifiers %" PRIx64 " %" PRId64 "\n",
apzc, aLayer.GetLayer(), uint64_t(aLayersId), aMetrics.GetScrollId());
apzc->NotifyLayersUpdated(
aLayer.Metadata(), aState.mIsFirstPaint,
aLayersId == aState.mOriginatingWrRootId.mLayersId);
apzc->NotifyLayersUpdated(aLayer.Metadata(), aState.mIsFirstPaint,
aLayersId == aState.mOriginatingLayersId);
// Since this is the first time we are encountering an APZC with this guid,
// the node holding it must be the primary holder. It may be newly-created
@ -1332,7 +1330,7 @@ HitTestingTreeNode* APZCTreeManager::PrepareNodeForLayer(
// that originated the update, because the only identifying information
// we are logging about APZCs is the scroll id, and otherwise we could
// confuse APZCs from different layer trees with the same scroll id.
if (aLayersId == aState.mOriginatingWrRootId.mLayersId) {
if (aLayersId == aState.mOriginatingLayersId) {
if (apzc->HasNoParentWithSameLayersId()) {
aState.mPaintLogger.LogTestData(aMetrics.GetScrollId(),
"hasNoParentWithSameLayersId", true);

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

@ -184,7 +184,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
* shadow layers in that scenario.
*/
void UpdateHitTestingTree(const WebRenderScrollDataWrapper& aScrollWrapper,
bool aIsFirstPaint, WRRootId aOriginatingWrRootId,
bool aIsFirstPaint, LayersId aOriginatingLayersId,
uint32_t aPaintSequenceNumber);
/**
@ -634,7 +634,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
/* Helpers */
template <class ScrollNode>
void UpdateHitTestingTreeImpl(const ScrollNode& aRoot, bool aIsFirstPaint,
WRRootId aOriginatingWrRootId,
LayersId aOriginatingLayersId,
uint32_t aPaintSequenceNumber);
void AttachNodeToTree(HitTestingTreeNode* aNode, HitTestingTreeNode* aParent,

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

@ -177,11 +177,11 @@ void APZUpdater::UpdateFocusState(LayersId aRootLayerTreeId,
}
void APZUpdater::UpdateHitTestingTree(Layer* aRoot, bool aIsFirstPaint,
LayersId aOriginatingWrRootId,
LayersId aOriginatingLayersId,
uint32_t aPaintSequenceNumber) {
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
AssertOnUpdaterThread();
mApz->UpdateHitTestingTree(aRoot, aIsFirstPaint, aOriginatingWrRootId,
mApz->UpdateHitTestingTree(aRoot, aIsFirstPaint, aOriginatingLayersId,
aPaintSequenceNumber);
}
@ -219,7 +219,8 @@ void APZUpdater::UpdateScrollDataAndTreeState(
self->mApz->UpdateHitTestingTree(
WebRenderScrollDataWrapper(*self, aRootLayerTreeId,
&(root->second)),
isFirstPaint, aOriginatingWrRootId, paintSequenceNumber);
isFirstPaint, aOriginatingWrRootId.mLayersId,
paintSequenceNumber);
}));
}
@ -242,7 +243,8 @@ void APZUpdater::UpdateScrollOffsets(WRRootId aRootLayerTreeId,
self->mApz->UpdateHitTestingTree(
WebRenderScrollDataWrapper(
*self, aRootLayerTreeId, &(root->second)),
/*isFirstPaint*/ false, aOriginatingWrRootId,
/*isFirstPaint*/ false,
aOriginatingWrRootId.mLayersId,
aPaintSequenceNumber);
}));
}