12
12
#include " mozilla/webrender/WebRenderAPI.h"
13
13
#include " nsDebug.h" // for NS_ASSERTION
14
14
#include " nsIXULRuntime.h" // for FissionAutostart
15
- #include " mozilla/gfx/Matrix.h"
16
15
17
16
#define APZCTM_LOG (...) \
18
17
MOZ_LOG (APZCTreeManager::sLog , LogLevel::Debug, (__VA_ARGS__))
@@ -23,53 +22,6 @@ namespace layers {
23
22
using mozilla::gfx::CompositorHitTestFlags;
24
23
using mozilla::gfx::CompositorHitTestInvisibleToHit;
25
24
26
- static bool CheckCloseToIdentity (const gfx::Matrix4x4& aMatrix) {
27
- // We allow a factor of 1/2048 in the multiply part of the matrix, so that if
28
- // we multiply by a point on a screen of size 2048 we would be off by at most
29
- // 1 pixel approximately.
30
- const float multiplyEps = 1 / 2048 .f ;
31
- // We allow 1 pixel in the translate part of the matrix.
32
- const float translateEps = 1 .f ;
33
-
34
- if (!FuzzyEqualsAdditive (aMatrix._11 , 1 .f , multiplyEps) ||
35
- !FuzzyEqualsAdditive (aMatrix._12 , 0 .f , multiplyEps) ||
36
- !FuzzyEqualsAdditive (aMatrix._13 , 0 .f , multiplyEps) ||
37
- !FuzzyEqualsAdditive (aMatrix._14 , 0 .f , multiplyEps) ||
38
- !FuzzyEqualsAdditive (aMatrix._21 , 0 .f , multiplyEps) ||
39
- !FuzzyEqualsAdditive (aMatrix._22 , 1 .f , multiplyEps) ||
40
- !FuzzyEqualsAdditive (aMatrix._23 , 0 .f , multiplyEps) ||
41
- !FuzzyEqualsAdditive (aMatrix._24 , 0 .f , multiplyEps) ||
42
- !FuzzyEqualsAdditive (aMatrix._31 , 0 .f , multiplyEps) ||
43
- !FuzzyEqualsAdditive (aMatrix._32 , 0 .f , multiplyEps) ||
44
- !FuzzyEqualsAdditive (aMatrix._33 , 1 .f , multiplyEps) ||
45
- !FuzzyEqualsAdditive (aMatrix._34 , 0 .f , multiplyEps) ||
46
- !FuzzyEqualsAdditive (aMatrix._41 , 0 .f , translateEps) ||
47
- !FuzzyEqualsAdditive (aMatrix._42 , 0 .f , translateEps) ||
48
- !FuzzyEqualsAdditive (aMatrix._43 , 0 .f , translateEps) ||
49
- !FuzzyEqualsAdditive (aMatrix._44 , 1 .f , multiplyEps)) {
50
- return false ;
51
- }
52
- return true ;
53
- }
54
-
55
- // Checks that within the constraints of floating point math we can invert it
56
- // reasonably enough that multiplying by the computed inverse is close to the
57
- // identity.
58
- static bool CheckInvertibleWithFinitePrecision (const gfx::Matrix4x4& aMatrix) {
59
- auto inverse = aMatrix.MaybeInverse ();
60
- if (inverse.isNothing ()) {
61
- // Should we return false?
62
- return true ;
63
- }
64
- if (!CheckCloseToIdentity (aMatrix * *inverse)) {
65
- return false ;
66
- }
67
- if (!CheckCloseToIdentity (*inverse * aMatrix)) {
68
- return false ;
69
- }
70
- return true ;
71
- }
72
-
73
25
IAPZHitTester::HitTestResult WRHitTester::GetAPZCAtPoint (
74
26
const ScreenPoint& aHitTestPoint,
75
27
const RecursiveMutexAutoLock& aProofOfTreeLock) {
@@ -144,19 +96,6 @@ IAPZHitTester::HitTestResult WRHitTester::GetAPZCAtPoint(
144
96
continue ;
145
97
}
146
98
147
- if (!CheckInvertibleWithFinitePrecision (
148
- mTreeManager ->GetScreenToApzcTransform (node->GetApzc ())
149
- .ToUnknownMatrix ())) {
150
- APZCTM_LOG (" skipping due to check inverse accuracy\n " );
151
- continue ;
152
- }
153
- if (!CheckInvertibleWithFinitePrecision (
154
- mTreeManager ->GetApzcToGeckoTransform (node->GetApzc ())
155
- .ToUnknownMatrix ())) {
156
- APZCTM_LOG (" skipping due to check inverse accuracy\n " );
157
- continue ;
158
- }
159
-
160
99
APZCTM_LOG (" selecting as chosen result.\n " );
161
100
chosenResult = Some (result);
162
101
hit.mTargetApzc = node->GetApzc ();
0 commit comments