Bug 1216030 - Part 10: Remove CanAnimate_AllowPartial flag. r=bbirtles

This commit is contained in:
Hiroyuki Ikezoe 2015-11-06 02:43:00 +01:00
parent 74a78cc5ad
commit 5a4953778a
2 changed files with 11 additions and 32 deletions

View File

@ -110,8 +110,7 @@ CommonAnimationManager::GetAnimationsForCompositor(const nsIFrame* aFrame,
AnimationCollection* collection = GetAnimationCollection(aFrame);
if (!collection ||
!collection->HasCurrentAnimationOfProperty(aProperty) ||
!collection->CanPerformOnCompositorThread(
AnimationCollection::CanAnimate_AllowPartial)) {
!collection->CanPerformOnCompositorThread()) {
return nullptr;
}
@ -427,8 +426,7 @@ AnimValuesStyleRule::List(FILE* out, int32_t aIndent) const
bool
AnimationCollection::CanAnimatePropertyOnCompositor(
const dom::Element *aElement,
nsCSSProperty aProperty,
CanAnimateFlags aFlags)
nsCSSProperty aProperty)
{
bool shouldLog = nsLayoutUtils::IsAnimationLoggingEnabled();
@ -449,15 +447,11 @@ AnimationCollection::CanAnimatePropertyOnCompositor(
return false;
}
}
bool propertyAllowed = (aProperty == eCSSProperty_transform) ||
(aProperty == eCSSProperty_opacity) ||
(aFlags & CanAnimate_AllowPartial);
return propertyAllowed;
return true;
}
bool
AnimationCollection::CanPerformOnCompositorThread(
CanAnimateFlags aFlags) const
AnimationCollection::CanPerformOnCompositorThread() const
{
if (!nsLayoutUtils::AreAsyncAnimationsEnabled()) {
if (nsLayoutUtils::IsAnimationLoggingEnabled()) {
@ -497,8 +491,7 @@ AnimationCollection::CanPerformOnCompositorThread(
propIdx != propEnd; ++propIdx) {
const AnimationProperty& prop = effect->Properties()[propIdx];
if (!CanAnimatePropertyOnCompositor(element,
prop.mProperty,
aFlags)) {
prop.mProperty)) {
return false;
}
}

View File

@ -240,12 +240,6 @@ struct AnimationCollection : public LinkedListElement<AnimationCollection>
void EnsureStyleRuleFor(TimeStamp aRefreshTime);
enum CanAnimateFlags {
// Allow the case where OMTA is allowed in general, but not for the
// specified property.
CanAnimate_AllowPartial = 1
};
enum class RestyleType {
// Animation style has changed but the compositor is applying the same
// change so we might be able to defer updating the main thread until it
@ -268,8 +262,7 @@ struct AnimationCollection : public LinkedListElement<AnimationCollection>
private:
static bool
CanAnimatePropertyOnCompositor(const dom::Element *aElement,
nsCSSProperty aProperty,
CanAnimateFlags aFlags);
nsCSSProperty aProperty);
bool CanThrottleAnimation(TimeStamp aTime);
bool CanThrottleTransformChanges(TimeStamp aTime);
@ -277,22 +270,15 @@ private:
public:
// True if this animation can be performed on the compositor thread.
//
// If aFlags contains CanAnimate_AllowPartial, returns whether the
// state of this element's animations at the current refresh driver
// time contains animation data that can be done on the compositor
// thread. (This is useful for determining whether a layer should be
// active, or whether to send data to the layer.)
//
// If aFlags does not contain CanAnimate_AllowPartial, returns whether
// the state of this element's animations at the current refresh driver
// time can be fully represented by data sent to the compositor.
// (This is useful for determining whether throttle the animation
// (suppress main-thread style updates).)
// Returns whether the state of this element's animations at the current
// refresh driver time contains animation data that can be done on the
// compositor thread. (This is used for determining whether a layer
// should be active, or whether to send data to the layer.)
//
// Note that this does not test whether the element's layer uses
// off-main-thread compositing, although it does check whether
// off-main-thread compositing is enabled as a whole.
bool CanPerformOnCompositorThread(CanAnimateFlags aFlags) const;
bool CanPerformOnCompositorThread() const;
bool HasCurrentAnimationOfProperty(nsCSSProperty aProperty) const;