Backed out 9 changesets (bug 1479173) for build failures in src/dom/animation/EffectCompositor.cpp CLOSED TREE
Backed out changeset 439ac5cfbced (bug 1479173) Backed out changeset 73aba16a223f (bug 1479173) Backed out changeset 89dbc6f7f959 (bug 1479173) Backed out changeset ed1c344ccf0d (bug 1479173) Backed out changeset c330e7e1eb1d (bug 1479173) Backed out changeset efcbbb9daa39 (bug 1479173) Backed out changeset 43c6a7863536 (bug 1479173) Backed out changeset 94f0ae94a02c (bug 1479173) Backed out changeset 7cf0ad1af067 (bug 1479173)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/ComputedStyleInlines.h"
|
||||
#include "mozilla/EffectSet.h"
|
||||
#include "mozilla/LayerAnimationInfo.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include "mozilla/ServoBindings.h" // Servo_GetProperties_Overriding_Animation
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
@@ -608,9 +609,7 @@ EffectCompositor::GetOverriddenProperties(EffectSet& aEffectSet,
|
||||
return result;
|
||||
}
|
||||
|
||||
static constexpr size_t compositorAnimatableCount =
|
||||
nsCSSPropertyIDSet::CompositorAnimatableCount();
|
||||
AutoTArray<nsCSSPropertyID, compositorAnimatableCount> propertiesToTrack;
|
||||
AutoTArray<nsCSSPropertyID, LayerAnimationInfo::kRecords> propertiesToTrack;
|
||||
{
|
||||
nsCSSPropertyIDSet propertiesToTrackAsSet;
|
||||
for (KeyframeEffect* effect : aEffectSet) {
|
||||
@@ -624,7 +623,7 @@ EffectCompositor::GetOverriddenProperties(EffectSet& aEffectSet,
|
||||
}
|
||||
// Skip iterating over the rest of the effects if we've already
|
||||
// found all the compositor-animatable properties.
|
||||
if (propertiesToTrack.Length() == compositorAnimatableCount) {
|
||||
if (propertiesToTrack.Length() == LayerAnimationInfo::kRecords) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -667,17 +666,31 @@ EffectCompositor::UpdateCascadeResults(EffectSet& aEffectSet,
|
||||
nsCSSPropertyIDSet overriddenProperties =
|
||||
GetOverriddenProperties(aEffectSet, aElement, aPseudoType);
|
||||
|
||||
// Returns a bitset the represents which properties from
|
||||
// LayerAnimationInfo::sRecords are present in |aPropertySet|.
|
||||
auto compositorPropertiesInSet =
|
||||
[](nsCSSPropertyIDSet& aPropertySet) ->
|
||||
std::bitset<LayerAnimationInfo::kRecords> {
|
||||
std::bitset<LayerAnimationInfo::kRecords> result;
|
||||
for (size_t i = 0; i < LayerAnimationInfo::kRecords; i++) {
|
||||
if (aPropertySet.HasProperty(
|
||||
LayerAnimationInfo::sRecords[i].mProperty)) {
|
||||
result.set(i);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
nsCSSPropertyIDSet& propertiesWithImportantRules =
|
||||
aEffectSet.PropertiesWithImportantRules();
|
||||
nsCSSPropertyIDSet& propertiesForAnimationsLevel =
|
||||
aEffectSet.PropertiesForAnimationsLevel();
|
||||
|
||||
static constexpr nsCSSPropertyIDSet compositorAnimatables =
|
||||
nsCSSPropertyIDSet::CompositorAnimatables();
|
||||
// Record which compositor-animatable properties were originally set so we can
|
||||
// compare for changes later.
|
||||
nsCSSPropertyIDSet prevCompositorPropertiesWithImportantRules =
|
||||
propertiesWithImportantRules.Intersect(compositorAnimatables);
|
||||
std::bitset<LayerAnimationInfo::kRecords>
|
||||
prevCompositorPropertiesWithImportantRules =
|
||||
compositorPropertiesInSet(propertiesWithImportantRules);
|
||||
|
||||
nsCSSPropertyIDSet prevPropertiesForAnimationsLevel =
|
||||
propertiesForAnimationsLevel;
|
||||
@@ -719,8 +732,8 @@ EffectCompositor::UpdateCascadeResults(EffectSet& aEffectSet,
|
||||
// released from being overridden by !important rules, we need to update
|
||||
// layers for animations level because it's a trigger to send animations to
|
||||
// the compositor or pull animations back from the compositor.
|
||||
if (!prevCompositorPropertiesWithImportantRules.Equals(
|
||||
propertiesWithImportantRules.Intersect(compositorAnimatables))) {
|
||||
if (prevCompositorPropertiesWithImportantRules !=
|
||||
compositorPropertiesInSet(propertiesWithImportantRules)) {
|
||||
presContext->EffectCompositor()->
|
||||
RequestRestyle(aElement, aPseudoType,
|
||||
EffectCompositor::RestyleType::Layer,
|
||||
@@ -737,7 +750,7 @@ EffectCompositor::UpdateCascadeResults(EffectSet& aEffectSet,
|
||||
changedPropertiesForAnimationLevel);
|
||||
if (!commonProperties.IsEmpty()) {
|
||||
EffectCompositor::RestyleType restyleType =
|
||||
changedPropertiesForAnimationLevel.Intersects(compositorAnimatables)
|
||||
compositorPropertiesInSet(changedPropertiesForAnimationLevel).none()
|
||||
? EffectCompositor::RestyleType::Standard
|
||||
: EffectCompositor::RestyleType::Layer;
|
||||
presContext->EffectCompositor()->
|
||||
|
||||
@@ -1242,33 +1242,29 @@ KeyframeEffect::CanThrottle() const
|
||||
return true;
|
||||
}
|
||||
|
||||
EffectSet* effectSet = nullptr;
|
||||
for (const AnimationProperty& property : mProperties) {
|
||||
if (!property.mIsRunningOnCompositor) {
|
||||
return false;
|
||||
// First we need to check layer generation and transform overflow
|
||||
// prior to the property.mIsRunningOnCompositor check because we should
|
||||
// occasionally unthrottle these animations even if the animations are
|
||||
// already running on compositor.
|
||||
for (const LayerAnimationInfo::Record& record :
|
||||
LayerAnimationInfo::sRecords) {
|
||||
// Skip properties that are overridden by !important rules.
|
||||
// (GetEffectiveAnimationOfProperty, as called by
|
||||
// HasEffectiveAnimationOfProperty, only returns a property which is
|
||||
// neither overridden by !important rules nor overridden by other
|
||||
// animation.)
|
||||
if (!HasEffectiveAnimationOfProperty(record.mProperty)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(nsCSSPropertyIDSet::CompositorAnimatables()
|
||||
.HasProperty(property.mProperty),
|
||||
"The property should be able to run on the compositor");
|
||||
MOZ_ASSERT(HasEffectiveAnimationOfProperty(property.mProperty),
|
||||
"There should be an effective animation of the property while "
|
||||
"it is marked as being run on the compositor");
|
||||
|
||||
if (!effectSet) {
|
||||
effectSet = EffectSet::GetEffectSet(mTarget->mElement,
|
||||
mTarget->mPseudoType);
|
||||
MOZ_ASSERT(effectSet, "CanThrottle should be called on an effect "
|
||||
"associated with a target element");
|
||||
}
|
||||
|
||||
DisplayItemType displayItemType =
|
||||
LayerAnimationInfo::GetDisplayItemTypeForProperty(property.mProperty);
|
||||
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget->mElement,
|
||||
mTarget->mPseudoType);
|
||||
MOZ_ASSERT(effectSet, "CanThrottle should be called on an effect "
|
||||
"associated with a target element");
|
||||
// Note that AnimationInfo::GetGenarationFromFrame() is supposed to work
|
||||
// with the primary frame instead of the style frame.
|
||||
Maybe<uint64_t> generation = layers::AnimationInfo::GetGenerationFromFrame(
|
||||
GetPrimaryFrame(), displayItemType);
|
||||
GetPrimaryFrame(), record.mLayerType);
|
||||
// Unthrottle if the animation needs to be brought up to date
|
||||
if (!generation || effectSet->GetAnimationGeneration() != *generation) {
|
||||
return false;
|
||||
@@ -1282,6 +1278,12 @@ KeyframeEffect::CanThrottle() const
|
||||
}
|
||||
}
|
||||
|
||||
for (const AnimationProperty& property : mProperties) {
|
||||
if (!property.mIsRunningOnCompositor) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1800,7 +1800,7 @@ RestyleManager::AddLayerChangesForAnimation(nsIFrame* aFrame,
|
||||
LayerAnimationInfo::sRecords) {
|
||||
Maybe<uint64_t> generation =
|
||||
layers::AnimationInfo::GetGenerationFromFrame(aFrame,
|
||||
layerInfo.mDisplayItemType);
|
||||
layerInfo.mLayerType);
|
||||
if (generation && frameGeneration != *generation) {
|
||||
// If we have a transform layer bug don't have any transform style, we
|
||||
// probably just removed the transform but haven't destroyed the layer
|
||||
@@ -1821,7 +1821,7 @@ RestyleManager::AddLayerChangesForAnimation(nsIFrame* aFrame,
|
||||
// Note that we *don't* add nsChangeHint_UpdateTransformLayer since if we
|
||||
// did, ApplyRenderingChangeToTree would complain that we're updating a
|
||||
// transform layer without a transform.
|
||||
if (layerInfo.mDisplayItemType == DisplayItemType::TYPE_TRANSFORM &&
|
||||
if (layerInfo.mLayerType == DisplayItemType::TYPE_TRANSFORM &&
|
||||
!aFrame->StyleDisplay()->HasTransformStyle()) {
|
||||
// Add all the hints for a removing a transform if they are not already
|
||||
// set for this frame.
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# 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/.
|
||||
|
||||
import runpy
|
||||
|
||||
def generate(output, dataFile):
|
||||
output.write("""/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT */
|
||||
#ifndef COMPOSITOR_ANIMATABLE_PROPERTY_LIST
|
||||
#define COMPOSITOR_ANIMATABLE_PROPERTY_LIST { \\
|
||||
""")
|
||||
|
||||
def can_animate_on_compositor(p):
|
||||
return "CanAnimateOnCompositor" in p.flags
|
||||
|
||||
properties = runpy.run_path(dataFile)["data"]
|
||||
properties = filter(can_animate_on_compositor, properties)
|
||||
|
||||
for p in properties:
|
||||
output.write(" eCSSProperty_{}, \\\n".format(p.id))
|
||||
|
||||
output.write("}\n")
|
||||
output.write("#endif /* COMPOSITOR_ANIMATABLE_PROPERTY_LIST */\n")
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "LayerAnimationInfo.h"
|
||||
|
||||
#include "nsCSSProps.h" // For nsCSSProps::PropHasFlags
|
||||
#include "nsCSSPropertyIDSet.h" // For nsCSSPropertyIDSet::CompositorAnimatable
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -19,20 +18,6 @@ namespace mozilla {
|
||||
DisplayItemType::TYPE_OPACITY,
|
||||
nsChangeHint_UpdateOpacityLayer } };
|
||||
|
||||
/* static */ DisplayItemType
|
||||
LayerAnimationInfo::GetDisplayItemTypeForProperty(nsCSSPropertyID aProperty)
|
||||
{
|
||||
switch (aProperty) {
|
||||
case eCSSProperty_opacity:
|
||||
return DisplayItemType::TYPE_OPACITY;
|
||||
case eCSSProperty_transform:
|
||||
return DisplayItemType::TYPE_TRANSFORM;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return DisplayItemType::TYPE_ZERO;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* static */ void
|
||||
LayerAnimationInfo::Initialize()
|
||||
@@ -44,7 +29,6 @@ LayerAnimationInfo::Initialize()
|
||||
"have the CSSPropFlags::CanAnimateOnCompositor flag");
|
||||
}
|
||||
|
||||
nsCSSPropertyIDSet properties;
|
||||
// Check that every property with the flag for animating on the
|
||||
// compositor has an entry in LayerAnimationInfo::sRecords.
|
||||
for (nsCSSPropertyID prop = nsCSSPropertyID(0);
|
||||
@@ -56,20 +40,14 @@ LayerAnimationInfo::Initialize()
|
||||
for (const Record& record : sRecords) {
|
||||
if (record.mProperty == prop) {
|
||||
found = true;
|
||||
properties.AddProperty(record.mProperty);
|
||||
break;
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(found,
|
||||
"CSS property with the CSSPropFlags::CanAnimateOnCompositor "
|
||||
"flag does not have an entry in LayerAnimationInfo::sRecords");
|
||||
MOZ_ASSERT(GetDisplayItemTypeForProperty(prop) !=
|
||||
DisplayItemType::TYPE_ZERO,
|
||||
"GetDisplayItemTypeForProperty should return a valid display "
|
||||
"item type");
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(properties.Equals(nsCSSPropertyIDSet::CompositorAnimatables()));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "nsChangeHint.h"
|
||||
#include "nsCSSPropertyID.h"
|
||||
#include "nsCSSPropertyIDSet.h"
|
||||
#include "nsDisplayList.h" // For nsDisplayItem::Type
|
||||
|
||||
namespace mozilla {
|
||||
@@ -22,19 +21,11 @@ struct LayerAnimationInfo {
|
||||
// a record of the corresponding layer type and change hint.
|
||||
struct Record {
|
||||
nsCSSPropertyID mProperty;
|
||||
DisplayItemType mDisplayItemType;
|
||||
DisplayItemType mLayerType;
|
||||
nsChangeHint mChangeHint;
|
||||
};
|
||||
|
||||
// Returns the corresponding display item type for |aProperty| when it is
|
||||
// animated on the compositor.
|
||||
// Returns DisplayItemType::TYPE_ZERO if |aProperty| cannot be animated on the
|
||||
// compositor.
|
||||
static DisplayItemType
|
||||
GetDisplayItemTypeForProperty(nsCSSPropertyID aProperty);
|
||||
|
||||
static const size_t kRecords =
|
||||
nsCSSPropertyIDSet::CompositorAnimatableCount();
|
||||
static const size_t kRecords = 2;
|
||||
static const Record sRecords[kRecords];
|
||||
};
|
||||
|
||||
|
||||
@@ -291,23 +291,15 @@ servo_props.inputs = [
|
||||
|
||||
if CONFIG['COMPILE_ENVIRONMENT']:
|
||||
GENERATED_FILES += [
|
||||
'CompositorAnimatableProperties.h',
|
||||
'nsComputedDOMStyleGenerated.cpp',
|
||||
'nsCSSPropsGenerated.inc',
|
||||
'ServoStyleConsts.h',
|
||||
]
|
||||
|
||||
EXPORTS.mozilla += [
|
||||
'!CompositorAnimatableProperties.h',
|
||||
'!ServoStyleConsts.h',
|
||||
]
|
||||
|
||||
compositor = GENERATED_FILES['CompositorAnimatableProperties.h']
|
||||
compositor.script = 'GenerateCompositorAnimatableProperties.py:generate'
|
||||
compositor.inputs = [
|
||||
'!ServoCSSPropList.py',
|
||||
]
|
||||
|
||||
computed = GENERATED_FILES['nsComputedDOMStyleGenerated.cpp']
|
||||
computed.script = 'GenerateComputedDOMStyleGenerated.py:generate'
|
||||
computed.inputs = [
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
|
||||
#include "nsCSSPropertyID.h"
|
||||
#include <limits.h> // for CHAR_BIT
|
||||
#include <initializer_list>
|
||||
|
||||
// For COMPOSITOR_ANIMATABLE_PROPERTY_LIST
|
||||
#include "mozilla/CompositorAnimatableProperties.h"
|
||||
|
||||
/**
|
||||
* nsCSSPropertyIDSet maintains a set of non-shorthand CSS properties. In
|
||||
@@ -26,17 +22,6 @@ public:
|
||||
nsCSSPropertyIDSet() { Empty(); }
|
||||
// auto-generated copy-constructor OK
|
||||
|
||||
explicit constexpr nsCSSPropertyIDSet(
|
||||
std::initializer_list<nsCSSPropertyID> aProperties)
|
||||
: mProperties{0}
|
||||
{
|
||||
for (auto property : aProperties) {
|
||||
size_t p = property;
|
||||
mProperties[p / kBitsInChunk] |=
|
||||
property_set_type(1) << (p % kBitsInChunk);
|
||||
}
|
||||
}
|
||||
|
||||
void AssertInSetRange(nsCSSPropertyID aProperty) const {
|
||||
NS_ASSERTION(0 <= aProperty &&
|
||||
aProperty < eCSSProperty_COUNT_no_shorthands,
|
||||
@@ -67,29 +52,6 @@ public:
|
||||
(property_set_type(1) << (p % kBitsInChunk))) != 0;
|
||||
}
|
||||
|
||||
// Returns an nsCSSPropertyIDSet including all properties that can be run
|
||||
// on the compositor.
|
||||
static constexpr nsCSSPropertyIDSet CompositorAnimatables()
|
||||
{
|
||||
return nsCSSPropertyIDSet(COMPOSITOR_ANIMATABLE_PROPERTY_LIST);
|
||||
}
|
||||
|
||||
static constexpr size_t CompositorAnimatableCount()
|
||||
{
|
||||
auto list = COMPOSITOR_ANIMATABLE_PROPERTY_LIST;
|
||||
return list.size();
|
||||
}
|
||||
|
||||
bool Intersects(const nsCSSPropertyIDSet& aOther) const
|
||||
{
|
||||
for (size_t i = 0; i < mozilla::ArrayLength(mProperties); ++i) {
|
||||
if (mProperties[i] & aOther.mProperties[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Empty() {
|
||||
memset(mProperties, 0, sizeof(mProperties));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user