Bug 1316764 - Update animations on layers whenever the frame generation is not equal; r=hiro

This fixes a problem where we fail to update animations on layers when an
EffectSet is destroyed. In this case when we call
RestyleManager::GetAnimationGenerationForFrame in
ElementRestyler::AddLayerChangesForAnimation(), it will return zero but the
animation generation on the layer will be set to some positive non-zero value.

If we compare the two generation numbers using < we will think the layer is
up-to-date. Using != fixes this. We only used < while we had independent
generation numbers of animations and transitions but that was fixed in bug
1229280.

MozReview-Commit-ID: Jsunjc145GR

--HG--
extra : rebase_source : 75a6e324bdefeb12d1a8edc31b745b59a50bda61
This commit is contained in:
Brian Birtles 2016-12-22 08:47:14 +09:00
Родитель 5f4802bf0b
Коммит daf2b57f94
1 изменённых файлов: 1 добавлений и 4 удалений

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

@ -1530,9 +1530,6 @@ ElementRestyler::ElementRestyler(nsPresContext* aPresContext,
void
ElementRestyler::AddLayerChangesForAnimation()
{
// Bug 847286 - We should have separate animation generation counters
// on layers for transitions and animations and use != comparison below
// rather than a > comparison.
uint64_t frameGeneration =
RestyleManager::GetAnimationGenerationForFrame(mFrame);
@ -1541,7 +1538,7 @@ ElementRestyler::AddLayerChangesForAnimation()
LayerAnimationInfo::sRecords) {
Layer* layer =
FrameLayerBuilder::GetDedicatedLayer(mFrame, layerInfo.mLayerType);
if (layer && frameGeneration > layer->GetAnimationGeneration()) {
if (layer && frameGeneration != layer->GetAnimationGeneration()) {
// If we have a transform layer but don't have any transform style, we
// probably just removed the transform but haven't destroyed the layer
// yet. In this case we will add the appropriate change hint