2012-01-19 18:45:37 +04:00
|
|
|
/* -*- 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/. */
|
2012-01-19 18:45:37 +04:00
|
|
|
|
|
|
|
#ifndef mozilla_layers_ShadowLayersManager_h
|
|
|
|
#define mozilla_layers_ShadowLayersManager_h
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2012-07-24 23:01:09 +04:00
|
|
|
class TargetConfig;
|
2013-04-24 22:42:40 +04:00
|
|
|
class LayerTransactionParent;
|
2014-02-11 08:01:20 +04:00
|
|
|
class AsyncCompositionManager;
|
2014-05-08 03:56:48 +04:00
|
|
|
class APZTestData;
|
2012-01-19 18:45:37 +04:00
|
|
|
|
|
|
|
class ShadowLayersManager
|
|
|
|
{
|
|
|
|
public:
|
2013-04-24 22:42:40 +04:00
|
|
|
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
2014-05-29 01:42:14 +04:00
|
|
|
const uint64_t& aTransactionId,
|
2012-07-24 23:01:09 +04:00
|
|
|
const TargetConfig& aTargetConfig,
|
2015-01-29 22:41:55 +03:00
|
|
|
const InfallibleTArray<PluginWindowData>& aPlugins,
|
2013-12-16 09:38:42 +04:00
|
|
|
bool aIsFirstPaint,
|
2014-05-07 01:26:13 +04:00
|
|
|
bool aScheduleComposite,
|
2014-05-31 02:52:43 +04:00
|
|
|
uint32_t aPaintSequenceNumber,
|
|
|
|
bool aIsRepeatTransaction) = 0;
|
2014-02-11 08:01:20 +04:00
|
|
|
|
2014-02-25 02:45:40 +04:00
|
|
|
virtual AsyncCompositionManager* GetCompositionManager(LayerTransactionParent* aLayerTree) { return nullptr; }
|
2014-03-03 04:59:58 +04:00
|
|
|
|
2015-02-27 08:30:44 +03:00
|
|
|
virtual void NotifyClearCachedResources(LayerTransactionParent* aLayerTree) { }
|
|
|
|
|
2014-03-03 04:59:58 +04:00
|
|
|
virtual void ForceComposite(LayerTransactionParent* aLayerTree) { }
|
2014-03-22 01:59:57 +04:00
|
|
|
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) { }
|
2014-05-08 03:56:48 +04:00
|
|
|
virtual void GetAPZTestData(const LayerTransactionParent* aLayerTree,
|
|
|
|
APZTestData* aOutData) { }
|
2012-01-19 18:45:37 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // layers
|
|
|
|
} // mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_layers_ShadowLayersManager_h
|