summaryrefslogtreecommitdiffstats
path: root/libs/input
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2013-07-16 01:49:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-07-16 01:49:55 +0000
commit7556c37b1c1ddd82801bc9ea4cea1ade4d380a98 (patch)
tree889339b8c6b29d574bc34f2911d18738af9ff9ea /libs/input
parent174c26045c79c56acbd95f1644a72ca512c75134 (diff)
parent313eff7bb7e5eedbdbea805343451fd473241266 (diff)
downloadframeworks_native-7556c37b1c1ddd82801bc9ea4cea1ade4d380a98.zip
frameworks_native-7556c37b1c1ddd82801bc9ea4cea1ade4d380a98.tar.gz
frameworks_native-7556c37b1c1ddd82801bc9ea4cea1ade4d380a98.tar.bz2
Merge "Completely remove skia dependency from libinput."
Diffstat (limited to 'libs/input')
-rw-r--r--libs/input/tests/Android.mk3
-rw-r--r--libs/input/tests/InputEvent_test.cpp21
2 files changed, 18 insertions, 6 deletions
diff --git a/libs/input/tests/Android.mk b/libs/input/tests/Android.mk
index 4292741..c62dff1 100644
--- a/libs/input/tests/Android.mk
+++ b/libs/input/tests/Android.mk
@@ -14,8 +14,7 @@ shared_libraries := \
libutils \
libbinder \
libui \
- libstlport \
- libskia
+ libstlport
static_libraries := \
libgtest \
diff --git a/libs/input/tests/InputEvent_test.cpp b/libs/input/tests/InputEvent_test.cpp
index ab1feb3..78ea98e 100644
--- a/libs/input/tests/InputEvent_test.cpp
+++ b/libs/input/tests/InputEvent_test.cpp
@@ -17,7 +17,6 @@
#include <math.h>
#include <binder/Parcel.h>
-#include <core/SkMatrix.h>
#include <gtest/gtest.h>
#include <input/Input.h>
@@ -519,6 +518,20 @@ TEST_F(MotionEventTest, Parcel) {
ASSERT_NO_FATAL_FAILURE(assertEqualsEventWithHistory(&outEvent));
}
+static void setRotationMatrix(float matrix[9], float angle) {
+ float sin = sinf(angle);
+ float cos = cosf(angle);
+ matrix[0] = cos;
+ matrix[1] = -sin;
+ matrix[2] = 0;
+ matrix[3] = sin;
+ matrix[4] = cos;
+ matrix[5] = 0;
+ matrix[6] = 0;
+ matrix[7] = 0;
+ matrix[8] = 1.0f;
+}
+
TEST_F(MotionEventTest, Transform) {
// Generate some points on a circle.
// Each point 'i' is a point on a circle of radius ROTATION centered at (3,2) at an angle
@@ -561,9 +574,9 @@ TEST_F(MotionEventTest, Transform) {
ASSERT_NEAR(originalRawY, event.getRawY(0), 0.001);
// Apply a rotation about the origin by ROTATION degrees clockwise.
- SkMatrix matrix;
- matrix.setRotate(ROTATION);
- event.transform(&matrix);
+ float matrix[9];
+ setRotationMatrix(matrix, ROTATION * PI_180);
+ event.transform(matrix);
// Check the points.
for (size_t i = 0; i < pointerCount; i++) {