Name Description Size
APZCTreeManager.cpp 165076
APZCTreeManager.h NOTE ON LOCK ORDERING IN APZ ************************** To avoid deadlock, APZ imposes and respects a global ordering on threads and locks relevant to APZ. Please see the "Threading / Locking Overview" section of gfx/docs/AsyncPanZoom.rst (hosted in rendered form at for what the ordering is, and what are the rules for respecting it. ************************************************************************** 46370
APZInputBridge.cpp static 8382
APZSampler.cpp static 8988
APZUpdater.cpp static 21307
APZUtils.cpp static 2556
APZUtils.h Cancel all animations 6562
AndroidAPZ.cpp static 12291
AndroidAPZ.h ignored 2403
AndroidFlingPhysics.cpp 7790
AndroidFlingPhysics.h 1633
AndroidVelocityTracker.cpp 9645
AndroidVelocityTracker.h 1393
AsyncDragMetrics.h 1591
AsyncPanZoomAnimation.h Attempt to handle a main-thread scroll offset update without cancelling the animation. This may or may not make sense depending on the type of the animation and whether the scroll update is relative or absolute. If the scroll update is relative, |aRelativeDelta| will contain the delta of the relative update. If the scroll update is absolute, |aRelativeDelta| will be Nothing() (the animation can check the APZC's FrameMetrics for the new absolute scroll offset if it wants to handle and absolute update). Returns whether the animation could handle the scroll update. If the return value is false, the animation will be cancelled. 3293
AsyncPanZoomController.cpp 215909
AsyncPanZoomController.h Represents a transform from the ParentLayer coordinate space of an APZC to the ParentLayer coordinate space of its parent APZC. Each layer along the way contributes to the transform. We track contributions that are perspective transforms separately, as sometimes these require special handling. 65851
AutoDirWheelDeltaAdjuster.h About AutoDirWheelDeltaAdjuster: For an AutoDir wheel scroll, there's some situations where we should adjust a wheel event's delta values. AutoDirWheelDeltaAdjuster converts delta values for AutoDir scrolling. An AutoDir wheel scroll lets the user scroll a frame with only one scrollbar, using either a vertical or a horzizontal wheel. For more detail about the concept of AutoDir scrolling, see the comments in AutoDirWheelDeltaAdjuster. This is the APZ implementation of AutoDirWheelDeltaAdjuster. 3863
AutoscrollAnimation.cpp 3445
AutoscrollAnimation.h 1300
Axis.cpp ParentLayerCoord 16990
Axis.h Compare two coordinates for equality, accounting for rounding error. Use both FuzzyEqualsAdditive() with COORDINATE_EPISLON, which accounts for things like the error introduced by rounding during a round-trip to app units, and FuzzyEqualsMultiplicative(), which accounts for accumulated error due to floating-point operations (which can be larger than COORDINATE_EPISLON for sufficiently large coordinate values). 13212
CheckerboardEvent.cpp 6593
CheckerboardEvent.h This class records information relevant to one "checkerboard event", which is a contiguous set of frames where a given APZC was checkerboarding. The intent of this class is to record enough information that it can provide actionable steps to reduce the occurrence of checkerboarding. Furthermore, it records information about the severity of the checkerboarding so as to allow prioritizing the debugging of some checkerboarding events over others. 6534
DesktopFlingPhysics.h unused 2353
DragTracker.cpp static 1932
DragTracker.h mozilla_layers_DragTracker_h 1101
FocusState.cpp 8435
FocusState.h This class is used for tracking chrome and content focus targets and calculating global focus information from them for use by APZCTreeManager for async keyboard scrolling. # Calculating the element to scroll Chrome and content processes have independently focused elements. This makes it difficult to calculate the global focused element and its scrollable frame from the chrome or content side. So instead we send the local focus information from each process to here and then calculate the global focus information. This local information resides in a `focus target`. A focus target indicates that either: 1. The focused element is a remote browser along with its layer tree ID 2. The focused element is not scrollable 3. The focused element is scrollable along with the ViewID's of its scrollable layers Using this information we can determine the global focus information by starting at the focus target of the root layer tree ID and following remote browsers until we reach a scrollable or non-scrollable focus target. # Determinism and sequence numbers The focused element in content can be changed within any javascript code. And javascript can run in response to an event or at any moment from `setTimeout` and others. This makes it impossible to always have the current focus information in APZ as it can be changed asynchronously at any moment. If we don't have the latest focus information, we may incorrectly scroll a target when we shouldn't. A tradeoff is designed here whereby we will maintain deterministic focus changes for user input, but not for other javascript code. The reasoning here is that `setTimeout` and others are already non-deterministic and so it might not be as breaking to web content. To maintain deterministic focus changes for a given stream of user inputs, we invalidate our focus state whenever we receive a user input that may trigger event listeners. We then attach a new sequence number to these events and dispatch them to content. Content will then include the latest sequence number it has processed to every focus update. Using this we can determine whether any potentially focus changing events have yet to be handled by content. Once we have received the latest focus sequence number from content, we know that all event listeners triggered by user inputs, and their resulting focus changes, have been processed and so we have a current target that we can use again. 7345
FocusTarget.cpp 7906
FocusTarget.h This class is used for communicating information about the currently focused element of a document and the scrollable frames to use when keyboard scrolling it. It is created on the main thread at paint-time, but is then passed over IPC to the compositor/APZ code. 2255
GenericFlingAnimation.h The FlingPhysics template parameter determines the physics model that the fling animation follows. It must have the following methods: - Default constructor. - Init(const ParentLayerPoint& aStartingVelocity, float aPLPPI). Called at the beginning of the fling, with the fling's starting velocity, and the number of ParentLayer pixels per (Screen) inch at the point of the fling's start in the fling's direction. - Sample(const TimeDuration& aDelta, ParentLayerPoint* aOutVelocity, ParentLayerPoint* aOutOffset); Called on each sample of the fling. |aDelta| is the time elapsed since the last sample. |aOutVelocity| should be the desired velocity after the current sample, in ParentLayer pixels per millisecond. |aOutOffset| should be the desired _delta_ to the scroll offset after the current sample. |aOutOffset| should _not_ be clamped to the APZC's scrollable bounds; the caller will do the clamping, and it needs to know the unclamped value to handle handoff/overscroll correctly. 10626
GenericScrollAnimation.cpp 4486
GenericScrollAnimation.h 2084
GestureEventListener.cpp Amount of span or focus change needed to take us from the GESTURE_WAITING_PINCH state to the GESTURE_PINCH state. This is measured as either a change in distance between the fingers used to compute the span ratio, or the a change in position of the focus point between the two fingers. 21941
GestureEventListener.h Platform-non-specific, generalized gesture event listener. This class intercepts all touches events on their way to AsyncPanZoomController and determines whether or not they are part of a gesture. For example, seeing that two fingers are on the screen means that the user wants to do a pinch gesture, so we don't forward the touches along to AsyncPanZoomController since it will think that they are just trying to pan the screen. Instead, we generate a PinchGestureInput and send that. If the touch event is not part of a gesture, we just return nsEventStatus_eIgnore and AsyncPanZoomController is expected to handle it. 10740
HitTestingTreeNode.cpp 17259
HitTestingTreeNode.h This class represents a node in a tree that is used by the APZCTreeManager to do hit testing. The tree is roughly a copy of the layer tree, but will contain multiple nodes in cases where the layer has multiple FrameMetrics. In other words, the structure of this tree should be identical to the LayerMetrics tree (see documentation in LayerMetricsWrapper.h). Not all HitTestingTreeNode instances will have an APZC associated with them; only HitTestingTreeNodes that correspond to layers with scrollable metrics have APZCs. Multiple HitTestingTreeNode instances may share the same underlying APZC instance if the layers they represent share the same scrollable metrics (i.e. are part of the same animated geometry root). If this happens, exactly one of the HitTestingTreeNode instances will be designated as the "primary holder" of the APZC. When this primary holder is destroyed, it will destroy the APZC along with it; in contrast, destroying non-primary-holder nodes will not destroy the APZC. Code should not make assumptions about which of the nodes will be the primary holder, only that that there will be exactly one for each APZC in the tree. The reason this tree exists at all is so that we can do hit-testing on the thread that we receive input on (referred to the as the controller thread in APZ terminology), which may be different from the compositor thread. Accessing the compositor layer tree can only be done on the compositor thread, and so it is simpler to make a copy of the hit-testing related properties into a separate tree. The tree pointers on the node (mLastChild, etc.) can only be manipulated while holding the APZ tree lock. Any code that wishes to use a HitTestingTreeNode outside of holding the tree lock should do so by using the HitTestingTreeNodeAutoLock wrapper, which prevents the node from being recycled (and also holds a RefPtr to the node to prevent it from getting freed). 13167
InputBlockState.cpp 29226
InputBlockState.h A base class that stores state common to various input blocks. Note that the InputBlockState constructor acquires the tree lock, so callers from inside AsyncPanZoomController should ensure that the APZC lock is not held. 18683
InputQueue.cpp 34201
InputQueue.h This class stores incoming input events, associated with "input blocks", until they are ready for handling. 10422
KeyboardMap.cpp static 5569
KeyboardMap.h This class is an off main-thread <xul:handler> for scrolling commands. 3874
KeyboardScrollAction.cpp static 1293
KeyboardScrollAction.h This class represents a scrolling action to be performed on a scrollable layer. 1396
KeyboardScrollAnimation.cpp 2225
KeyboardScrollAnimation.h 1033
Overscroll.h 4966
OverscrollHandoffState.cpp 4714
OverscrollHandoffState.h This class represents the chain of APZCs along which overscroll is handed off. It is created by APZCTreeManager by starting from an initial APZC which is the target for input events, and following the scroll parent ID links (often but not always corresponding to parent pointers in the APZC tree), then adjusting for scrollgrab. 6069
PotentialCheckerboardDurationTracker.cpp 2185
PotentialCheckerboardDurationTracker.h This class allows the owner to track the duration of time considered "potentially checkerboarding". This is the union of two possibly-intersecting sets of time periods. The first set is that in which checkerboarding was actually happening, since by definition it could potentially be happening. The second set is that in which the APZC is actively transforming content in the compositor, since it could potentially transform it so as to display checkerboarding to the user. The caller of this class calls the appropriate methods to indicate the start and stop of these two sets, and this class manages accumulating the union of the various durations. 2056
QueuedInput.cpp 1705
QueuedInput.h This lightweight class holds a pointer to an input event that has not yet been completely processed, along with the input block that the input event is associated with. 1909
RecentEventsBuffer.h RecentEventsBuffer: maintains an age constrained buffer of events Intended for use with elements of type InputData, but the only requirement is a member "mTimeStamp" of type TimeStamp 2573
SampledAPZCState.cpp 2274
SampledAPZCState.h Re-clamp mScrollOffset to the scroll range specified by the provided metrics. This only needs to be called if the scroll offset changes outside of AsyncPanZoomController::SampleCompositedAsyncTransform(). It also recalculates mLayoutViewport so that it continues to enclose the visual viewport. This only needs to be called if the layout viewport changes outside of SampleCompositedAsyncTransform(). 2198
SimpleVelocityTracker.cpp 5254
SimpleVelocityTracker.h 1995
WheelScrollAnimation.cpp 2347
WheelScrollAnimation.h 981