Bug 1216355 - Ensure that if a repaint request is ignored due to a stale generation number the next repaint request doesn't get dropped. r=botond

--HG--
extra : commitid : 5Zh7BCHsJWF
This commit is contained in:
Kartikaya Gupta 2015-11-05 09:31:39 -05:00
Родитель 3a98b54f34
Коммит fba7cabf57
1 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -2741,8 +2741,11 @@ void AsyncPanZoomController::RequestContentRepaint(FrameMetrics& aFrameMetrics,
fabsf(mLastPaintRequestMetrics.GetScrollOffset().y -
aFrameMetrics.GetScrollOffset().y) < EPSILON &&
aFrameMetrics.GetZoom() == mLastPaintRequestMetrics.GetZoom() &&
fabsf(aFrameMetrics.GetViewport().width - mLastPaintRequestMetrics.GetViewport().width) < EPSILON &&
fabsf(aFrameMetrics.GetViewport().height - mLastPaintRequestMetrics.GetViewport().height) < EPSILON) {
fabsf(aFrameMetrics.GetViewport().width -
mLastPaintRequestMetrics.GetViewport().width) < EPSILON &&
fabsf(aFrameMetrics.GetViewport().height -
mLastPaintRequestMetrics.GetViewport().height) < EPSILON &&
aFrameMetrics.GetScrollGeneration() == mLastPaintRequestMetrics.GetScrollGeneration()) {
return;
}
@ -3190,8 +3193,14 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
Stringify(mFrameMetrics.GetScrollOffset()).c_str(),
Stringify(aLayerMetrics.GetSmoothScrollOffset()).c_str());
mFrameMetrics.CopySmoothScrollInfoFrom(aLayerMetrics);
CancelAnimation();
// It's important to not send repaint requests between this
// CopySmoothScrollInfo call and the sending of the scroll update
// acknowledgement below, otherwise that repaint request will get rejected
// on the main thread but mLastPaintRequestMetrics will have the new scroll
// generation; this would leave the main thread out of date.
mFrameMetrics.CopySmoothScrollInfoFrom(aLayerMetrics);
mLastDispatchedPaintMetrics = aLayerMetrics;
StartSmoothScroll(ScrollSource::DOM);