Bug 1435022 - Document some methods. r?sotaro draft
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 01 Feb 2018 16:28:53 -0500
changeset 750300 f4d29c4dd7c5e2e59d012c7eebcedac479ce74eb
parent 750299 9130b90c157d27882fc1278c3a3918ce187621dc
child 750301 93b3d41228449fec1458f08e1175c82d2db817a5
push id97612
push userkgupta@mozilla.com
push dateThu, 01 Feb 2018 21:30:35 +0000
reviewerssotaro
bugs1435022
milestone60.0a1
Bug 1435022 - Document some methods. r?sotaro MozReview-Commit-ID: CItOABKtjRl
gfx/layers/ipc/CompositorVsyncScheduler.h
--- a/gfx/layers/ipc/CompositorVsyncScheduler.h
+++ b/gfx/layers/ipc/CompositorVsyncScheduler.h
@@ -43,26 +43,49 @@ class CompositorVsyncSchedulerOwner;
 class CompositorVsyncScheduler
 {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorVsyncScheduler)
 
 public:
   explicit CompositorVsyncScheduler(CompositorVsyncSchedulerOwner* aVsyncSchedulerOwner,
                                     widget::CompositorWidget* aWidget);
 
+  /**
+   * Notify this class of a vsync. This will trigger a composite if one is
+   * needed. This must be called from the vsync dispatch thread.
+   */
   bool NotifyVsync(TimeStamp aVsyncTimestamp);
 
   /**
    * Do cleanup. This must be called on the compositor thread.
    */
   void Destroy();
 
+  /**
+   * Notify this class that a composition is needed. This will trigger a
+   * composition soon (likely at the next vsync). This must be called on the
+   * compositor thread.
+   */
   void ScheduleComposition();
+
+  /**
+   * Cancel any composite task that has been scheduled but hasn't run yet.
+   */
   void CancelCurrentCompositeTask();
+
+  /**
+   * Check if a composite is pending. This is generally true between a call
+   * to ScheduleComposition() and the time the composite happens.
+   */
   bool NeedsComposite();
+
+  /**
+   * Force a composite to happen right away, without waiting for the next vsync.
+   * This must be called on the compositor thread.
+   */
   void ForceComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect);
 
   const TimeStamp& GetLastComposeTime()
   {
     return mLastCompose;
   }
 
 #ifdef COMPOSITOR_PERFORMANCE_WARNING