From c44f6aace43eb0b6bde47cd5b1a82da1617710d8 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Mon, 18 Jan 2016 15:23:08 -0500 Subject: [PATCH] Bug 1213095 - Inline the DispatchRepaintRequest function. r=botond --HG-- extra : commitid : DrbeUIsKQbQ --- gfx/layers/apz/src/AsyncPanZoomController.cpp | 33 ++++++++----------- gfx/layers/apz/src/AsyncPanZoomController.h | 6 ---- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 8304b2c7122d..4786d5d631b5 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -2808,6 +2808,17 @@ 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(); @@ -2836,25 +2847,6 @@ void AsyncPanZoomController::RequestContentRepaint(FrameMetrics& aFrameMetrics) } 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 controller = GetGeckoContentController(); if (!controller) { return; @@ -2863,7 +2855,7 @@ AsyncPanZoomController::DispatchRepaintRequest(const FrameMetrics& aFrameMetrics 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), @@ -2878,6 +2870,7 @@ AsyncPanZoomController::DispatchRepaintRequest(const FrameMetrics& aFrameMetrics } mExpectedGeckoMetrics = aFrameMetrics; mLastPaintRequestMetrics = aFrameMetrics; + aFrameMetrics.SetPresShellId(mLastContentPaintMetrics.GetPresShellId()); } bool AsyncPanZoomController::UpdateAnimation(const TimeStamp& aSampleTime, diff --git a/gfx/layers/apz/src/AsyncPanZoomController.h b/gfx/layers/apz/src/AsyncPanZoomController.h index 9d955ddbb2c4..3d6e73305b9d 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.h +++ b/gfx/layers/apz/src/AsyncPanZoomController.h @@ -593,12 +593,6 @@ protected: */ 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.