Bug 1161049 patch 2 - Add comments reflecting what CanPerformOnCompositorThread doesn't check. r=birtles
authorL. David Baron <dbaron@dbaron.org>
Fri, 08 May 2015 15:56:36 +0200
changeset 274396 e09370e4a89581dfba7b68c998ca0e2e76b46ff0
parent 274395 b1385ccee5f2222a8603f3b5ff035bc2531d85a6
child 274397 c33b62fc04ac93aa522ac0b55b8273447d6c8c65
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1161049
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1161049 patch 2 - Add comments reflecting what CanPerformOnCompositorThread doesn't check. r=birtles
layout/style/AnimationCommon.h
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -156,16 +156,24 @@ protected:
   virtual nsIAtom* GetAnimationsAtom() = 0;
   virtual nsIAtom* GetAnimationsBeforeAtom() = 0;
   virtual nsIAtom* GetAnimationsAfterAtom() = 0;
 
   virtual bool IsAnimationManager() {
     return false;
   }
 
+  // Return an AnimationCollection* if we have an animation for
+  // the element aContent and pseudo-element indicator aElementProperty
+  // that can be performed on the compositor thread (as defined by 
+  // AnimationCollection::CanPerformOnCompositorThread).
+  //
+  // 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.
   static AnimationCollection*
   GetAnimationsForCompositor(nsIContent* aContent,
                              nsIAtom* aElementProperty,
                              nsCSSProperty aProperty);
 
   PRCList mElementCollections;
   nsPresContext *mPresContext; // weak (non-null from ctor to Disconnect)
   bool mIsObservingRefreshDriver;
@@ -278,36 +286,42 @@ struct AnimationCollection : public PRCL
   enum CanAnimateFlags {
     // Testing for width, height, top, right, bottom, or left.
     CanAnimate_HasGeometricProperty = 1,
     // Allow the case where OMTA is allowed in general, but not for the
     // specified property.
     CanAnimate_AllowPartial = 2
   };
 
+private:
   static bool
   CanAnimatePropertyOnCompositor(const dom::Element *aElement,
                                  nsCSSProperty aProperty,
                                  CanAnimateFlags aFlags);
 
+public:
   static bool IsCompositorAnimationDisabledForFrame(nsIFrame* aFrame);
 
   // 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).)
+  //
+  // 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;
 
   void PostUpdateLayerAnimations();
 
   bool HasAnimationOfProperty(nsCSSProperty aProperty) const;
 
   bool IsForElement() const { // rather than for a pseudo-element
     return mElementProperty == nsGkAtoms::animationsProperty ||