зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ab970e182f57 (bug 907123) for assertions from AsyncPanZoomControllerTester
This commit is contained in:
Родитель
0db6682830
Коммит
fd0c43adba
|
@ -728,7 +728,7 @@ APZCTreeManager::HandOffFling(AsyncPanZoomController* aPrev, ScreenPoint aVeloci
|
|||
// otherwise built on touch-start and cleared on touch-end, and a fling
|
||||
// happens after touch-end. Note that, unlike DispatchScroll() which is
|
||||
// called on every touch-move during overscroll panning,
|
||||
// HandOffFling() is only called once during a fling handoff,
|
||||
// HandleFlingOverscroll() is only called once during a fling handoff,
|
||||
// so it's not worth trying to avoid building the handoff chain here.
|
||||
BuildOverscrollHandoffChain(aPrev);
|
||||
|
||||
|
|
|
@ -1294,20 +1294,20 @@ bool FlingAnimation::Sample(FrameMetrics& aFrameMetrics,
|
|||
velocity.y = 0;
|
||||
}
|
||||
|
||||
// To hand off the fling, we call APZCTreeManager::HandOffFling()
|
||||
// To hand off the fling, we call APZCTreeManager::HandleFlingOverscroll()
|
||||
// which starts a new fling in the next APZC in the handoff chain with
|
||||
// the same velocity. For simplicity, the actual overscroll of the current
|
||||
// sample is discarded rather than being handed off. The compositor should
|
||||
// sample animations sufficiently frequently that this is not noticeable.
|
||||
|
||||
// Make a local copy of the tree manager pointer and check if it's not
|
||||
// null before calling HandOffFling(). This is necessary because
|
||||
// null before calling HandleFlingOverscroll(). This is necessary because
|
||||
// Destroy(), which nulls out mTreeManager, could be called concurrently.
|
||||
APZCTreeManager* treeManagerLocal = mApzc.mTreeManager;
|
||||
if (treeManagerLocal) {
|
||||
// APZC is holding mMonitor, so directly calling HandOffFling()
|
||||
// APZC is holding mMonitor, so directly calling HandleFlingOverscroll()
|
||||
// (which acquires the tree lock) would violate the lock ordering. Instead
|
||||
// we schedule HandOffFling() to be called after mMonitor is
|
||||
// we schedule HandleFlingOverscroll() to be called after mMonitor is
|
||||
// released.
|
||||
mDeferredTasks.append(NewRunnableMethod(treeManagerLocal,
|
||||
&APZCTreeManager::HandOffFling,
|
||||
|
|
|
@ -294,6 +294,12 @@ public:
|
|||
*/
|
||||
void CancelAnimation();
|
||||
|
||||
/**
|
||||
* Take over a fling with the given velocity from another APZC. Used for
|
||||
* during overscroll handoff for a fling.
|
||||
*/
|
||||
void TakeOverFling(ScreenPoint aVelocity);
|
||||
|
||||
/**
|
||||
* Returns allowed touch behavior for the given point on the scrollable layer.
|
||||
* Internally performs a kind of hit testing based on the regions constructed
|
||||
|
@ -495,6 +501,14 @@ protected:
|
|||
*/
|
||||
void DispatchRepaintRequest(const FrameMetrics& aFrameMetrics);
|
||||
|
||||
/**
|
||||
* Advances a fling by an interpolated amount based on the passed in |aDelta|.
|
||||
* This should be called whenever sampling the content transform for this
|
||||
* frame. Returns true if the fling animation should be advanced by one frame,
|
||||
* or false if there is no fling or the fling has ended.
|
||||
*/
|
||||
bool DoFling(const TimeDuration& aDelta);
|
||||
|
||||
/**
|
||||
* Gets the current frame metrics. This is *not* the Gecko copy stored in the
|
||||
* layers code.
|
||||
|
@ -763,20 +777,6 @@ private:
|
|||
RefPtr<AsyncPanZoomAnimation> mAnimation;
|
||||
|
||||
friend class Axis;
|
||||
|
||||
|
||||
/* ===================================================================
|
||||
* The functions and members in this section are used to manage
|
||||
* fling animations.
|
||||
*/
|
||||
public:
|
||||
/**
|
||||
* Take over a fling with the given velocity from another APZC. Used for
|
||||
* during overscroll handoff for a fling.
|
||||
*/
|
||||
void TakeOverFling(ScreenPoint aVelocity);
|
||||
|
||||
private:
|
||||
friend class FlingAnimation;
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче