Граф коммитов

32 Коммитов

Автор SHA1 Сообщение Дата
Boris Chiou 22e871661b Bug 1067769 - Part 6: Rename NonOwningAnimationTarget.h to AnimationTarget.h. r=birtles
MozReview-Commit-ID: ErAaPe6ttjc

--HG--
rename : dom/animation/NonOwningAnimationTarget.h => dom/animation/AnimationTarget.h
extra : rebase_source : 79b52ece67f16bd32ac8c07d698a9aae076fe5fe
2016-04-28 23:22:43 +08:00
Brian Birtles 344398e8f8 Bug 1260983 - Update animation properties when the style context changes; r=heycam
MozReview-Commit-ID: L4ugcD7BxNX
2016-04-01 09:31:51 +09:00
Boris Chiou efe45f15d3 Bug 1249219 - Part 3: Replace Pair<Element*, CSSPseudoElementType> with NonOwningAnimationTarget. r=birtles
--HG--
extra : rebase_source : 35e69a293cdb7a25ce579dbb453289ed3521e7e2
2016-03-21 16:49:50 +08:00
Hiroyuki Ikezoe 9cacbd5b2d Bug 1196114 - Part 5: Store performce warning information as enum type. r=birtles
Each warning message is generated only when getPropertyState() is called.

MozReview-Commit-ID: C03ZSvPv9ff

--HG--
extra : rebase_source : 5932957f8f0b171c7b100b1c22e70513959c819e
2016-03-04 17:54:25 +09:00
Hiroyuki Ikezoe 3534158709 Bug 1196114 - Part 1: Add SetPerformanceWarning. r=birtles
MozReview-Commit-ID: 8NqvuOjKfZM

--HG--
extra : rebase_source : 07c0a1500171569de0471b96f22bd79c38165e02
2016-03-04 06:36:36 +09:00
Boris Chiou e436478f26 Bug 1244049 - Part 2: Replace nsCSSPseudoElements::Type with CSSPseudoElementType. r=dbaron
Also, try to use forward declaraions for CSSPseudoElementType;

--HG--
extra : rebase_source : c00eb9753e8f618a33aa711538ac45c0132b353c
2016-02-17 21:37:00 +01:00
Brian Birtles 6fb8992111 Bug 1235112 - Move animation style rule processors to EffectCompositor; r=heycam 2016-01-15 15:15:47 +09:00
Nigel Babu 0ce7a5f39e Backed out 5 changesets (bug 1235112, bug 1237467) for nsRuleNode::Transition crashes
Backed out changeset ac21baf87df2 (bug 1235112)
Backed out changeset c47a6e0a6d95 (bug 1237467)
Backed out changeset 7609ca218902 (bug 1237467)
Backed out changeset d63ca2677bd5 (bug 1237467)
Backed out changeset 5a3d7e16b1e0 (bug 1237467)

--HG--
extra : commitid : LONozKsGtli
2016-01-14 11:35:06 +05:30
Brian Birtles 32bf08d255 Bug 1235112 - Move animation style rule processors to EffectCompositor; r=heycam 2016-01-14 08:02:39 +09:00
Brian Birtles d549991eb2 Bug 1232577 part 19 - Move ClearIsRunningOnCompositor to EffectCompositor; r=heycam 2016-01-13 07:54:56 +09:00
Brian Birtles 7236a7fdbd Bug 1232577 part 18 - Drop RestyleManager::mLastUpdateForThrottledAnimations; r=heycam
RestyleManager currently has a piece of state for tracking if throttled
animations are up-to-date or not. Actually, it's not so much about throttled
animations but really about outstanding changes to animation styles (which
is typically expected to be due to throttling animations but there are
other cases that invalidate the animation style rule that we should be
considering here).

We now have that same information stored in the EffectCompositor so we can
remove the redundant state from RestyleManager. Furthermore, the state stored
in EffectCompositor is more accurate since it captures the case when animation
style needs to be updated twice within a tick, or when nothing needs to be
updated within a tick.

