Bug 1245285 - part 2, Prevent Zoom and Overscroll animations from repainting durring animation r=botond

This commit is contained in:
Randall Barker 2016-02-03 12:30:55 -08:00
Родитель 54fa69b98b
Коммит a9a2103f92
2 изменённых файлов: 19 добавлений и 2 удалений

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

@ -49,11 +49,14 @@ public:
return Move(mDeferredTasks);
}
public:
virtual WheelScrollAnimation* AsWheelScrollAnimation() {
return nullptr;
}
virtual bool WantsRepaints() {
return true;
}
protected:
// Protected destructor, to discourage deletion outside of Release():
virtual ~AsyncPanZoomAnimation()

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

@ -647,6 +647,11 @@ public:
return true;
}
virtual bool WantsRepaints() override
{
return false;
}
private:
TimeDuration mDuration;
const TimeDuration mTotalDuration;
@ -698,6 +703,12 @@ public:
}
return true;
}
virtual bool WantsRepaints() override
{
return false;
}
private:
AsyncPanZoomController& mApzc;
};
@ -2940,12 +2951,15 @@ bool AsyncPanZoomController::UpdateAnimation(const TimeStamp& aSampleTime,
if (mAnimation) {
bool continueAnimation = mAnimation->Sample(mFrameMetrics, sampleTimeDelta);
bool wantsRepaints = mAnimation->WantsRepaints();
*aOutDeferredTasks = mAnimation->TakeDeferredTasks();
if (!continueAnimation) {
mAnimation = nullptr;
SetState(NOTHING);
}
RequestContentRepaint();
if (wantsRepaints) {
RequestContentRepaint();
}
UpdateSharedCompositorFrameMetrics();
return true;
}