Bug 1069417 - Modify TransformTo() and related functions to use typed matrices. r=kats

Call sites (all in APZ and related code) were modified accordingly. Some of
these modifications involved changing some matrices stored in APZ to be typed.
This commit is contained in:
Botond Ballo
2015-11-30 20:14:31 -05:00
parent 8b49405714
commit 85af71a0e4
17 changed files with 175 additions and 152 deletions

View File

@@ -751,8 +751,8 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
// cursor is stationary during wheel scrolling, unlike touchmove
// events). Since we just flushed the pending repaints the transform to
// gecko space should only consist of overscroll-cancelling transforms.
Matrix4x4 transformToGecko = GetScreenToApzcTransform(apzc)
* GetApzcToGeckoTransform(apzc);
ScreenToScreenMatrix4x4 transformToGecko = GetScreenToApzcTransform(apzc)
* GetApzcToGeckoTransform(apzc);
Maybe<ScreenPoint> untransformedOrigin = UntransformTo<ScreenPixel>(
transformToGecko, wheelInput.mOrigin);
@@ -791,8 +791,8 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
// cursor is stationary during pan gesture scrolling, unlike touchmove
// events). Since we just flushed the pending repaints the transform to
// gecko space should only consist of overscroll-cancelling transforms.
Matrix4x4 transformToGecko = GetScreenToApzcTransform(apzc)
* GetApzcToGeckoTransform(apzc);
ScreenToScreenMatrix4x4 transformToGecko = GetScreenToApzcTransform(apzc)
* GetApzcToGeckoTransform(apzc);
Maybe<ScreenPoint> untransformedStartPoint = UntransformTo<ScreenPixel>(
transformToGecko, panInput.mPanStartPoint);
Maybe<ScreenPoint> untransformedDisplacement = UntransformVector<ScreenPixel>(
@@ -820,8 +820,8 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
if (apzc) {
MOZ_ASSERT(hitResult == HitLayer || hitResult == HitDispatchToContentRegion);
Matrix4x4 outTransform = GetScreenToApzcTransform(apzc)
* GetApzcToGeckoTransform(apzc);
ScreenToScreenMatrix4x4 outTransform = GetScreenToApzcTransform(apzc)
* GetApzcToGeckoTransform(apzc);
Maybe<ScreenPoint> untransformedFocusPoint = UntransformTo<ScreenPixel>(
outTransform, pinchInput.mFocusPoint);
@@ -846,8 +846,8 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
if (apzc) {
MOZ_ASSERT(hitResult == HitLayer || hitResult == HitDispatchToContentRegion);
Matrix4x4 outTransform = GetScreenToApzcTransform(apzc)
* GetApzcToGeckoTransform(apzc);
ScreenToScreenMatrix4x4 outTransform = GetScreenToApzcTransform(apzc)
* GetApzcToGeckoTransform(apzc);
Maybe<ScreenIntPoint> untransformedPoint =
UntransformTo<ScreenPixel>(outTransform, tapInput.mPoint);
@@ -951,9 +951,9 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
// For computing the event to pass back to Gecko, use up-to-date transforms
// (i.e. not anything cached in an input block).
// This ensures that transformToApzc and transformToGecko are in sync.
Matrix4x4 transformToApzc = GetScreenToApzcTransform(mApzcForInputBlock);
Matrix4x4 transformToGecko = GetApzcToGeckoTransform(mApzcForInputBlock);
Matrix4x4 outTransform = transformToApzc * transformToGecko;
ScreenToParentLayerMatrix4x4 transformToApzc = GetScreenToApzcTransform(mApzcForInputBlock);
ParentLayerToScreenMatrix4x4 transformToGecko = GetApzcToGeckoTransform(mApzcForInputBlock);
ScreenToScreenMatrix4x4 outTransform = transformToApzc * transformToGecko;
for (size_t i = 0; i < aInput.mTouches.Length(); i++) {
SingleTouchData& touchData = aInput.mTouches[i];
@@ -1036,18 +1036,19 @@ APZCTreeManager::ProcessEvent(WidgetInputEvent& aEvent,
// Transform the refPoint.
// If the event hits an overscrolled APZC, instruct the caller to ignore it.
HitTestResult hitResult = HitNothing;
RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(ScreenPoint(aEvent.refPoint.x, aEvent.refPoint.y),
&hitResult);
PixelCastJustification LDIsScreen = PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent;
ScreenIntPoint refPointAsScreen = ViewAs<ScreenPixel>(aEvent.refPoint, LDIsScreen);
RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(refPointAsScreen, &hitResult);
if (apzc) {
MOZ_ASSERT(hitResult == HitLayer || hitResult == HitDispatchToContentRegion);
apzc->GetGuid(aOutTargetGuid);
Matrix4x4 transformToApzc = GetScreenToApzcTransform(apzc);
Matrix4x4 transformToGecko = GetApzcToGeckoTransform(apzc);
Matrix4x4 outTransform = transformToApzc * transformToGecko;
Maybe<LayoutDeviceIntPoint> untransformedRefPoint =
UntransformTo<LayoutDevicePixel>(outTransform, aEvent.refPoint);
ScreenToParentLayerMatrix4x4 transformToApzc = GetScreenToApzcTransform(apzc);
ParentLayerToScreenMatrix4x4 transformToGecko = GetApzcToGeckoTransform(apzc);
ScreenToScreenMatrix4x4 outTransform = transformToApzc * transformToGecko;
Maybe<ScreenIntPoint> untransformedRefPoint =
UntransformTo<ScreenPixel>(outTransform, refPointAsScreen);
if (untransformedRefPoint) {
aEvent.refPoint = *untransformedRefPoint;
aEvent.refPoint = ViewAs<LayoutDevicePixel>(*untransformedRefPoint, LDIsScreen);
}
}
return result;
@@ -1352,13 +1353,13 @@ TransformDisplacement(APZCTreeManager* aTreeManager,
}
// Convert start and end points to Screen coordinates.
Matrix4x4 untransformToApzc = aTreeManager->GetScreenToApzcTransform(aSource).Inverse();
ParentLayerToScreenMatrix4x4 untransformToApzc = aTreeManager->GetScreenToApzcTransform(aSource).Inverse();
ScreenPoint screenStart = TransformTo<ScreenPixel>(untransformToApzc, aStartPoint);
ScreenPoint screenEnd = TransformTo<ScreenPixel>(untransformToApzc, aEndPoint);
// Convert start and end points to aTarget's ParentLayer coordinates.
Matrix4x4 transformToApzc = aTreeManager->GetScreenToApzcTransform(aTarget);
ScreenToParentLayerMatrix4x4 transformToApzc = aTreeManager->GetScreenToApzcTransform(aTarget);
Maybe<ParentLayerPoint> startPoint = UntransformTo<ParentLayerPixel>(transformToApzc, screenStart);
Maybe<ParentLayerPoint> endPoint = UntransformTo<ParentLayerPixel>(transformToApzc, screenEnd);
if (!startPoint || !endPoint) {
@@ -1849,7 +1850,7 @@ APZCTreeManager::FindRootContentApzcForLayersId(uint64_t aLayersId) const
/*
* See the long comment above for a detailed explanation of this function.
*/
Matrix4x4
ScreenToParentLayerMatrix4x4
APZCTreeManager::GetScreenToApzcTransform(const AsyncPanZoomController *aApzc) const
{
Matrix4x4 result;
@@ -1883,14 +1884,14 @@ APZCTreeManager::GetScreenToApzcTransform(const AsyncPanZoomController *aApzc) c
// terms are guaranteed to be identity transforms.
}
return result;
return ViewAs<ScreenToParentLayerMatrix4x4>(result);
}
/*
* See the long comment above GetScreenToApzcTransform() for a detailed
* explanation of this function.
*/
Matrix4x4
ParentLayerToScreenMatrix4x4
APZCTreeManager::GetApzcToGeckoTransform(const AsyncPanZoomController *aApzc) const
{
Matrix4x4 result;
@@ -1917,7 +1918,7 @@ APZCTreeManager::GetApzcToGeckoTransform(const AsyncPanZoomController *aApzc) co
// terms are guaranteed to be identity transforms.
}
return result;
return ViewAs<ParentLayerToScreenMatrix4x4>(result);
}
already_AddRefed<AsyncPanZoomController>

View File

@@ -434,8 +434,8 @@ public:
RefPtr<HitTestingTreeNode> GetRootNode() const;
already_AddRefed<AsyncPanZoomController> GetTargetAPZC(const ScreenPoint& aPoint,
HitTestResult* aOutHitResult);
gfx::Matrix4x4 GetScreenToApzcTransform(const AsyncPanZoomController *aApzc) const;
gfx::Matrix4x4 GetApzcToGeckoTransform(const AsyncPanZoomController *aApzc) const;
ScreenToParentLayerMatrix4x4 GetScreenToApzcTransform(const AsyncPanZoomController *aApzc) const;
ParentLayerToScreenMatrix4x4 GetApzcToGeckoTransform(const AsyncPanZoomController *aApzc) const;
private:
typedef bool (*GuidComparator)(const ScrollableLayerGuid&, const ScrollableLayerGuid&);

View File

@@ -1067,7 +1067,7 @@ nsEventStatus AsyncPanZoomController::HandleDragEvent(const MouseInput& aEvent,
}
nsEventStatus AsyncPanZoomController::HandleInputEvent(const InputData& aEvent,
const Matrix4x4& aTransformToApzc) {
const ScreenToParentLayerMatrix4x4& aTransformToApzc) {
APZThreadUtils::AssertOnControllerThread();
nsEventStatus rv = nsEventStatus_eIgnore;
@@ -1550,12 +1550,11 @@ bool
AsyncPanZoomController::ConvertToGecko(const ScreenIntPoint& aPoint, CSSPoint* aOut)
{
if (APZCTreeManager* treeManagerLocal = GetApzcTreeManager()) {
Matrix4x4 transformScreenToGecko = treeManagerLocal->GetScreenToApzcTransform(this)
* treeManagerLocal->GetApzcToGeckoTransform(this);
ScreenToScreenMatrix4x4 transformScreenToGecko =
treeManagerLocal->GetScreenToApzcTransform(this)
* treeManagerLocal->GetApzcToGeckoTransform(this);
// NOTE: This isn't *quite* LayoutDevicePoint, we just don't have a name
// for this coordinate space and it maps the closest to LayoutDevicePoint.
Maybe<LayoutDeviceIntPoint> layoutPoint = UntransformTo<LayoutDevicePixel>(
Maybe<ScreenIntPoint> layoutPoint = UntransformTo<ScreenPixel>(
transformScreenToGecko, aPoint);
if (!layoutPoint) {
return false;
@@ -1563,7 +1562,11 @@ AsyncPanZoomController::ConvertToGecko(const ScreenIntPoint& aPoint, CSSPoint* a
{ // scoped lock to access mFrameMetrics
ReentrantMonitorAutoEnter lock(mMonitor);
*aOut = LayoutDevicePoint(*layoutPoint) / mFrameMetrics.GetDevPixelsPerCSSPixel();
// NOTE: This isn't *quite* LayoutDevicePoint, we just don't have a name
// for this coordinate space and it maps the closest to LayoutDevicePoint.
*aOut = LayoutDevicePoint(ViewAs<LayoutDevicePixel>(*layoutPoint,
PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent))
/ mFrameMetrics.GetDevPixelsPerCSSPixel();
}
return true;
}
@@ -2047,11 +2050,11 @@ nsEventStatus AsyncPanZoomController::OnCancelTap(const TapGestureInput& aEvent)
}
Matrix4x4 AsyncPanZoomController::GetTransformToThis() const {
ScreenToParentLayerMatrix4x4 AsyncPanZoomController::GetTransformToThis() const {
if (APZCTreeManager* treeManagerLocal = GetApzcTreeManager()) {
return treeManagerLocal->GetScreenToApzcTransform(this);
}
return Matrix4x4();
return ScreenToParentLayerMatrix4x4();
}
ScreenPoint AsyncPanZoomController::ToScreenCoordinates(const ParentLayerPoint& aVector,
@@ -2067,7 +2070,7 @@ ParentLayerPoint AsyncPanZoomController::ToParentLayerCoordinates(const ScreenPo
bool AsyncPanZoomController::Contains(const ScreenIntPoint& aPoint) const
{
Matrix4x4 transformToThis = GetTransformToThis();
ScreenToParentLayerMatrix4x4 transformToThis = GetTransformToThis();
Maybe<ParentLayerIntPoint> point = UntransformTo<ParentLayerPixel>(transformToThis, aPoint);
if (!point) {
return false;

View File

@@ -279,7 +279,7 @@ public:
* Handler for events which should not be intercepted by the touch listener.
*/
nsEventStatus HandleInputEvent(const InputData& aEvent,
const Matrix4x4& aTransformToApzc);
const ScreenToParentLayerMatrix4x4& aTransformToApzc);
/**
* Handler for gesture events.
@@ -355,7 +355,7 @@ public:
* To respect the lock ordering, mMonitor must NOT be held when calling
* this function (since this function acquires the tree lock).
*/
Matrix4x4 GetTransformToThis() const;
ScreenToParentLayerMatrix4x4 GetTransformToThis() const;
/**
* Convert the vector |aVector|, rooted at the point |aAnchor|, from

View File

@@ -231,7 +231,8 @@ HitTestingTreeNode::Untransform(const ParentLayerPoint& aPoint) const
if (mApzc) {
localTransform = localTransform * mApzc->GetCurrentAsyncTransformWithOverscroll();
}
return UntransformTo<LayerPixel>(localTransform.Inverse(), aPoint);
return UntransformTo<LayerPixel>(
ViewAs<LayerToParentLayerMatrix4x4>(localTransform).Inverse(), aPoint);
}
HitTestResult

View File

@@ -59,7 +59,7 @@ InputBlockState::UpdateTargetApzc(const RefPtr<AsyncPanZoomController>& aTargetA
{
// note that aTargetApzc MAY be null here.
mTargetApzc = aTargetApzc;
mTransformToApzc = aTargetApzc ? aTargetApzc->GetTransformToThis() : gfx::Matrix4x4();
mTransformToApzc = aTargetApzc ? aTargetApzc->GetTransformToThis() : ScreenToParentLayerMatrix4x4();
mOverscrollHandoffChain = (mTargetApzc ? mTargetApzc->BuildOverscrollHandoffChain() : nullptr);
}

View File

@@ -61,7 +61,7 @@ protected:
// Used to transform events from global screen space to |mTargetApzc|'s
// screen space. It's cached at the beginning of the input block so that
// all events in the block are in the same coordinate space.
gfx::Matrix4x4 mTransformToApzc;
ScreenToParentLayerMatrix4x4 mTransformToApzc;
};
/**

View File

@@ -2183,8 +2183,8 @@ protected:
class APZHitTestingTester : public APZCTreeManagerTester {
protected:
Matrix4x4 transformToApzc;
Matrix4x4 transformToGecko;
ScreenToParentLayerMatrix4x4 transformToApzc;
ParentLayerToScreenMatrix4x4 transformToGecko;
already_AddRefed<AsyncPanZoomController> GetTargetAPZC(const ScreenPoint& aPoint) {
RefPtr<AsyncPanZoomController> hit = manager->GetTargetAPZC(aPoint, nullptr);
@@ -2277,8 +2277,8 @@ TEST_F(APZHitTestingTester, HitTesting1) {
RefPtr<AsyncPanZoomController> hit = GetTargetAPZC(ScreenPoint(20, 20));
TestAsyncPanZoomController* nullAPZC = nullptr;
EXPECT_EQ(nullAPZC, hit.get());
EXPECT_EQ(Matrix4x4(), transformToApzc);
EXPECT_EQ(Matrix4x4(), transformToGecko);
EXPECT_EQ(ScreenToParentLayerMatrix4x4(), transformToApzc);
EXPECT_EQ(ParentLayerToScreenMatrix4x4(), transformToGecko);
uint32_t paintSequenceNumber = 0;
@@ -2288,8 +2288,8 @@ TEST_F(APZHitTestingTester, HitTesting1) {
hit = GetTargetAPZC(ScreenPoint(15, 15));
EXPECT_EQ(ApzcOf(root), hit.get());
// expect hit point at LayerIntPoint(15, 15)
EXPECT_EQ(Point(15, 15), transformToApzc * Point(15, 15));
EXPECT_EQ(Point(15, 15), transformToGecko * Point(15, 15));
EXPECT_EQ(ParentLayerPoint(15, 15), transformToApzc * ScreenPoint(15, 15));
EXPECT_EQ(ScreenPoint(15, 15), transformToGecko * ParentLayerPoint(15, 15));
// Now we have a sub APZC with a better fit
SetScrollableFrameMetrics(layers[3], FrameMetrics::START_SCROLL_ID + 1);
@@ -2298,8 +2298,8 @@ TEST_F(APZHitTestingTester, HitTesting1) {
hit = GetTargetAPZC(ScreenPoint(25, 25));
EXPECT_EQ(ApzcOf(layers[3]), hit.get());
// expect hit point at LayerIntPoint(25, 25)
EXPECT_EQ(Point(25, 25), transformToApzc * Point(25, 25));
EXPECT_EQ(Point(25, 25), transformToGecko * Point(25, 25));
EXPECT_EQ(ParentLayerPoint(25, 25), transformToApzc * ScreenPoint(25, 25));
EXPECT_EQ(ScreenPoint(25, 25), transformToGecko * ParentLayerPoint(25, 25));
// At this point, layers[4] obscures layers[3] at the point (15, 15) so
// hitting there should hit the root APZC
@@ -2312,25 +2312,25 @@ TEST_F(APZHitTestingTester, HitTesting1) {
hit = GetTargetAPZC(ScreenPoint(15, 15));
EXPECT_EQ(ApzcOf(layers[4]), hit.get());
// expect hit point at LayerIntPoint(15, 15)
EXPECT_EQ(Point(15, 15), transformToApzc * Point(15, 15));
EXPECT_EQ(Point(15, 15), transformToGecko * Point(15, 15));
EXPECT_EQ(ParentLayerPoint(15, 15), transformToApzc * ScreenPoint(15, 15));
EXPECT_EQ(ScreenPoint(15, 15), transformToGecko * ParentLayerPoint(15, 15));
// Hit test ouside the reach of layer[3,4] but inside root
hit = GetTargetAPZC(ScreenPoint(90, 90));
EXPECT_EQ(ApzcOf(root), hit.get());
// expect hit point at LayerIntPoint(90, 90)
EXPECT_EQ(Point(90, 90), transformToApzc * Point(90, 90));
EXPECT_EQ(Point(90, 90), transformToGecko * Point(90, 90));
EXPECT_EQ(ParentLayerPoint(90, 90), transformToApzc * ScreenPoint(90, 90));
EXPECT_EQ(ScreenPoint(90, 90), transformToGecko * ParentLayerPoint(90, 90));
// Hit test ouside the reach of any layer
hit = GetTargetAPZC(ScreenPoint(1000, 10));
EXPECT_EQ(nullAPZC, hit.get());
EXPECT_EQ(Matrix4x4(), transformToApzc);
EXPECT_EQ(Matrix4x4(), transformToGecko);
EXPECT_EQ(ScreenToParentLayerMatrix4x4(), transformToApzc);
EXPECT_EQ(ParentLayerToScreenMatrix4x4(), transformToGecko);
hit = GetTargetAPZC(ScreenPoint(-1000, 10));
EXPECT_EQ(nullAPZC, hit.get());
EXPECT_EQ(Matrix4x4(), transformToApzc);
EXPECT_EQ(Matrix4x4(), transformToGecko);
EXPECT_EQ(ScreenToParentLayerMatrix4x4(), transformToApzc);
EXPECT_EQ(ParentLayerToScreenMatrix4x4(), transformToGecko);
}
// A more involved hit testing test that involves css and async transforms.
@@ -2353,8 +2353,8 @@ TEST_F(APZHitTestingTester, HitTesting2) {
// Hit an area that's clearly on the root layer but not any of the child layers.
RefPtr<AsyncPanZoomController> hit = GetTargetAPZC(ScreenPoint(75, 25));
EXPECT_EQ(apzcroot, hit.get());
EXPECT_EQ(Point(75, 25), transformToApzc * Point(75, 25));
EXPECT_EQ(Point(75, 25), transformToGecko * Point(75, 25));
EXPECT_EQ(ParentLayerPoint(75, 25), transformToApzc * ScreenPoint(75, 25));
EXPECT_EQ(ScreenPoint(75, 25), transformToGecko * ParentLayerPoint(75, 25));
// Hit an area on the root that would be on layers[3] if layers[2]
// weren't transformed.
@@ -2365,31 +2365,31 @@ TEST_F(APZHitTestingTester, HitTesting2) {
// start at x=10 but its content at x=20).
hit = GetTargetAPZC(ScreenPoint(15, 75));
EXPECT_EQ(apzcroot, hit.get());
EXPECT_EQ(Point(15, 75), transformToApzc * Point(15, 75));
EXPECT_EQ(Point(15, 75), transformToGecko * Point(15, 75));
EXPECT_EQ(ParentLayerPoint(15, 75), transformToApzc * ScreenPoint(15, 75));
EXPECT_EQ(ScreenPoint(15, 75), transformToGecko * ParentLayerPoint(15, 75));
// Hit an area on layers[1].
hit = GetTargetAPZC(ScreenPoint(25, 25));
EXPECT_EQ(apzc1, hit.get());
EXPECT_EQ(Point(25, 25), transformToApzc * Point(25, 25));
EXPECT_EQ(Point(25, 25), transformToGecko * Point(25, 25));
EXPECT_EQ(ParentLayerPoint(25, 25), transformToApzc * ScreenPoint(25, 25));
EXPECT_EQ(ScreenPoint(25, 25), transformToGecko * ParentLayerPoint(25, 25));
// Hit an area on layers[3].
hit = GetTargetAPZC(ScreenPoint(25, 75));
EXPECT_EQ(apzc3, hit.get());
// transformToApzc should unapply layers[2]'s transform
EXPECT_EQ(Point(12.5, 75), transformToApzc * Point(25, 75));
EXPECT_EQ(ParentLayerPoint(12.5, 75), transformToApzc * ScreenPoint(25, 75));
// and transformToGecko should reapply it
EXPECT_EQ(Point(25, 75), transformToGecko * Point(12.5, 75));
EXPECT_EQ(ScreenPoint(25, 75), transformToGecko * ParentLayerPoint(12.5, 75));
// Hit an area on layers[3] that would be on the root if layers[2]
// weren't transformed.
hit = GetTargetAPZC(ScreenPoint(75, 75));
EXPECT_EQ(apzc3, hit.get());
// transformToApzc should unapply layers[2]'s transform
EXPECT_EQ(Point(37.5, 75), transformToApzc * Point(75, 75));
EXPECT_EQ(ParentLayerPoint(37.5, 75), transformToApzc * ScreenPoint(75, 75));
// and transformToGecko should reapply it
EXPECT_EQ(Point(75, 75), transformToGecko * Point(37.5, 75));
EXPECT_EQ(ScreenPoint(75, 75), transformToGecko * ParentLayerPoint(37.5, 75));
// Pan the root layer upward by 50 pixels.
// This causes layers[1] to scroll out of view, and an async transform
@@ -2405,21 +2405,21 @@ TEST_F(APZHitTestingTester, HitTesting2) {
hit = GetTargetAPZC(ScreenPoint(75, 75));
EXPECT_EQ(apzcroot, hit.get());
// transformToApzc doesn't unapply the root's own async transform
EXPECT_EQ(Point(75, 75), transformToApzc * Point(75, 75));
EXPECT_EQ(ParentLayerPoint(75, 75), transformToApzc * ScreenPoint(75, 75));
// and transformToGecko unapplies it and then reapplies it, because by the
// time the event being transformed reaches Gecko the new paint request will
// have been handled.
EXPECT_EQ(Point(75, 75), transformToGecko * Point(75, 75));
EXPECT_EQ(ScreenPoint(75, 75), transformToGecko * ParentLayerPoint(75, 75));
// Hit where layers[1] used to be and where layers[3] should now be.
hit = GetTargetAPZC(ScreenPoint(25, 25));
EXPECT_EQ(apzc3, hit.get());
// transformToApzc unapplies both layers[2]'s css transform and the root's
// async transform
EXPECT_EQ(Point(12.5, 75), transformToApzc * Point(25, 25));
EXPECT_EQ(ParentLayerPoint(12.5, 75), transformToApzc * ScreenPoint(25, 25));
// transformToGecko reapplies both the css transform and the async transform
// because we have already issued a paint request with it.
EXPECT_EQ(Point(25, 25), transformToGecko * Point(12.5, 75));
EXPECT_EQ(ScreenPoint(25, 25), transformToGecko * ParentLayerPoint(12.5, 75));
// This second pan will move the APZC by another 50 pixels but since the paint
// request dispatched above has not "completed", we will not dispatch another
@@ -2431,19 +2431,19 @@ TEST_F(APZHitTestingTester, HitTesting2) {
hit = GetTargetAPZC(ScreenPoint(75, 75));
EXPECT_EQ(apzcroot, hit.get());
// transformToApzc doesn't unapply the root's own async transform
EXPECT_EQ(Point(75, 75), transformToApzc * Point(75, 75));
EXPECT_EQ(ParentLayerPoint(75, 75), transformToApzc * ScreenPoint(75, 75));
// transformToGecko unapplies the full async transform of -100 pixels, and then
// reapplies the "D" transform of -50 leading to an overall adjustment of +50
EXPECT_EQ(Point(75, 125), transformToGecko * Point(75, 75));
EXPECT_EQ(ScreenPoint(75, 125), transformToGecko * ParentLayerPoint(75, 75));
// Hit where layers[1] used to be. It should now hit the root.
hit = GetTargetAPZC(ScreenPoint(25, 25));
EXPECT_EQ(apzcroot, hit.get());
// transformToApzc doesn't unapply the root's own async transform
EXPECT_EQ(Point(25, 25), transformToApzc * Point(25, 25));
EXPECT_EQ(ParentLayerPoint(25, 25), transformToApzc * ScreenPoint(25, 25));
// transformToGecko unapplies the full async transform of -100 pixels, and then
// reapplies the "D" transform of -50 leading to an overall adjustment of +50
EXPECT_EQ(Point(25, 75), transformToGecko * Point(25, 25));
EXPECT_EQ(ScreenPoint(25, 75), transformToGecko * ParentLayerPoint(25, 25));
}
TEST_F(APZCTreeManagerTester, ScrollablePaintedLayers) {

View File

@@ -56,12 +56,14 @@ ClientTiledPaintedLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
}
static Maybe<LayerRect>
ApplyParentLayerToLayerTransform(const gfx::Matrix4x4& aTransform, const ParentLayerRect& aParentLayerRect, const LayerRect& aClip)
ApplyParentLayerToLayerTransform(const ParentLayerToLayerMatrix4x4& aTransform,
const ParentLayerRect& aParentLayerRect,
const LayerRect& aClip)
{
return UntransformTo<LayerPixel>(aTransform, aParentLayerRect, aClip);
}
static gfx::Matrix4x4
static LayerToParentLayerMatrix4x4
GetTransformToAncestorsParentLayer(Layer* aStart, const LayerMetricsWrapper& aAncestor)
{
gfx::Matrix4x4 transform;
@@ -86,7 +88,7 @@ GetTransformToAncestorsParentLayer(Layer* aStart, const LayerMetricsWrapper& aAn
transform.PostScale(metrics.GetPresShellResolution(), metrics.GetPresShellResolution(), 1.f);
}
}
return transform;
return ViewAs<LayerToParentLayerMatrix4x4>(transform);
}
void
@@ -158,9 +160,8 @@ ClientTiledPaintedLayer::BeginPaint()
// Calculate the transform required to convert ParentLayer space of our
// display port ancestor to the Layer space of this layer.
gfx::Matrix4x4 transformDisplayPortToLayer =
GetTransformToAncestorsParentLayer(this, displayPortAncestor);
transformDisplayPortToLayer.Invert();
ParentLayerToLayerMatrix4x4 transformDisplayPortToLayer =
GetTransformToAncestorsParentLayer(this, displayPortAncestor).Inverse();
LayerRect layerBounds = ViewAs<LayerPixel>(Rect(GetLayerBounds()));
@@ -192,8 +193,7 @@ ClientTiledPaintedLayer::BeginPaint()
// Store the applicable composition bounds in this layer's Layer units.
mPaintData.mTransformToCompBounds =
GetTransformToAncestorsParentLayer(this, scrollAncestor);
gfx::Matrix4x4 transformToBounds = mPaintData.mTransformToCompBounds;
transformToBounds.Invert();
ParentLayerToLayerMatrix4x4 transformToBounds = mPaintData.mTransformToCompBounds.Inverse();
Maybe<LayerRect> compositionBoundsTransformed = ApplyParentLayerToLayerTransform(
transformToBounds, scrollMetrics.GetCompositionBounds(), layerBounds);
if (!compositionBoundsTransformed) {

View File

@@ -1400,11 +1400,12 @@ ClientMultiTiledLayerBuffer::ValidateTile(TileClient& aTile,
*/
static Maybe<LayerRect>
GetCompositorSideCompositionBounds(const LayerMetricsWrapper& aScrollAncestor,
const Matrix4x4& aTransformToCompBounds,
const LayerToParentLayerMatrix4x4& aTransformToCompBounds,
const ViewTransform& aAPZTransform,
const LayerRect& aClip)
{
Matrix4x4 transform = aTransformToCompBounds * Matrix4x4(aAPZTransform);
LayerToParentLayerMatrix4x4 transform = aTransformToCompBounds *
ViewAs<ParentLayerToParentLayerMatrix4x4>(aAPZTransform);
return UntransformTo<LayerPixel>(transform.Inverse(),
aScrollAncestor.Metrics().GetCompositionBounds(), aClip);

View File

@@ -313,7 +313,7 @@ struct BasicTiledLayerPaintData {
* the closest ancestor layer which scrolls, and is used to obtain
* the composition bounds that are relevant for this layer.
*/
gfx::Matrix4x4 mTransformToCompBounds;
LayerToParentLayerMatrix4x4 mTransformToCompBounds;
/*
* The critical displayport of the content from the nearest ancestor layer

View File

@@ -202,7 +202,7 @@ GetBaseTransform(Layer* aLayer, Matrix4x4* aTransform)
static void
TransformClipRect(Layer* aLayer,
const Matrix4x4& aTransform)
const ParentLayerToParentLayerMatrix4x4& aTransform)
{
MOZ_ASSERT(aTransform.Is2D());
const Maybe<ParentLayerIntRect>& clipRect = aLayer->AsLayerComposite()->GetShadowClipRect();
@@ -254,7 +254,8 @@ TranslateShadowLayer(Layer* aLayer,
aLayer->AsLayerComposite()->SetShadowTransformSetByAnimation(false);
if (aAdjustClipRect) {
TransformClipRect(aLayer, Matrix4x4::Translation(aTranslation.x, aTranslation.y, 0));
TransformClipRect(aLayer,
ParentLayerToParentLayerMatrix4x4::Translation(aTranslation.x, aTranslation.y, 0));
// If a fixed- or sticky-position layer has a mask layer, that mask should
// move along with the layer, so apply the translation to the mask layer too.
@@ -467,8 +468,9 @@ AsyncCompositionManager::AlignFixedAndStickyLayers(Layer* aLayer,
// transform, but |anchor| and |transformedAnchor| are in a coordinate space
// where the local transform isn't applied yet, so apply it and then subtract
// to get the desired translation.
ParentLayerPoint translation = TransformTo<ParentLayerPixel>(localTransform, transformedAnchor)
- TransformTo<ParentLayerPixel>(localTransform, anchor);
auto localTransformTyped = ViewAs<LayerToParentLayerMatrix4x4>(localTransform);
ParentLayerPoint translation = TransformTo<ParentLayerPixel>(localTransformTyped, transformedAnchor)
- TransformTo<ParentLayerPixel>(localTransformTyped, anchor);
if (aLayer->GetIsStickyPosition()) {
// For sticky positioned layers, the difference between the two rectangles
@@ -895,7 +897,8 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer,
// frame and should not be transformed.
if (asyncClip && !metrics.UsesContainerScrolling()) {
MOZ_ASSERT(asyncTransform.Is2D());
asyncClip = Some(TransformTo<ParentLayerPixel>(asyncTransform, *asyncClip));
asyncClip = Some(TransformTo<ParentLayerPixel>(
ViewAs<ParentLayerToParentLayerMatrix4x4>(asyncTransform), *asyncClip));
}
// Combine the local clip with the ancestor scrollframe clip. This is not
@@ -1137,7 +1140,7 @@ ApplyAsyncTransformToScrollbarForContent(Layer* aScrollbar,
// including the layer with the async transform. Otherwise the scrollbar
// shifts but gets clipped and so appears to flicker.
for (Layer* ancestor = aScrollbar; ancestor != aContent.GetLayer(); ancestor = ancestor->GetParent()) {
TransformClipRect(ancestor, asyncCompensation);
TransformClipRect(ancestor, ViewAs<ParentLayerToParentLayerMatrix4x4>(asyncCompensation));
}
}
transform = transform * compensation;

View File

@@ -308,8 +308,8 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
// Transform the newly calculated visible region into our parent's space,
// apply our clip to it (if any), and accumulate it into |aVisibleRegion|
// for the caller to use.
ParentLayerIntRegion visibleParentSpace =
TransformTo<ParentLayerPixel>(transform, visible);
ParentLayerIntRegion visibleParentSpace = TransformTo<ParentLayerPixel>(
ViewAs<LayerToParentLayerMatrix4x4>(transform), visible);
if (const Maybe<ParentLayerIntRect>& clipRect = composite->GetShadowClipRect()) {
visibleParentSpace.AndWith(*clipRect);
}

View File

@@ -139,35 +139,40 @@ TypedMatrix ViewAs(const gfx::Matrix4x4& aMatrix) {
// Convenience functions for transforming an entity from one strongly-typed
// coordinate system to another using the provided transformation matrix.
template <typename TargetUnits, typename SourceUnits>
static gfx::PointTyped<TargetUnits> TransformTo(const gfx::Matrix4x4& aTransform,
const gfx::PointTyped<SourceUnits>& aPoint)
static gfx::PointTyped<TargetUnits>
TransformTo(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::PointTyped<SourceUnits>& aPoint)
{
return ViewAs<TargetUnits>(aTransform * aPoint.ToUnknownPoint());
return aTransform * aPoint;
}
template <typename TargetUnits, typename SourceUnits>
static gfx::IntPointTyped<TargetUnits> TransformTo(const gfx::Matrix4x4& aTransform,
const gfx::IntPointTyped<SourceUnits>& aPoint)
static gfx::IntPointTyped<TargetUnits>
TransformTo(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::IntPointTyped<SourceUnits>& aPoint)
{
return RoundedToInt(TransformTo<TargetUnits>(aTransform, gfx::PointTyped<SourceUnits>(aPoint)));
}
template <typename TargetUnits, typename SourceUnits>
static gfx::RectTyped<TargetUnits> TransformTo(const gfx::Matrix4x4& aTransform,
const gfx::RectTyped<SourceUnits>& aRect)
static gfx::RectTyped<TargetUnits>
TransformTo(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::RectTyped<SourceUnits>& aRect)
{
return ViewAs<TargetUnits>(aTransform.TransformBounds(aRect.ToUnknownRect()));
return aTransform.TransformBounds(aRect);
}
template <typename TargetUnits, typename SourceUnits>
static gfx::IntRectTyped<TargetUnits> TransformTo(const gfx::Matrix4x4& aTransform,
const gfx::IntRectTyped<SourceUnits>& aRect)
static gfx::IntRectTyped<TargetUnits>
TransformTo(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::IntRectTyped<SourceUnits>& aRect)
{
gfx::Rect rect(aRect.ToUnknownRect());
return RoundedToInt(ViewAs<TargetUnits>(aTransform.TransformBounds(rect)));
return RoundedToInt(TransformTo<TargetUnits>(aTransform, gfx::RectTyped<SourceUnits>(aRect)));
}
template <typename TargetUnits, typename SourceUnits>
static gfx::IntRegionTyped<TargetUnits> TransformTo(const gfx::Matrix4x4& aTransform,
const gfx::IntRegionTyped<SourceUnits>& aRegion)
static gfx::IntRegionTyped<TargetUnits>
TransformTo(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::IntRegionTyped<SourceUnits>& aRegion)
{
return ViewAs<TargetUnits>(aRegion.ToUnknownRegion().Transform(aTransform));
return ViewAs<TargetUnits>(aRegion.ToUnknownRegion().Transform(
aTransform.ToUnknownMatrix()));
}
// Transform |aVector|, which is anchored at |aAnchor|, by the given transform
@@ -175,9 +180,11 @@ static gfx::IntRegionTyped<TargetUnits> TransformTo(const gfx::Matrix4x4& aTrans
// The anchor is necessary because with 3D tranforms, the location of the
// vector can affect the result of the transform.
template <typename TargetUnits, typename SourceUnits>
static gfx::PointTyped<TargetUnits> TransformVector(const gfx::Matrix4x4& aTransform,
const gfx::PointTyped<SourceUnits>& aVector,
const gfx::PointTyped<SourceUnits>& aAnchor) {
static gfx::PointTyped<TargetUnits>
TransformVector(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::PointTyped<SourceUnits>& aVector,
const gfx::PointTyped<SourceUnits>& aAnchor)
{
gfx::PointTyped<TargetUnits> transformedStart = TransformTo<TargetUnits>(aTransform, aAnchor);
gfx::PointTyped<TargetUnits> transformedEnd = TransformTo<TargetUnits>(aTransform, aAnchor + aVector);
return transformedEnd - transformedStart;
@@ -191,25 +198,27 @@ static gfx::PointTyped<TargetUnits> TransformVector(const gfx::Matrix4x4& aTrans
// return a Maybe object which contains a value if and only if the
// result is meaningful
template <typename TargetUnits, typename SourceUnits>
static Maybe<gfx::PointTyped<TargetUnits>> UntransformTo(const gfx::Matrix4x4& aTransform,
const gfx::PointTyped<SourceUnits>& aPoint)
static Maybe<gfx::PointTyped<TargetUnits>>
UntransformTo(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::PointTyped<SourceUnits>& aPoint)
{
gfx::Point4D point = aTransform.ProjectPoint(aPoint.ToUnknownPoint());
gfx::Point4DTyped<TargetUnits> point = aTransform.ProjectPoint(aPoint);
if (!point.HasPositiveWCoord()) {
return Nothing();
}
return Some(ViewAs<TargetUnits>(point.As2DPoint()));
return Some(point.As2DPoint());
}
template <typename TargetUnits, typename SourceUnits>
static Maybe<gfx::IntPointTyped<TargetUnits>> UntransformTo(const gfx::Matrix4x4& aTransform,
const gfx::IntPointTyped<SourceUnits>& aPoint)
static Maybe<gfx::IntPointTyped<TargetUnits>>
UntransformTo(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::IntPointTyped<SourceUnits>& aPoint)
{
gfx::Point p = aPoint.ToUnknownPoint();
gfx::Point4D point = aTransform.ProjectPoint(p);
gfx::PointTyped<SourceUnits> p = aPoint;
gfx::Point4DTyped<TargetUnits> point = aTransform.ProjectPoint(p);
if (!point.HasPositiveWCoord()) {
return Nothing();
}
return Some(RoundedToInt(ViewAs<TargetUnits>(point.As2DPoint())));
return Some(RoundedToInt(point.As2DPoint()));
}
// The versions of UntransformTo() that take a rectangle also take a clip,
@@ -217,38 +226,42 @@ static Maybe<gfx::IntPointTyped<TargetUnits>> UntransformTo(const gfx::Matrix4x4
// result of the transform is intersected with this clip, and is considered
// meaningful if the intersection is not empty.
template <typename TargetUnits, typename SourceUnits>
static Maybe<gfx::RectTyped<TargetUnits>> UntransformTo(const gfx::Matrix4x4& aTransform,
const gfx::RectTyped<SourceUnits>& aRect,
const gfx::RectTyped<TargetUnits>& aClip)
static Maybe<gfx::RectTyped<TargetUnits>>
UntransformTo(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::RectTyped<SourceUnits>& aRect,
const gfx::RectTyped<TargetUnits>& aClip)
{
gfx::Rect rect = aTransform.ProjectRectBounds(aRect.ToUnknownRect(), aClip.ToUnknownRect());
gfx::RectTyped<TargetUnits> rect = aTransform.ProjectRectBounds(aRect, aClip);
if (rect.IsEmpty()) {
return Nothing();
}
return Some(ViewAs<TargetUnits>(rect));
return Some(rect);
}
template <typename TargetUnits, typename SourceUnits>
static Maybe<gfx::IntRectTyped<TargetUnits>> UntransformTo(const gfx::Matrix4x4& aTransform,
const gfx::IntRectTyped<SourceUnits>& aRect,
const gfx::IntRectTyped<TargetUnits>& aClip)
static Maybe<gfx::IntRectTyped<TargetUnits>>
UntransformTo(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::IntRectTyped<SourceUnits>& aRect,
const gfx::IntRectTyped<TargetUnits>& aClip)
{
gfx::Rect rect = aTransform.ProjectRectBounds(aRect.ToUnknownRect(), aClip.ToUnknownRect());
gfx::RectTyped<TargetUnits> rect = aTransform.ProjectRectBounds(aRect, aClip);
if (rect.IsEmpty()) {
return Nothing();
}
return Some(RoundedToInt(ViewAs<TargetUnits>(rect)));
return Some(RoundedToInt(rect));
}
template <typename TargetUnits, typename SourceUnits>
static Maybe<gfx::PointTyped<TargetUnits>> UntransformVector(const gfx::Matrix4x4& aTransform,
const gfx::PointTyped<SourceUnits>& aVector,
const gfx::PointTyped<SourceUnits>& aAnchor) {
gfx::Point4D projectedAnchor = aTransform.ProjectPoint(aAnchor.ToUnknownPoint());
gfx::Point4D projectedTarget = aTransform.ProjectPoint(aAnchor.ToUnknownPoint() + aVector.ToUnknownPoint());
static Maybe<gfx::PointTyped<TargetUnits>>
UntransformVector(const gfx::Matrix4x4Typed<SourceUnits, TargetUnits>& aTransform,
const gfx::PointTyped<SourceUnits>& aVector,
const gfx::PointTyped<SourceUnits>& aAnchor)
{
gfx::Point4DTyped<TargetUnits> projectedAnchor = aTransform.ProjectPoint(aAnchor);
gfx::Point4DTyped<TargetUnits> projectedTarget = aTransform.ProjectPoint(aAnchor + aVector);
if (!projectedAnchor.HasPositiveWCoord() || !projectedTarget.HasPositiveWCoord()){
return Nothing();
}
return Some(ViewAs<TargetUnits>(projectedTarget.As2DPoint() - projectedAnchor.As2DPoint()));
return Some(projectedTarget.As2DPoint() - projectedAnchor.As2DPoint());
}
} // namespace mozilla

View File

@@ -1197,7 +1197,7 @@ nsDisplayListBuilder::AdjustWindowDraggingRegion(nsIFrame* aFrame)
return;
}
Matrix4x4 referenceFrameToRootReferenceFrame;
LayoutDeviceToLayoutDeviceMatrix4x4 referenceFrameToRootReferenceFrame;
// The const_cast is for nsLayoutUtils::GetTransformToAncestor.
nsIFrame* referenceFrame = const_cast<nsIFrame*>(FindReferenceFrameFor(aFrame));
@@ -1207,7 +1207,8 @@ nsDisplayListBuilder::AdjustWindowDraggingRegion(nsIFrame* aFrame)
// the horizontal flip transform that's applied to the urlbar textbox in
// RTL mode - it should be able to exclude itself from the draggable region.
referenceFrameToRootReferenceFrame =
nsLayoutUtils::GetTransformToAncestor(referenceFrame, mReferenceFrame);
ViewAs<LayoutDeviceToLayoutDeviceMatrix4x4>(
nsLayoutUtils::GetTransformToAncestor(referenceFrame, mReferenceFrame));
Matrix referenceFrameToRootReferenceFrame2d;
if (!referenceFrameToRootReferenceFrame.Is2D(&referenceFrameToRootReferenceFrame2d) ||
!referenceFrameToRootReferenceFrame2d.IsRectilinear()) {

View File

@@ -72,7 +72,7 @@ MouseInput::MouseInput(const WidgetMouseEventBase& aMouseEvent)
}
bool
MouseInput::TransformToLocal(const gfx::Matrix4x4& aTransform)
MouseInput::TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform)
{
Maybe<ParentLayerPoint> point = UntransformTo<ParentLayerPixel>(aTransform, mOrigin);
if (!point) {
@@ -270,7 +270,7 @@ MultiTouchInput::MultiTouchInput(const WidgetMouseEvent& aMouseEvent)
}
bool
MultiTouchInput::TransformToLocal(const gfx::Matrix4x4& aTransform)
MultiTouchInput::TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform)
{
for (size_t i = 0; i < mTouches.Length(); i++) {
Maybe<ParentLayerIntPoint> point = UntransformTo<ParentLayerPixel>(aTransform, mTouches[i].mScreenPoint);
@@ -317,7 +317,7 @@ PanGestureInput::ToWidgetWheelEvent(nsIWidget* aWidget) const
}
bool
PanGestureInput::TransformToLocal(const gfx::Matrix4x4& aTransform)
PanGestureInput::TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform)
{
Maybe<ParentLayerPoint> panStartPoint = UntransformTo<ParentLayerPixel>(aTransform, mPanStartPoint);
if (!panStartPoint) {
@@ -334,7 +334,7 @@ PanGestureInput::TransformToLocal(const gfx::Matrix4x4& aTransform)
}
bool
PinchGestureInput::TransformToLocal(const gfx::Matrix4x4& aTransform)
PinchGestureInput::TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform)
{
Maybe<ParentLayerPoint> point = UntransformTo<ParentLayerPixel>(aTransform, mFocusPoint);
if (!point) {
@@ -345,7 +345,7 @@ PinchGestureInput::TransformToLocal(const gfx::Matrix4x4& aTransform)
}
bool
TapGestureInput::TransformToLocal(const gfx::Matrix4x4& aTransform)
TapGestureInput::TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform)
{
Maybe<ParentLayerIntPoint> point = UntransformTo<ParentLayerPixel>(aTransform, mPoint);
if (!point) {
@@ -409,7 +409,7 @@ ScrollWheelInput::ToWidgetWheelEvent(nsIWidget* aWidget) const
}
bool
ScrollWheelInput::TransformToLocal(const gfx::Matrix4x4& aTransform)
ScrollWheelInput::TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform)
{
Maybe<ParentLayerPoint> point = UntransformTo<ParentLayerPixel>(aTransform, mOrigin);
if (!point) {

View File

@@ -242,7 +242,7 @@ public:
// and rotation angle.
explicit MultiTouchInput(const WidgetMouseEvent& aMouseEvent);
bool TransformToLocal(const gfx::Matrix4x4& aTransform);
bool TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform);
MultiTouchType mType;
nsTArray<SingleTouchData> mTouches;
@@ -284,7 +284,7 @@ public:
bool IsLeftButton() const { return mButtonType == LEFT_BUTTON; }
bool TransformToLocal(const gfx::Matrix4x4& aTransform);
bool TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform);
MouseType mType;
ButtonType mButtonType;
@@ -366,7 +366,7 @@ public:
WidgetWheelEvent ToWidgetWheelEvent(nsIWidget* aWidget) const;
bool TransformToLocal(const gfx::Matrix4x4& aTransform);
bool TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform);
PanGestureType mType;
ScreenPoint mPanStartPoint;
@@ -443,7 +443,7 @@ public:
{
}
bool TransformToLocal(const gfx::Matrix4x4& aTransform);
bool TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform);
PinchGestureType mType;
@@ -516,7 +516,7 @@ public:
{
}
bool TransformToLocal(const gfx::Matrix4x4& aTransform);
bool TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform);
TapGestureType mType;
@@ -591,7 +591,7 @@ public:
explicit ScrollWheelInput(const WidgetWheelEvent& aEvent);
WidgetWheelEvent ToWidgetWheelEvent(nsIWidget* aWidget) const;
bool TransformToLocal(const gfx::Matrix4x4& aTransform);
bool TransformToLocal(const ScreenToParentLayerMatrix4x4& aTransform);
bool IsCustomizedByUserPrefs() const;