This patch, therefore, introduces EffectCompositor::HasPendingStyleUpdates in
place of setting RestyleManager::mLastUpdateForThrottledAnimations.

nsTransitionManager also uses mLastUpdateForThrottledAnimations to warn if we
have not processed throttled animations. We can't use HasPendingStyleUpdates
here however, since it will return true in the case where we have triggered new
transitions in the process of restyling. However, any new transitions will
trigger "standard" (i.e. not throttled) restyles so we introduce another
method, HasThrottledStyleUpdates, that returns true only if we have outstanding
throttled updates and use this for the warning inside nsTransitionManager.
2016-01-13 07:54:55 +09:00
Brian Birtles dab2f9c064 Bug 1232577 part 17 - Move AddStyleUpdatesTo to EffectCompositor; r=heycam 2016-01-13 07:54:55 +09:00
Brian Birtles 309027bbe9 Bug 1232577 part 16 - Move GetAnimationRule to EffectCompositor; r=heycam 2016-01-13 07:54:55 +09:00
Brian Birtles b65c8d2610 Bug 1232577 part 14 - Move FlushAnimations to EffectCompositor; r=heycam 2016-01-13 07:54:55 +09:00
Brian Birtles b29e0fc6c2 Bug 1232577 part 10 - Remove AnimationCollection::mStyleChanging; r=heycam
This flag is no longer needed because in bug 1232563 we introduced a more
thorough optimization that detects when the animation is not changing by
comparing the progress value between samples and avoids requesting restyles
when it does not change.
2016-01-13 07:54:54 +09:00
Brian Birtles 71a9cf43cb Bug 1232577 part 9 - Remove AnimationCollection::mStyleRuleRefreshTime; r=heycam
Now that we track whether or not animations are up to date using the hashset in
EffectCompositor, we can remove the mStyleRuleRefreshTime flag that is, as of
part 5 of this patch series, now only used for detecting whether or not
animations are up to date.

In order to preserve the existing behavior of FlushAnimations, however, this
patch temporarily introduces a method to indicate if there are throttled
animations or not.

It might not be obvious that FlushAnimations is only concerned with throttled
animations due to its name. FlushAnimations is simply intended to post
animation restyles for out-of-date animations. Any animations that are *not*
throttled will either be up to date, or we will have already posted an
animation restyle so we only need to consider throttled animations in this case.
2016-01-13 07:54:54 +09:00
Brian Birtles cf26e7b69b Bug 1232577 part 8 - Move call to PostRestyleForAnimation to EffectCompositor; r=heycam
This patch continues to migrate functionality from
AnimationCollection::RequestRestyle to EffectCompositor::RequestRestyle.

In order to post the animation restyle from the EffectCompositor, this patch
also moves the PostRestyleForAnimation method to EffectCompositor.
The GetElementToRestyle method is temporarily duplicated in both
EffectCompositor and AnimationCollection however we will remove the version in
AnimationCollection later in this patch series.
2016-01-13 07:54:54 +09:00
Brian Birtles 464b5fb4b7 Bug 1232577 part 6 - Add animation rule refresh time to EffectSet; r=heycam
AnimationCollection keeps a TimeStamp that records the refresh driver time when
the animation style rule was last updated. This is used for two purposes:

1. To determine when the style rule is out of date.

2. For animations that are partially throttled on the main thread, e.g.
   transform animations that affect the scrollable region which we update every
   200ms on the main thread.

In this bug we are removing all the overlapping bits of state used to track if
animations are up-to-date or not and replacing them with the hashmap stored on
the EffectCompositor which tracks which animations are currently in need of an
update. As a result, we would like to remove this style rule refresh time.
However, we will need something for case (2) from above.

