зеркало из https://github.com/mozilla/gecko-dev.git
Bug 947337 - Track the last metrics actually sent to Gecko after coming out of the throttler. r=botond
This commit is contained in:
Родитель
394d08efea
Коммит
f9b3dd70c2
|
@ -1370,6 +1370,19 @@ void AsyncPanZoomController::RequestContentRepaint(FrameMetrics& aFrameMetrics)
|
||||||
}
|
}
|
||||||
|
|
||||||
SendAsyncScrollEvent();
|
SendAsyncScrollEvent();
|
||||||
|
mPaintThrottler.PostTask(
|
||||||
|
FROM_HERE,
|
||||||
|
NewRunnableMethod(this,
|
||||||
|
&AsyncPanZoomController::DispatchRepaintRequest,
|
||||||
|
aFrameMetrics),
|
||||||
|
GetFrameTime());
|
||||||
|
|
||||||
|
aFrameMetrics.mPresShellId = mLastContentPaintMetrics.mPresShellId;
|
||||||
|
mLastPaintRequestMetrics = aFrameMetrics;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AsyncPanZoomController::DispatchRepaintRequest(const FrameMetrics& aFrameMetrics) {
|
||||||
nsRefPtr<GeckoContentController> controller = GetGeckoContentController();
|
nsRefPtr<GeckoContentController> controller = GetGeckoContentController();
|
||||||
if (controller) {
|
if (controller) {
|
||||||
APZC_LOG_FM(aFrameMetrics, "%p requesting content repaint", this);
|
APZC_LOG_FM(aFrameMetrics, "%p requesting content repaint", this);
|
||||||
|
@ -1377,15 +1390,9 @@ void AsyncPanZoomController::RequestContentRepaint(FrameMetrics& aFrameMetrics)
|
||||||
LogRendertraceRect(GetGuid(), "requested displayport", "yellow",
|
LogRendertraceRect(GetGuid(), "requested displayport", "yellow",
|
||||||
aFrameMetrics.mDisplayPort + aFrameMetrics.mScrollOffset);
|
aFrameMetrics.mDisplayPort + aFrameMetrics.mScrollOffset);
|
||||||
|
|
||||||
mPaintThrottler.PostTask(
|
controller->RequestContentRepaint(aFrameMetrics);
|
||||||
FROM_HERE,
|
mLastDispatchedPaintMetrics = aFrameMetrics;
|
||||||
NewRunnableMethod(controller.get(),
|
|
||||||
&GeckoContentController::RequestContentRepaint,
|
|
||||||
aFrameMetrics),
|
|
||||||
GetFrameTime());
|
|
||||||
}
|
}
|
||||||
aFrameMetrics.mPresShellId = mLastContentPaintMetrics.mPresShellId;
|
|
||||||
mLastPaintRequestMetrics = aFrameMetrics;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1553,15 +1560,18 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aIsFirstPaint || isDefault) {
|
if (aIsFirstPaint || isDefault) {
|
||||||
|
// Initialize our internal state to something sane when the content
|
||||||
|
// that was just painted is something we knew nothing about previously
|
||||||
mPaintThrottler.ClearHistory();
|
mPaintThrottler.ClearHistory();
|
||||||
mPaintThrottler.SetMaxDurations(gNumPaintDurationSamples);
|
mPaintThrottler.SetMaxDurations(gNumPaintDurationSamples);
|
||||||
|
|
||||||
mX.CancelTouch();
|
mX.CancelTouch();
|
||||||
mY.CancelTouch();
|
mY.CancelTouch();
|
||||||
|
SetState(NOTHING);
|
||||||
|
|
||||||
mFrameMetrics = aLayerMetrics;
|
mFrameMetrics = aLayerMetrics;
|
||||||
|
mLastDispatchedPaintMetrics = aLayerMetrics;
|
||||||
ShareCompositorFrameMetrics();
|
ShareCompositorFrameMetrics();
|
||||||
SetState(NOTHING);
|
|
||||||
} else {
|
} else {
|
||||||
// If we're not taking the aLayerMetrics wholesale we still need to pull
|
// If we're not taking the aLayerMetrics wholesale we still need to pull
|
||||||
// in some things into our local mFrameMetrics because these things are
|
// in some things into our local mFrameMetrics because these things are
|
||||||
|
|
|
@ -484,6 +484,11 @@ protected:
|
||||||
*/
|
*/
|
||||||
void RequestContentRepaint(FrameMetrics& aFrameMetrics);
|
void RequestContentRepaint(FrameMetrics& aFrameMetrics);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Actually send the next pending paint request to gecko.
|
||||||
|
*/
|
||||||
|
void DispatchRepaintRequest(const FrameMetrics& aFrameMetrics);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Advances a fling by an interpolated amount based on the passed in |aDelta|.
|
* Advances a fling by an interpolated amount based on the passed in |aDelta|.
|
||||||
* This should be called whenever sampling the content transform for this
|
* This should be called whenever sampling the content transform for this
|
||||||
|
@ -635,6 +640,11 @@ private:
|
||||||
// that we're not requesting a paint of the same thing that's already drawn.
|
// that we're not requesting a paint of the same thing that's already drawn.
|
||||||
// If we don't do this check, we don't get a ShadowLayersUpdated back.
|
// If we don't do this check, we don't get a ShadowLayersUpdated back.
|
||||||
FrameMetrics mLastPaintRequestMetrics;
|
FrameMetrics mLastPaintRequestMetrics;
|
||||||
|
// The last metrics that we actually sent to Gecko. This allows us to transform
|
||||||
|
// inputs into a coordinate space that Gecko knows about. This assumes the pipe
|
||||||
|
// through which input events and repaint requests are sent to Gecko operates
|
||||||
|
// in a FIFO manner.
|
||||||
|
FrameMetrics mLastDispatchedPaintMetrics;
|
||||||
|
|
||||||
nsTArray<MultiTouchInput> mTouchQueue;
|
nsTArray<MultiTouchInput> mTouchQueue;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче