Bug 907123 - Move fling-related things into a new section in AsyncPanZoomController.h. r=botond

This commit is contained in:
Kartikaya Gupta 2014-04-28 10:19:13 -04:00
parent d8c1730c9a
commit 94728595ed
3 changed files with 19 additions and 19 deletions

View File

@ -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,
// HandleFlingOverscroll() is only called once during a fling handoff,
// HandOffFling() is only called once during a fling handoff,
// so it's not worth trying to avoid building the handoff chain here.
BuildOverscrollHandoffChain(aPrev);

View File

@ -1294,20 +1294,20 @@ bool FlingAnimation::Sample(FrameMetrics& aFrameMetrics,
velocity.y = 0;
}
// To hand off the fling, we call APZCTreeManager::HandleFlingOverscroll()
// To hand off the fling, we call APZCTreeManager::HandOffFling()
// 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 HandleFlingOverscroll(). This is necessary because
// null before calling HandOffFling(). 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 HandleFlingOverscroll()
// APZC is holding mMonitor, so directly calling HandOffFling()
// (which acquires the tree lock) would violate the lock ordering. Instead
// we schedule HandleFlingOverscroll() to be called after mMonitor is
// we schedule HandOffFling() to be called after mMonitor is
// released.
mDeferredTasks.append(NewRunnableMethod(treeManagerLocal,
&APZCTreeManager::HandOffFling,

View File

@ -294,12 +294,6 @@ 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
@ -501,14 +495,6 @@ 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.
@ -777,6 +763,20 @@ 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;