This patch adds an animation rule refresh time to the EffectSet purely for the
purposes of partially-throttled animations so that we can later remove the style
rule refresh time from AnimationCollection.
2016-01-13 07:54:54 +09:00
Brian Birtles 815e0c4b64 Bug 1232577 part 4 - Add and remove (pseudo-)elements needing an animation style rule update to the EffectCompositor; r=heycam
This patch uses the presence/absence of (pseudo-)elements in the "needs
animation rule update" hashmap on EffectCompositor to detect if a style update
is required. The various flags in AnimationCollection that do a similar job
still remain so that we can remove them one-by-one in subsequent patches in
this series.
2016-01-13 07:54:53 +09:00
Brian Birtles 03057136c3 Bug 1232577 part 3 - Move RestyleType to EffectCompositor; r=heycam
This is in preparation for moving RequestRestyle to EffectCompositor (and
because we'll run into compile issues if we don't since AnimationCommon.h
includes too many interdependent definitions).
2016-01-13 07:54:53 +09:00
Brian Birtles a0f05d7d7e Bug 1232577 part 2 - Add a hashmap to ElementCompositor to track which (pseudo-) elements need to have their animation style rule updated; r=heycam
We will eventually use this in place of the various state flags stored on
AnimationCollection (e.g. mStyleRuleRefreshTime, mStyleChanging,
mHasPendingAnimationRestyle) as well as to do a more targetted update in
FlushAnimations and AddStyleUpdatesTo.
2016-01-13 07:54:53 +09:00
Brian Birtles 641025e212 Bug 1232577 part 1 - Add EffectCompositor as a member of nsPresContext; r=heycam
Since we want to track elements needing a restyle on EffectCompositor we need
to scope it to an nsPresContext rather than just making if a collection of
static methods.
2016-01-13 07:54:53 +09:00
Brian Birtles 0d628b2a55 Bug 1232561 part 4 - Add EffectCompositor::ComposeAnimationRule; r=heycam
This patch just moves a piece of functionality from
AnimationCollection::EnsureStyleRuleFor to the EffectCompositor. In subsequent
bugs we will move more and more of this functionality across until this
logic is fully contained in the EffectCompositor.

--HG--
extra : rebase_source : 7ffe91adb4ca3d57fc8f6ae3f7e5f7bec91f350b
2016-01-06 11:04:06 +09:00
Brian Birtles a736eafacc Bug 1232561 part 2 - Move the animation style rules from AnimationCollection to EffectSet; r=heycam
This is needed in order to support script-generated animations since they do not
belong to any AnimationCollection.

This patch adopts the naming "animation rule" over "style rule". Currently we
are inconsistent about this (e.g. GetAnimationRule vs EnsureStyleRuleFor).
We don't do a mass rename here but just a few places near where we're touching.
Many of the other references to "style rule" will be revised in this bug or
related bugs so we can fix those references when we come to them.

--HG--
extra : rebase_source : e1f824029b39960915e056328447de256b6c1c6d
2016-01-06 11:04:06 +09:00
Brian Birtles cb3f0f2256 Bug 1232561 part 1 - Replace AppliesToTransitionsLevel() with a cascade level enumeration; r=heycam
Introducing an enum will simplify further patches in this series by providing
a common vocabulary for this distinction.

--HG--
extra : rebase_source : 4afbd358a401853df3ad401f2b1c3454ccff26cd
2016-01-06 11:04:05 +09:00
Brian Birtles bf9f389bda Bug 1228229 part 11 - Avoid calling nsRuleNode::ComputePropertiesOverridingAnimation when there are no compositor-animatable properties; r=dbaron
This restores the code removed in part 3 but adjusts it to iterate over
an effect set instead of an AnimationCollection. It also adds an early return
for the case where no compositor-animatable properties are found.

