зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1245285 - part 2, Prevent Zoom and Overscroll animations from repainting durring animation r=botond
This commit is contained in:
Родитель
d63c83b829
Коммит
0ab3435006
|
@ -49,11 +49,14 @@ public:
|
||||||
return Move(mDeferredTasks);
|
return Move(mDeferredTasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
|
||||||
virtual WheelScrollAnimation* AsWheelScrollAnimation() {
|
virtual WheelScrollAnimation* AsWheelScrollAnimation() {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool WantsRepaints() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Protected destructor, to discourage deletion outside of Release():
|
// Protected destructor, to discourage deletion outside of Release():
|
||||||
virtual ~AsyncPanZoomAnimation()
|
virtual ~AsyncPanZoomAnimation()
|
||||||
|
|
|
@ -647,6 +647,11 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool WantsRepaints() override
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TimeDuration mDuration;
|
TimeDuration mDuration;
|
||||||
const TimeDuration mTotalDuration;
|
const TimeDuration mTotalDuration;
|
||||||
|
@ -698,6 +703,12 @@ public:
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool WantsRepaints() override
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AsyncPanZoomController& mApzc;
|
AsyncPanZoomController& mApzc;
|
||||||
};
|
};
|
||||||
|
@ -2940,12 +2951,15 @@ bool AsyncPanZoomController::UpdateAnimation(const TimeStamp& aSampleTime,
|
||||||
|
|
||||||
if (mAnimation) {
|
if (mAnimation) {
|
||||||
bool continueAnimation = mAnimation->Sample(mFrameMetrics, sampleTimeDelta);
|
bool continueAnimation = mAnimation->Sample(mFrameMetrics, sampleTimeDelta);
|
||||||
|
bool wantsRepaints = mAnimation->WantsRepaints();
|
||||||
*aOutDeferredTasks = mAnimation->TakeDeferredTasks();
|
*aOutDeferredTasks = mAnimation->TakeDeferredTasks();
|
||||||
if (!continueAnimation) {
|
if (!continueAnimation) {
|
||||||
mAnimation = nullptr;
|
mAnimation = nullptr;
|
||||||
SetState(NOTHING);
|
SetState(NOTHING);
|
||||||
}
|
}
|
||||||
RequestContentRepaint();
|
if (wantsRepaints) {
|
||||||
|
RequestContentRepaint();
|
||||||
|
}
|
||||||
UpdateSharedCompositorFrameMetrics();
|
UpdateSharedCompositorFrameMetrics();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче