Bug 1464568 - Add an argument to ApplyAsyncProperties() to apply the transform by APZC or not. r=kats

In the next patch, we will introduce a new IPC function to get transform value
modified by both animations and APZC.

MozReview-Commit-ID: Uf5UHg5Jm

--HG--
extra : rebase_source : 68a52c110b049266ce982bc9284de8642dc3405d
This commit is contained in:
Hiroyuki Ikezoe 2018-06-05 09:18:21 +09:00
Родитель 3cd117ed4f
Коммит 6df13785df
7 изменённых файлов: 30 добавлений и 20 удалений

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

@ -1249,9 +1249,10 @@ AsyncCompositionManager::GetFrameUniformity(FrameUniformityData* aOutData)
}
bool
AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame,
TimeDuration aVsyncRate,
TransformsToSkip aSkip)
AsyncCompositionManager::TransformShadowTree(
TimeStamp aCurrentFrame,
TimeDuration aVsyncRate,
CompositorBridgeParentBase::TransformsToSkip aSkip)
{
AUTO_PROFILER_LABEL("AsyncCompositionManager::TransformShadowTree", GRAPHICS);
@ -1300,7 +1301,7 @@ AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame,
// started animations.
mPreviousFrameTimeStamp = wantNextFrame ? aCurrentFrame : TimeStamp();
if (!(aSkip & TransformsToSkip::APZ)) {
if (!(aSkip & CompositorBridgeParentBase::TransformsToSkip::APZ)) {
// FIXME/bug 775437: unify this interface with the ~native-fennec
// derived code
//

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

@ -19,6 +19,7 @@
#include "mozilla/layers/LayersMessages.h" // for TargetConfig
#include "mozilla/RefPtr.h" // for nsRefPtr
#include "nsISupportsImpl.h" // for LayerManager::AddRef, etc
#include "CompositorBridgeParent.h" // for TransformsToSkip
namespace mozilla {
namespace layers {
@ -83,10 +84,11 @@ public:
// Sample transforms for layer trees. Return true to request
// another animation frame.
enum class TransformsToSkip : uint8_t { NoneOfThem = 0, APZ = 1 };
bool TransformShadowTree(TimeStamp aCurrentFrame,
TimeDuration aVsyncRate,
TransformsToSkip aSkip = TransformsToSkip::NoneOfThem);
bool TransformShadowTree(
TimeStamp aCurrentFrame,
TimeDuration aVsyncRate,
CompositorBridgeParentBase::TransformsToSkip aSkip =
CompositorBridgeParentBase::TransformsToSkip::NoneOfThem);
// Calculates the correct rotation and applies the transform to
// our layer manager
@ -236,8 +238,6 @@ private:
#endif
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(AsyncCompositionManager::TransformsToSkip)
class MOZ_STACK_CLASS AutoResolveRefLayers {
public:
explicit AutoResolveRefLayers(AsyncCompositionManager* aManager,

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

@ -1392,7 +1392,8 @@ CompositorBridgeParent::LeaveTestMode(const LayersId& aId)
}
void
CompositorBridgeParent::ApplyAsyncProperties(LayerTransactionParent* aLayerTree)
CompositorBridgeParent::ApplyAsyncProperties(LayerTransactionParent* aLayerTree,
TransformsToSkip aSkip)
{
// NOTE: This should only be used for testing. For example, when mTestTime is
// non-empty, or when called from test-only methods like
@ -1405,8 +1406,7 @@ CompositorBridgeParent::ApplyAsyncProperties(LayerTransactionParent* aLayerTree)
TimeStamp time = mTestTime.valueOr(mCompositorScheduler->GetLastComposeTime());
bool requestNextFrame =
mCompositionManager->TransformShadowTree(time, mVsyncRate,
AsyncCompositionManager::TransformsToSkip::APZ);
mCompositionManager->TransformShadowTree(time, mVsyncRate, aSkip);
if (!requestNextFrame) {
CancelCurrentCompositeTask();
// Pretend we composited in case someone is waiting for this event.

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

@ -113,7 +113,9 @@ public:
virtual bool SetTestSampleTime(const LayersId& aId,
const TimeStamp& aTime) { return true; }
virtual void LeaveTestMode(const LayersId& aId) { }
virtual void ApplyAsyncProperties(LayerTransactionParent* aLayerTree) = 0;
enum class TransformsToSkip : uint8_t { NoneOfThem = 0, APZ = 1 };
virtual void ApplyAsyncProperties(LayerTransactionParent* aLayerTree,
TransformsToSkip aSkip) = 0;
virtual void SetTestAsyncScrollOffset(const LayersId& aLayersId,
const FrameMetrics::ViewID& aScrollId,
const CSSPoint& aPoint) = 0;
@ -178,6 +180,8 @@ private:
RefPtr<CompositorManagerParent> mCompositorManager;
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CompositorBridgeParentBase::TransformsToSkip)
class CompositorBridgeParent final : public CompositorBridgeParentBase
, public CompositorController
, public CompositorVsyncSchedulerOwner
@ -237,7 +241,8 @@ public:
bool SetTestSampleTime(const LayersId& aId,
const TimeStamp& aTime) override;
void LeaveTestMode(const LayersId& aId) override;
void ApplyAsyncProperties(LayerTransactionParent* aLayerTree) override;
void ApplyAsyncProperties(LayerTransactionParent* aLayerTree,
TransformsToSkip aSkip) override;
CompositorAnimationStorage* GetAnimationStorage();
void SetTestAsyncScrollOffset(const LayersId& aLayersId,
const FrameMetrics::ViewID& aScrollId,

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

@ -466,7 +466,8 @@ CrossProcessCompositorBridgeParent::LeaveTestMode(const LayersId& aId)
void
CrossProcessCompositorBridgeParent::ApplyAsyncProperties(
LayerTransactionParent* aLayerTree)
LayerTransactionParent* aLayerTree,
TransformsToSkip aSkip)
{
LayersId id = aLayerTree->GetId();
MOZ_ASSERT(id.IsValid());
@ -477,7 +478,7 @@ CrossProcessCompositorBridgeParent::ApplyAsyncProperties(
}
MOZ_ASSERT(state->mParent);
state->mParent->ApplyAsyncProperties(aLayerTree);
state->mParent->ApplyAsyncProperties(aLayerTree, aSkip);
}
void

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

@ -88,7 +88,8 @@ public:
bool SetTestSampleTime(const LayersId& aId,
const TimeStamp& aTime) override;
void LeaveTestMode(const LayersId& aId) override;
void ApplyAsyncProperties(LayerTransactionParent* aLayerTree) override;
void ApplyAsyncProperties(LayerTransactionParent* aLayerTree,
TransformsToSkip aSkip) override;
void SetTestAsyncScrollOffset(const LayersId& aLayersId,
const FrameMetrics::ViewID& aScrollId,
const CSSPoint& aPoint) override;

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

@ -700,7 +700,8 @@ LayerTransactionParent::RecvGetAnimationOpacity(const uint64_t& aCompositorAnima
return IPC_FAIL_NO_REASON(this);
}
mCompositorBridge->ApplyAsyncProperties(this);
mCompositorBridge->ApplyAsyncProperties(
this, CompositorBridgeParentBase::TransformsToSkip::APZ);
if (!mAnimStorage) {
return IPC_FAIL_NO_REASON(this);
@ -726,7 +727,8 @@ LayerTransactionParent::RecvGetAnimationTransform(const uint64_t& aCompositorAni
// a race between when we temporarily clear the animation transform (in
// CompositorBridgeParent::SetShadowProperties) and when animation recalculates
// the value.
mCompositorBridge->ApplyAsyncProperties(this);
mCompositorBridge->ApplyAsyncProperties(
this, CompositorBridgeParentBase::TransformsToSkip::APZ);
if (!mAnimStorage) {
return IPC_FAIL_NO_REASON(this);