Bug 1213095 - Inline the DispatchRepaintRequest function. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 18 Jan 2016 15:23:08 -0500
changeset 280404 1c4fcd82c71d11e503c904fbf93f2e930d0b327a
parent 280403 9e376b08b9787b3012b9fe294425595601f5efbc
child 280405 1e5a5bfc9561b611aff4f8f6dd5816d26eb8d027
push id70434
push userkgupta@mozilla.com
push dateMon, 18 Jan 2016 20:24:53 +0000
treeherdermozilla-inbound@d7c04b4c6cff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1213095
milestone46.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 1213095 - Inline the DispatchRepaintRequest function. r=botond
gfx/layers/apz/src/AsyncPanZoomController.cpp
gfx/layers/apz/src/AsyncPanZoomController.h
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -2803,16 +2803,27 @@ int32_t AsyncPanZoomController::GetLastT
   RefPtr<GestureEventListener> listener = GetGestureEventListener();
   return listener ? listener->GetLastTouchIdentifier() : -1;
 }
 
 void AsyncPanZoomController::RequestContentRepaint() {
   RequestContentRepaint(mFrameMetrics);
 }
 
+/*static*/ CSSRect
+GetDisplayPortRect(const FrameMetrics& aFrameMetrics)
+{
+  // This computation is based on what happens in CalculatePendingDisplayPort. If that
+  // changes then this might need to change too
+  CSSRect baseRect(aFrameMetrics.GetScrollOffset(),
+                   aFrameMetrics.CalculateBoundedCompositedSizeInCssPixels());
+  baseRect.Inflate(aFrameMetrics.GetDisplayPortMargins() / aFrameMetrics.DisplayportPixelsPerCSSPixel());
+  return baseRect;
+}
+
 void AsyncPanZoomController::RequestContentRepaint(FrameMetrics& aFrameMetrics)
 {
   ParentLayerPoint velocity = GetVelocityVector();
   aFrameMetrics.SetDisplayPortMargins(CalculatePendingDisplayPort(aFrameMetrics, velocity));
   aFrameMetrics.SetUseDisplayPortMargins(true);
 
   // If we're trying to paint what we already think is painted, discard this
   // request since it's a pointless paint.
@@ -2831,58 +2842,40 @@ void AsyncPanZoomController::RequestCont
             mLastPaintRequestMetrics.GetViewport().width) < EPSILON &&
       fabsf(aFrameMetrics.GetViewport().height -
             mLastPaintRequestMetrics.GetViewport().height) < EPSILON &&
       aFrameMetrics.GetScrollGeneration() == mLastPaintRequestMetrics.GetScrollGeneration()) {
     return;
   }
 
   aFrameMetrics.SetPaintRequestTime(TimeStamp::Now());
-  DispatchRepaintRequest(aFrameMetrics, velocity);
-  aFrameMetrics.SetPresShellId(mLastContentPaintMetrics.GetPresShellId());
-}
-
-/*static*/ CSSRect
-GetDisplayPortRect(const FrameMetrics& aFrameMetrics)
-{
-  // This computation is based on what happens in CalculatePendingDisplayPort. If that
-  // changes then this might need to change too
-  CSSRect baseRect(aFrameMetrics.GetScrollOffset(),
-                   aFrameMetrics.CalculateBoundedCompositedSizeInCssPixels());
-  baseRect.Inflate(aFrameMetrics.GetDisplayPortMargins() / aFrameMetrics.DisplayportPixelsPerCSSPixel());
-  return baseRect;
-}
-
-void
-AsyncPanZoomController::DispatchRepaintRequest(const FrameMetrics& aFrameMetrics,
-                                               const ParentLayerPoint& aVelocity)
-{
   RefPtr<GeckoContentController> controller = GetGeckoContentController();
   if (!controller) {
     return;
   }
 
   APZC_LOG_FM(aFrameMetrics, "%p requesting content repaint", this);
   if (mCheckerboardEvent) {
     std::stringstream info;
-    info << " velocity " << aVelocity;
+    info << " velocity " << velocity;
     std::string str = info.str();
     mCheckerboardEvent->UpdateRendertraceProperty(
         CheckerboardEvent::RequestedDisplayPort, GetDisplayPortRect(aFrameMetrics),
         str);
   }
 
   if (NS_IsMainThread()) {
     controller->RequestContentRepaint(aFrameMetrics);
   } else {
     NS_DispatchToMainThread(NS_NewRunnableMethodWithArg<FrameMetrics>(
       controller, &GeckoContentController::RequestContentRepaint, aFrameMetrics));
   }
   mExpectedGeckoMetrics = aFrameMetrics;
   mLastPaintRequestMetrics = aFrameMetrics;
+  aFrameMetrics.SetPresShellId(mLastContentPaintMetrics.GetPresShellId());
 }
 
 bool AsyncPanZoomController::UpdateAnimation(const TimeStamp& aSampleTime,
                                              Vector<Task*>* aOutDeferredTasks)
 {
   APZThreadUtils::AssertOnCompositorThread();
 
   // This function may get called multiple with the same sample time, because
--- a/gfx/layers/apz/src/AsyncPanZoomController.h
+++ b/gfx/layers/apz/src/AsyncPanZoomController.h
@@ -589,22 +589,16 @@ protected:
    * metrics.  (Helper function used by RequestContentRepaint.) If aThrottled
    * is set to false, the repaint request is sent directly without going through
    * the paint throttler. In particular, the GeckoContentController::RequestContentRepaint
    * function will be invoked before this function returns.
    */
   void RequestContentRepaint(FrameMetrics& aFrameMetrics);
 
   /**
-   * Actually send the next pending paint request to gecko.
-   */
-  void DispatchRepaintRequest(const FrameMetrics& aFrameMetrics,
-                              const ParentLayerPoint& aVelocity);
-
-  /**
    * Gets the current frame metrics. This is *not* the Gecko copy stored in the
    * layers code.
    */
   const FrameMetrics& GetFrameMetrics() const;
 
   /**
    * Gets the pointer to the apzc tree manager. All the access to tree manager
    * should be made via this method and not via private variable since this method