Bug 1501442 - Part 2: Propagate composition payload from clients to host. r=rhunt

--HG--
extra : rebase_source : 9053497a7a177855a8c5f1012a41e336b112c0a0
This commit is contained in:
Bas Schouten 2018-12-13 15:56:51 +01:00
Родитель 93c70bd2f6
Коммит 4cf5cf3ec0
4 изменённых файлов: 35 добавлений и 0 удалений

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

@ -813,6 +813,17 @@ void CompositorBridgeParent::UpdatePaintTime(LayerTransactionParent* aLayerTree,
mLayerManager->SetPaintTime(aPaintTime);
}
void CompositorBridgeParent::RegisterPayload(
LayerTransactionParent* aLayerTree,
const InfallibleTArray<CompositionPayload>& aPayload) {
// We get a lot of paint timings for things with empty transactions.
if (!mLayerManager) {
return;
}
mLayerManager->RegisterPayload(aPayload);
}
void CompositorBridgeParent::NotifyShadowTreeTransaction(
LayersId aId, bool aIsFirstPaint, const FocusTarget& aFocusTarget,
bool aScheduleComposite, uint32_t aPaintSequenceNumber,
@ -1241,6 +1252,7 @@ void CompositorBridgeParent::ShadowLayersUpdated(
mRefreshStartTime = aInfo.refreshStart();
mTxnStartTime = aInfo.transactionStart();
mFwdTime = aInfo.fwdTime();
RegisterPayload(aLayerTree, aInfo.payload());
if (root) {
SetShadowProperties(root);

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

@ -133,6 +133,9 @@ class CompositorBridgeParentBase : public PCompositorBridgeParent,
const nsTArray<ScrollableLayerGuid>& aTargets) = 0;
virtual void UpdatePaintTime(LayerTransactionParent* aLayerTree,
const TimeDuration& aPaintTime) {}
virtual void RegisterPayload(
LayerTransactionParent* aLayerTree,
const InfallibleTArray<CompositionPayload>& aPayload) {}
ShmemAllocator* AsShmemAllocator() override { return this; }
@ -362,6 +365,9 @@ class CompositorBridgeParent final : public CompositorBridgeParentBase,
void UpdatePaintTime(LayerTransactionParent* aLayerTree,
const TimeDuration& aPaintTime) override;
void RegisterPayload(
LayerTransactionParent* aLayerTree,
const InfallibleTArray<CompositionPayload>& aPayload) override;
/**
* Check rotation info and schedule a rendering task if needed.

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

@ -625,6 +625,21 @@ void CrossProcessCompositorBridgeParent::UpdatePaintTime(
state->mParent->UpdatePaintTime(aLayerTree, aPaintTime);
}
void CrossProcessCompositorBridgeParent::RegisterPayload(
LayerTransactionParent* aLayerTree,
const InfallibleTArray<CompositionPayload>& aPayload) {
LayersId id = aLayerTree->GetId();
MOZ_ASSERT(id.IsValid());
CompositorBridgeParent::LayerTreeState* state =
CompositorBridgeParent::GetIndirectShadowTree(id);
if (!state || !state->mParent) {
return;
}
state->mParent->RegisterPayload(aLayerTree, aPayload);
}
void CrossProcessCompositorBridgeParent::ObserveLayersUpdate(
LayersId aLayersId, LayersObserverEpoch aEpoch, bool aActive) {
MOZ_ASSERT(aLayersId.IsValid());

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

@ -170,6 +170,8 @@ class CrossProcessCompositorBridgeParent final
void UpdatePaintTime(LayerTransactionParent* aLayerTree,
const TimeDuration& aPaintTime) override;
void RegisterPayload(LayerTransactionParent* aLayerTree,
const InfallibleTArray<CompositionPayload>& aPayload) override;
PWebRenderBridgeParent* AllocPWebRenderBridgeParent(
const wr::PipelineId& aPipelineId,