summaryrefslogtreecommitdiffstats
path: root/include/input
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2013-07-15 17:28:19 -0700
committerJeff Brown <jeffbrown@google.com>2013-07-15 17:31:13 -0700
commit5a2f68e5a5526ba80b5192776e2f0e349626777d (patch)
treed5669895ee7d77945cb3d73b6dedde24662d8106 /include/input
parent40c9e0a3989222b4c27c88f54b6acf67b58a68cf (diff)
downloadframeworks_native-5a2f68e5a5526ba80b5192776e2f0e349626777d.zip
frameworks_native-5a2f68e5a5526ba80b5192776e2f0e349626777d.tar.gz
frameworks_native-5a2f68e5a5526ba80b5192776e2f0e349626777d.tar.bz2
Fix PDK build.
Quick hack to remove Skia dependency from libinput. Change-Id: Ibaf2e312236f5e3f7251fa903ce381456a77467c
Diffstat (limited to 'include/input')
-rw-r--r--include/input/Input.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/input/Input.h b/include/input/Input.h
index 6d49b18..9abaaea 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -529,9 +529,28 @@ public:
void scale(float scaleFactor);
-#ifdef HAVE_ANDROID_OS
- void transform(const SkMatrix* matrix);
+ // Apply 3x3 perspective matrix transformation.
+ // Matrix is in row-major form and compatible with SkMatrix.
+ void transform(const float matrix[9]);
+
+#ifdef SkMatrix_DEFINED
+ // Helper for interoperating with Skia matrices since Skia isn't part of the PDK.
+ inline void transform(const SkMatrix* matrix) {
+ float m[9];
+ m[0] = SkScalarToFloat(matrix->get(SkMatrix::kMScaleX));
+ m[1] = SkScalarToFloat(matrix->get(SkMatrix::kMSkewX));
+ m[2] = SkScalarToFloat(matrix->get(SkMatrix::kMTransX));
+ m[3] = SkScalarToFloat(matrix->get(SkMatrix::kMSkewY));
+ m[4] = SkScalarToFloat(matrix->get(SkMatrix::kMScaleY));
+ m[5] = SkScalarToFloat(matrix->get(SkMatrix::kMTransY));
+ m[6] = SkScalarToFloat(matrix->get(SkMatrix::kMPersp0));
+ m[7] = SkScalarToFloat(matrix->get(SkMatrix::kMPersp1));
+ m[8] = SkScalarToFloat(matrix->get(SkMatrix::kMPersp2));
+ transform(m);
+ }
+#endif
+#ifdef HAVE_ANDROID_OS
status_t readFromParcel(Parcel* parcel);
status_t writeToParcel(Parcel* parcel) const;
#endif