зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1442627 - Switch some call sites in WebRenderBridgeParent to use APZSampler. r=botond
MozReview-Commit-ID: AqtcAyTkcEK --HG-- extra : rebase_source : dd00ef41c0dc2ca3f8179a217019d964735af320
This commit is contained in:
Родитель
551f604b60
Коммит
752091f7a7
|
@ -9,8 +9,17 @@
|
|||
|
||||
#include "mozilla/layers/APZTestData.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class TimeStamp;
|
||||
|
||||
namespace wr {
|
||||
class TransactionBuilder;
|
||||
struct WrTransformProperty;
|
||||
} // namespace wr
|
||||
|
||||
namespace layers {
|
||||
|
||||
class APZCTreeManager;
|
||||
|
@ -48,6 +57,10 @@ public:
|
|||
const RefPtr<APZSampler>& aOldSampler);
|
||||
void NotifyLayerTreeRemoved(uint64_t aLayersId);
|
||||
|
||||
bool PushStateToWR(wr::TransactionBuilder& aTxn,
|
||||
const TimeStamp& aSampleTime,
|
||||
nsTArray<wr::WrTransformProperty>& aTransformArray);
|
||||
|
||||
bool GetAPZTestData(uint64_t aLayersId, APZTestData* aOutData);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -77,6 +77,16 @@ APZSampler::NotifyLayerTreeRemoved(uint64_t aLayersId)
|
|||
mApz->NotifyLayerTreeRemoved(aLayersId);
|
||||
}
|
||||
|
||||
bool
|
||||
APZSampler::PushStateToWR(wr::TransactionBuilder& aTxn,
|
||||
const TimeStamp& aSampleTime,
|
||||
nsTArray<wr::WrTransformProperty>& aTransformArray)
|
||||
{
|
||||
// This function will be removed eventually since we'll have WR pull
|
||||
// the transforms from APZ instead.
|
||||
return mApz->PushStateToWR(aTxn, aSampleTime, aTransformArray);
|
||||
}
|
||||
|
||||
bool
|
||||
APZSampler::GetAPZTestData(uint64_t aLayersId,
|
||||
APZTestData* aOutData)
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "mozilla/Range.h"
|
||||
#include "mozilla/layers/AnimationHelper.h"
|
||||
#include "mozilla/layers/APZCTreeManager.h"
|
||||
#include "mozilla/layers/APZSampler.h"
|
||||
#include "mozilla/layers/Compositor.h"
|
||||
#include "mozilla/layers/CompositorBridgeParent.h"
|
||||
#include "mozilla/layers/CompositorThread.h"
|
||||
|
@ -515,11 +516,11 @@ WebRenderBridgeParent::UpdateAPZ(bool aUpdateHitTestingTree)
|
|||
if (!rootWrbp) {
|
||||
return;
|
||||
}
|
||||
if (RefPtr<APZCTreeManager> apzc = cbp->GetAPZCTreeManager()) {
|
||||
apzc->UpdateFocusState(rootLayersId, GetLayersId(),
|
||||
mScrollData.GetFocusTarget());
|
||||
if (RefPtr<APZSampler> apz = cbp->GetAPZSampler()) {
|
||||
apz->UpdateFocusState(rootLayersId, GetLayersId(),
|
||||
mScrollData.GetFocusTarget());
|
||||
if (aUpdateHitTestingTree) {
|
||||
apzc->UpdateHitTestingTree(rootLayersId, rootWrbp->GetScrollData(),
|
||||
apz->UpdateHitTestingTree(rootLayersId, rootWrbp->GetScrollData(),
|
||||
mScrollData.IsFirstPaint(), GetLayersId(),
|
||||
mScrollData.GetPaintSequenceNumber());
|
||||
}
|
||||
|
@ -534,7 +535,7 @@ WebRenderBridgeParent::PushAPZStateToWR(wr::TransactionBuilder& aTxn,
|
|||
if (!cbp) {
|
||||
return false;
|
||||
}
|
||||
if (RefPtr<APZCTreeManager> apzc = cbp->GetAPZCTreeManager()) {
|
||||
if (RefPtr<APZSampler> apz = cbp->GetAPZSampler()) {
|
||||
TimeStamp animationTime = cbp->GetTestingTimeStamp().valueOr(
|
||||
mCompositorScheduler->GetLastComposeTime());
|
||||
TimeDuration frameInterval = cbp->GetVsyncInterval();
|
||||
|
@ -543,7 +544,7 @@ WebRenderBridgeParent::PushAPZStateToWR(wr::TransactionBuilder& aTxn,
|
|||
if (frameInterval != TimeDuration::Forever()) {
|
||||
animationTime += frameInterval;
|
||||
}
|
||||
return apzc->PushStateToWR(aTxn, animationTime, aTransformArray);
|
||||
return apz->PushStateToWR(aTxn, animationTime, aTransformArray);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче