зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 517b9b831685 (bug 1157066) for build bustage
This commit is contained in:
Родитель
e488294393
Коммит
936a2fdf3f
|
@ -1030,8 +1030,7 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer)
|
|||
}
|
||||
|
||||
bool
|
||||
AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame,
|
||||
TransformsToSkip aSkip)
|
||||
AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame)
|
||||
{
|
||||
PROFILER_LABEL("AsyncCompositionManager", "TransformShadowTree",
|
||||
js::ProfileEntry::Category::GRAPHICS);
|
||||
|
@ -1046,31 +1045,29 @@ AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame,
|
|||
// transforms.
|
||||
bool wantNextFrame = SampleAnimations(root, aCurrentFrame);
|
||||
|
||||
if (!(aSkip & TransformsToSkip::APZ)) {
|
||||
// FIXME/bug 775437: unify this interface with the ~native-fennec
|
||||
// derived code
|
||||
//
|
||||
// Attempt to apply an async content transform to any layer that has
|
||||
// an async pan zoom controller (which means that it is rendered
|
||||
// async using Gecko). If this fails, fall back to transforming the
|
||||
// primary scrollable layer. "Failing" here means that we don't
|
||||
// find a frame that is async scrollable. Note that the fallback
|
||||
// code also includes Fennec which is rendered async. Fennec uses
|
||||
// its own platform-specific async rendering that is done partially
|
||||
// in Gecko and partially in Java.
|
||||
wantNextFrame |= SampleAPZAnimations(LayerMetricsWrapper(root), aCurrentFrame);
|
||||
if (!ApplyAsyncContentTransformToTree(root)) {
|
||||
nsAutoTArray<Layer*,1> scrollableLayers;
|
||||
// FIXME/bug 775437: unify this interface with the ~native-fennec
|
||||
// derived code
|
||||
//
|
||||
// Attempt to apply an async content transform to any layer that has
|
||||
// an async pan zoom controller (which means that it is rendered
|
||||
// async using Gecko). If this fails, fall back to transforming the
|
||||
// primary scrollable layer. "Failing" here means that we don't
|
||||
// find a frame that is async scrollable. Note that the fallback
|
||||
// code also includes Fennec which is rendered async. Fennec uses
|
||||
// its own platform-specific async rendering that is done partially
|
||||
// in Gecko and partially in Java.
|
||||
wantNextFrame |= SampleAPZAnimations(LayerMetricsWrapper(root), aCurrentFrame);
|
||||
if (!ApplyAsyncContentTransformToTree(root)) {
|
||||
nsAutoTArray<Layer*,1> scrollableLayers;
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
mLayerManager->GetRootScrollableLayers(scrollableLayers);
|
||||
mLayerManager->GetRootScrollableLayers(scrollableLayers);
|
||||
#else
|
||||
mLayerManager->GetScrollableLayers(scrollableLayers);
|
||||
mLayerManager->GetScrollableLayers(scrollableLayers);
|
||||
#endif
|
||||
|
||||
for (uint32_t i = 0; i < scrollableLayers.Length(); i++) {
|
||||
if (scrollableLayers[i]) {
|
||||
TransformScrollableLayer(scrollableLayers[i]);
|
||||
}
|
||||
for (uint32_t i = 0; i < scrollableLayers.Length(); i++) {
|
||||
if (scrollableLayers[i]) {
|
||||
TransformScrollableLayer(scrollableLayers[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,9 +95,7 @@ public:
|
|||
|
||||
// Sample transforms for layer trees. Return true to request
|
||||
// another animation frame.
|
||||
enum class TransformsToSkip : uint8_t { None = 0, APZ = 1 };
|
||||
bool TransformShadowTree(TimeStamp aCurrentFrame,
|
||||
TransformsToSkip aSkip = TransformsToSkip::None);
|
||||
bool TransformShadowTree(TimeStamp aCurrentFrame);
|
||||
|
||||
// Calculates the correct rotation and applies the transform to
|
||||
// our layer manager
|
||||
|
@ -210,8 +208,6 @@ private:
|
|||
gfx::Matrix mWorldTransform;
|
||||
};
|
||||
|
||||
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(AsyncCompositionManager::TransformsToSkip)
|
||||
|
||||
class MOZ_STACK_CLASS AutoResolveRefLayers {
|
||||
public:
|
||||
explicit AutoResolveRefLayers(AsyncCompositionManager* aManager) : mManager(aManager)
|
||||
|
|
|
@ -1152,6 +1152,12 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
|||
if (mPaused) {
|
||||
DidComposite();
|
||||
}
|
||||
// When testing we synchronously update the shadow tree with the animated
|
||||
// values to avoid race conditions when calling GetAnimationTransform etc.
|
||||
// (since the above SetShadowProperties will remove animation effects).
|
||||
if (mIsTesting) {
|
||||
ApplyAsyncProperties(aLayerTree);
|
||||
}
|
||||
}
|
||||
mLayerManager->NotifyShadowTreeTransaction();
|
||||
}
|
||||
|
@ -1204,15 +1210,16 @@ CompositorParent::ApplyAsyncProperties(LayerTransactionParent* aLayerTree)
|
|||
// true or when called from test-only methods like
|
||||
// LayerTransactionParent::RecvGetAnimationTransform.
|
||||
|
||||
// Synchronously update the layer tree
|
||||
if (aLayerTree->GetRoot()) {
|
||||
// Synchronously update the layer tree, but only if a composite was already
|
||||
// scehduled.
|
||||
if (aLayerTree->GetRoot() &&
|
||||
(mCurrentCompositeTask ||
|
||||
(mCompositorVsyncObserver &&
|
||||
mCompositorVsyncObserver->NeedsComposite()))) {
|
||||
AutoResolveRefLayers resolve(mCompositionManager);
|
||||
SetShadowProperties(mLayerManager->GetRoot());
|
||||
|
||||
TimeStamp time = mIsTesting ? mTestTime : mLastCompose;
|
||||
bool requestNextFrame =
|
||||
mCompositionManager->TransformShadowTree(time,
|
||||
AsyncCompositionManager::TransformsToSkip::APZ);
|
||||
mCompositionManager->TransformShadowTree(time);
|
||||
if (!requestNextFrame) {
|
||||
CancelCurrentCompositeTask();
|
||||
// Pretend we composited in case someone is waiting for this event.
|
||||
|
|
|
@ -664,8 +664,6 @@ LayerTransactionParent::RecvGetOpacity(PLayerParent* aParent,
|
|||
return false;
|
||||
}
|
||||
|
||||
mShadowLayersManager->ApplyAsyncProperties(this);
|
||||
|
||||
*aOpacity = layer->GetLocalOpacity();
|
||||
return true;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче