Bug 1457586 - Initialize AsyncPanZoomController::mPlatformSpecificState before the axes. r=kats
This allows the Axis constructors to use the platform-specific state.
MozReview-Commit-ID: KWtDX4XVpjF
--- a/gfx/layers/apz/src/AsyncPanZoomController.h
+++ b/gfx/layers/apz/src/AsyncPanZoomController.h
@@ -941,16 +941,20 @@ private:
// These variables cache the layout viewport, scroll offset, and zoom stored
// in |Metrics()| the last time SampleCompositedAsyncTransform() was
// called.
CSSRect mCompositedLayoutViewport;
CSSPoint mCompositedScrollOffset;
CSSToParentLayerScale2D mCompositedZoom;
+ // Groups state variables that are specific to a platform.
+ // Initialized on first use.
+ UniquePtr<PlatformSpecificStateBase> mPlatformSpecificState;
+
AxisX mX;
AxisY mY;
// This flag is set to true when we are in a axis-locked pan as a result of
// the touch-action CSS property.
bool mPanDirRestricted;
// This flag is set to true when we are in a pinch-locked state. ie: user
@@ -972,20 +976,16 @@ private:
// Stores the previous focus point if there is a pinch gesture happening. Used
// to allow panning by moving multiple fingers (thus moving the focus point).
ParentLayerPoint mLastZoomFocus;
RefPtr<AsyncPanZoomAnimation> mAnimation;
UniquePtr<OverscrollEffectBase> mOverscrollEffect;
- // Groups state variables that are specific to a platform.
- // Initialized on first use.
- UniquePtr<PlatformSpecificStateBase> mPlatformSpecificState;
-
friend class Axis;
public:
/**
* Invoke |callable|, passing |mLastContentPaintMetrics| as argument,
* while holding the APZC lock required to access |mLastContentPaintMetrics|.
* This allows code outside of an AsyncPanZoomController method implementation
* to access |mLastContentPaintMetrics| without having to make a copy of it.