diff options
author | 2020-07-01 10:57:59 -0700 | |
---|---|---|
committer | 2020-07-13 17:47:40 +0000 | |
commit | fd9c1edef5e398a46a92ad0f9f9dd1bff3e8af48 (patch) | |
tree | a405bb5d509a4cb40dc731ec330f85fd49cc917e | |
parent | c6a2f3a47d46c990105d58d6e3707b189605cbc1 (diff) |
Added libui dependencies for input
Allow Input to support Transform class from libui and
add Transform objects to MotionEvent and InputWindowInfo
Test: Builds
Bug: 158476194
Change-Id: Ic6f2507dbead97c2124dde8c8946add377d724c6
-rw-r--r-- | include/input/Input.h | 2 | ||||
-rw-r--r-- | include/input/InputWindow.h | 4 | ||||
l--------- | include/ui/Rotation.h | 1 | ||||
l--------- | include/ui/Transform.h | 1 | ||||
-rw-r--r-- | libs/input/Android.bp | 8 | ||||
-rw-r--r-- | libs/ui/Android.bp | 11 | ||||
-rw-r--r-- | libs/ui/include/ui/Transform.h | 7 | ||||
-rw-r--r-- | services/inputflinger/Android.bp | 1 | ||||
-rw-r--r-- | services/inputflinger/host/Android.bp | 1 |
9 files changed, 29 insertions, 7 deletions
diff --git a/include/input/Input.h b/include/input/Input.h index ac901ae88a..194db1c6b5 100644 --- a/include/input/Input.h +++ b/include/input/Input.h @@ -26,6 +26,7 @@ #include <android/input.h> #include <math.h> #include <stdint.h> +#include <ui/Transform.h> #include <utils/BitSet.h> #include <utils/KeyedVector.h> #include <utils/RefBase.h> @@ -741,6 +742,7 @@ protected: float mYScale; float mXOffset; float mYOffset; + ui::Transform mTransform; float mXPrecision; float mYPrecision; float mRawXCursorPosition; diff --git a/include/input/InputWindow.h b/include/input/InputWindow.h index f8c759c85d..6a42ff6eb4 100644 --- a/include/input/InputWindow.h +++ b/include/input/InputWindow.h @@ -21,6 +21,7 @@ #include <input/InputTransport.h> #include <ui/Rect.h> #include <ui/Region.h> +#include <ui/Transform.h> #include <utils/RefBase.h> #include <utils/Timers.h> @@ -160,6 +161,9 @@ struct InputWindowInfo { float windowXScale = 1.0f; float windowYScale = 1.0f; + // Transform applied to individual windows. + ui::Transform transform; + /* * This is filled in by the WM relative to the frame and then translated * to absolute coordinates by SurfaceFlinger once the frame is computed. diff --git a/include/ui/Rotation.h b/include/ui/Rotation.h new file mode 120000 index 0000000000..095d2cee88 --- /dev/null +++ b/include/ui/Rotation.h @@ -0,0 +1 @@ +../../libs/ui/include/ui/Rotation.h
\ No newline at end of file diff --git a/include/ui/Transform.h b/include/ui/Transform.h new file mode 120000 index 0000000000..323f1fd1b4 --- /dev/null +++ b/include/ui/Transform.h @@ -0,0 +1 @@ +../../libs/ui/include/ui/Transform.h
\ No newline at end of file diff --git a/libs/input/Android.bp b/libs/input/Android.bp index 7037680935..0aa325f9df 100644 --- a/libs/input/Android.bp +++ b/libs/input/Android.bp @@ -43,6 +43,14 @@ cc_library { "libcutils", ], + static_libs: [ + "libui-types", + ], + + export_static_lib_headers: [ + "libui-types", + ], + target: { android: { srcs: [ diff --git a/libs/ui/Android.bp b/libs/ui/Android.bp index f3edd3c791..2acc5bb14c 100644 --- a/libs/ui/Android.bp +++ b/libs/ui/Android.bp @@ -51,22 +51,30 @@ cc_library_static { min_sdk_version: "apex_inherit", shared_libs: [ + "libbase", "libutils", ], static_libs: [ + "libarect", "libmath", ], srcs: [ "ColorSpace.cpp", + "Rect.cpp", + "Region.cpp", + "Transform.cpp", ], export_include_dirs: [ + "include", + "include_private", "include_types", ], export_static_lib_headers: [ + "libarect", "libmath", ], @@ -111,10 +119,7 @@ cc_library_shared { "HdrCapabilities.cpp", "PixelFormat.cpp", "PublicFormat.cpp", - "Rect.cpp", - "Region.cpp", "Size.cpp", - "Transform.cpp", "UiConfig.cpp", ], diff --git a/libs/ui/include/ui/Transform.h b/libs/ui/include/ui/Transform.h index c6bb598d7f..3e8caf46c5 100644 --- a/libs/ui/include/ui/Transform.h +++ b/libs/ui/include/ui/Transform.h @@ -21,7 +21,6 @@ #include <ostream> #include <string> -#include <hardware/hardware.h> #include <math/mat4.h> #include <math/vec2.h> #include <math/vec3.h> @@ -44,9 +43,9 @@ public: enum RotationFlags : uint32_t { ROT_0 = 0, - FLIP_H = HAL_TRANSFORM_FLIP_H, - FLIP_V = HAL_TRANSFORM_FLIP_V, - ROT_90 = HAL_TRANSFORM_ROT_90, + FLIP_H = 1, // HAL_TRANSFORM_FLIP_H + FLIP_V = 2, // HAL_TRANSFORM_FLIP_V + ROT_90 = 4, // HAL_TRANSFORM_ROT_90 ROT_180 = FLIP_H | FLIP_V, ROT_270 = ROT_180 | ROT_90, ROT_INVALID = 0x80 diff --git a/services/inputflinger/Android.bp b/services/inputflinger/Android.bp index f685628a6c..5930f0a884 100644 --- a/services/inputflinger/Android.bp +++ b/services/inputflinger/Android.bp @@ -111,6 +111,7 @@ cc_defaults { "libcutils", "libinput", "liblog", + "libui", "libutils", ], header_libs: [ diff --git a/services/inputflinger/host/Android.bp b/services/inputflinger/host/Android.bp index b56f356dfd..2a84dcbd2a 100644 --- a/services/inputflinger/host/Android.bp +++ b/services/inputflinger/host/Android.bp @@ -63,5 +63,6 @@ cc_binary { ], static_libs: [ "libarect", + "libui-types", ], } |