--HG--
extra : rebase_source : 5e73374c8fb7df4e946f73512337a55f5dae94f2
2016-01-06 11:04:05 +09:00
Brian Birtles 741d976ea1 Bug 1228229 part 10 - Remove no-longer-used cascade functions; r=dbaron
--HG--
extra : rebase_source : 3cdff84fefbc24796abf2d765f6f40062dd7941f
2016-01-06 11:04:05 +09:00
Brian Birtles f14f3a2be8 Bug 1228229 part 8 - Add EffectCompositor::(Maybe)UpdateCascadeResults; r=dbaron
--HG--
extra : rebase_source : 7f87c5a33e153e0815d39b7eb21917f3c034c0d3
2016-01-06 11:04:05 +09:00
Brian Birtles 114b1e3ebd Bug 1228229 part 3 - Factor out a method to get compositor-animatable overridden properties; r=dbaron
This patch also simplifies this logic by simply always looking for overrides of
'transform' and 'opacity'.

--HG--
extra : rebase_source : d1e432e629e2b97651f14c784f97c03f55d217be
2016-01-06 11:04:04 +09:00
Brian Birtles 5d5fb26344 Bug 1228229 part 2 - Add a helper to get the appropriate (pseudo-)element for a frame; r=dbaron
We will use similar logic later in this patch series so we separate it out into
a separate helper function here.

--HG--
extra : rebase_source : 00cb49e7829bdef7a6084059b31fe2ef4b921af5
2016-01-06 11:04:04 +09:00
Brian Birtles c70be15294 Bug 1230056 part 1 - Add EffectCompositor::HasAnimationsForCompositor; r=dholbert 2015-12-09 16:28:10 -05:00
Brian Birtles 7806ce3d5d Bug 1226118 part 8 - Add EffectCompositor::GetAnimationsForCompositor that uses the EffectSet rather than AnimationCollection; r=dholbert
This added method should behave in an equivalent manner to the existing
CommonAnimationManager::GetAnimationsForCompositor except for the following
differences:

* It uses the EffectSet attached to a target element rather than one of the
  AnimationCollection object on the owning element.

* It returns an array of Animation objects consisting of only those Animations
  that actually have the specified property as opposed to the
  AnimationCollection consisting of *all* CSS animations or *all* CSS
  transitions for the element regardless of whether they run on the compositor
  or not.

It may not be obvious why these two methods otherwise behave in an equivalent
fashion so the following explains how the existing code is mirrored in the new
method.

The existing code is as follows:

> AnimationCollection*
> CommonAnimationManager::GetAnimationsForCompositor(const nsIFrame* aFrame,
>                                                    nsCSSProperty aProperty)
> {
>   AnimationCollection* collection = GetAnimationCollection(aFrame);
>   if (!collection ||
>       !collection->HasCurrentAnimationOfProperty(aProperty) ||
>       !collection->CanPerformOnCompositorThread(aFrame)) {
>     return nullptr;
>   }
>
>   // This animation can be done on the compositor.
>   return collection;
> }

The new EffectCompositor::GetAnimationsForCompositor begins with two checks
performed at the beginning of CanPerformOnCompositorThread: the checks for
whether async animations are enabled or not and whether the frame has refused
async animations since these are cheap and it makes sense to check them first.

The next part of EffectCompositor::GetAnimationsForCompositor checks if there is
an EffectSet associated with the frame. This is equivalent to the check whether
|collection| is null or not above.

Following, we iterate through the effects in the EffectSet.

We first check if each effect is playing or not. In the above code,
HasCurrentAnimationOfProperty only checks if the effect is *current* or not.
However, CanPerformOnCompositorThread will only return true if it finds an
animation that can run on the compositor that is *playing*. Since playing is
a strict subset of current we only need to perform the more restrictive test.

Next we check if the effect should block running other animations on the
compositor. This is equivalent to the remainder of CanPerformOnCompositorThread.
Note that the order is important here. Only playing animations should block
other animations from running on the compositor. Furthermore, this needs to
happen before the following step since animations of property other than
|aProperty| can still block animations from running on the compositor.

Finally, we check if the effect has an animation of |aProperty|. This is
equivalent to the remainder of HasCurrentAnimationOfProperty.

If all these checks succeed, we add the effect's animation to the result to
return.
2015-12-04 08:34:12 +09:00