Bug 825556 - RequestContentRepaint frequency should be possible to limit with some timeout. r=drs

This commit is contained in:
Oleg Romashin 2013-01-04 19:24:15 -08:00
parent 8438acbbc4
commit 2320faae9c

View File

@ -92,6 +92,7 @@ AsyncPanZoomController::AsyncPanZoomController(GeckoContentController* aGeckoCon
mMonitor("AsyncPanZoomController"),
mLastSampleTime(TimeStamp::Now()),
mState(NOTHING),
mPreviousPaintStartTime(TimeStamp::Now()),
mLastAsyncScrollTime(TimeStamp::Now()),
mLastAsyncScrollOffset(0, 0),
mCurrentAsyncScrollOffset(0, 0),
@ -674,7 +675,10 @@ void AsyncPanZoomController::TrackTouch(const MultiTouchInput& aEvent) {
ScrollBy(gfx::Point(xDisplacement, yDisplacement));
ScheduleComposite();
RequestContentRepaint();
TimeDuration timePaintDelta = TimeStamp::Now() - mPreviousPaintStartTime;
if (timePaintDelta.ToMilliseconds() > PAN_REPAINT_INTERVAL) {
RequestContentRepaint();
}
}
}
@ -708,7 +712,10 @@ bool AsyncPanZoomController::DoFling(const TimeDuration& aDelta) {
mX.GetDisplacementForDuration(inverseResolution, aDelta),
mY.GetDisplacementForDuration(inverseResolution, aDelta)
));
RequestContentRepaint();
TimeDuration timePaintDelta = TimeStamp::Now() - mPreviousPaintStartTime;
if (timePaintDelta.ToMilliseconds() > FLING_REPAINT_INTERVAL) {
RequestContentRepaint();
}
return true;
}