gecko-dev/gfx/layers/ipc/ShadowLayersManager.h

47 строки
1.9 KiB
C
Исходник Обычный вид История

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
2012-05-21 15:12:37 +04:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_layers_ShadowLayersManager_h
#define mozilla_layers_ShadowLayersManager_h
namespace mozilla {
namespace layers {
class TargetConfig;
class LayerTransactionParent;
class AsyncCompositionManager;
class APZTestData;
class ShadowLayersManager
{
public:
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
const uint64_t& aTransactionId,
const TargetConfig& aTargetConfig,
const InfallibleTArray<PluginWindowData>& aPlugins,
bool aIsFirstPaint,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber,
bool aIsRepeatTransaction) = 0;
virtual AsyncCompositionManager* GetCompositionManager(LayerTransactionParent* aLayerTree) { return nullptr; }
virtual void NotifyClearCachedResources(LayerTransactionParent* aLayerTree) { }
virtual void ForceComposite(LayerTransactionParent* aLayerTree) { }
virtual bool SetTestSampleTime(LayerTransactionParent* aLayerTree,
const TimeStamp& aTime) { return true; }
virtual void LeaveTestMode(LayerTransactionParent* aLayerTree) { }
Bug 1113425 part 2 - Apply async properties when querying the animated transform; r=mattwoodrow In order to test off-main thread animations, we have a method that will return the animated transform value set on a shadow layer. This method will return null if the transform was not set by animation. However, in some situations we temporarily clear the animation transform. For example, when we synchronize a composite layer with its content layer, we reset the animation transform. Then, on the next composite, we will recalculate the animated value. If we try to query the animated transform value in between resetting it and the next composite we will get back null. To avoid a race condition, in ShadowLayersUpdated after potentially clearing the animated transform, we synchronously update the async properties on the layer transform in order to reinstate the animated transform (so it is there when we go to query it). However we *only* do this when the mIsTesting flag is set which is true whenever we have the refresh driver under test control. Furthermore, we only do it when we already have a pending composite task to better match conditions under regular operation. In test_deferred_start.html, however, we specifically need to test without putting the refresh driver under test control. As a result mIsTesting will be false and we can encounter a race condition when querying the animated transform. To work around this, this patch makes us *also* update async properties when fetching the animated transform value. The method for getting the animated transform value is only used for testing so it should have no effect on the regular compositing behavior. It would seem that we could then remove the call from ShadowLayersUpdated but doing this caused a small number of test cases to fail. In particular one test for *opacity* in test_animations_omta.html was failing at the end of the animation because we ended up with a stale opacity animation value on the compositor which the synchronous update was previously removing. The test, in this case, should be ignoring the value on the compositor but, unlike transform, there is no flag for indicating whether or not the opacity on shadow layers has been set by animations. As a result, this patch leaves the call that triggers a synchronous update in test mode when updating shadow layers.
2015-03-17 12:38:12 +03:00
virtual void ApplyAsyncProperties(LayerTransactionParent* aLayerTree) { }
virtual void GetAPZTestData(const LayerTransactionParent* aLayerTree,
APZTestData* aOutData) { }
};
} // layers
} // mozilla
#endif // mozilla_layers_ShadowLayersManager_h