aboutsummaryrefslogtreecommitdiff
path: root/minui/graphics.cpp
diff options
context:
space:
mode:
authorJulian Veit <Claymore1298@gmail.com>2024-06-13 08:17:58 +0200
committerJulian Veit <Claymore1298@gmail.com>2024-06-13 08:17:58 +0200
commit090e278f122777078f470fe87e11ad1212db90ef (patch)
tree5473ec2fd9a90bdf60757ffcb5ade48b088cb4ed /minui/graphics.cpp
parent6d486b1f5660f2a9fc3f4559c03d9d4989af2c99 (diff)
parent8904d2a254c5263caded20af8fde209f8b37f22d (diff)
Merge branch 'lineage-20.0' of https://github.com/LineageOS/android_bootable_recovery into HEADHEADt13.0
Change-Id: Ic0aae25ab32e81f4ebf802693f8c9a2fdc283beb
Diffstat (limited to 'minui/graphics.cpp')
-rw-r--r--minui/graphics.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/minui/graphics.cpp b/minui/graphics.cpp
index cd01768a..67de5cc0 100644
--- a/minui/graphics.cpp
+++ b/minui/graphics.cpp
@@ -41,6 +41,7 @@ static uint32_t gr_current = ~0;
// gr_draw is owned by backends.
static GRSurface* gr_draw = nullptr;
static GRRotation rotation = GRRotation::NONE;
+static GRRotation touch_rotation = GRRotation::NONE;
static PixelFormat pixel_format = PixelFormat::UNKNOWN;
// The graphics backend list that provides fallback options for the default backend selection.
// For example, it will fist try DRM, then try FBDEV if DRM is unavailable.
@@ -474,6 +475,18 @@ int gr_init(std::initializer_list<GraphicsBackend> backends) {
gr_rotate(GRRotation::NONE);
}
+ std::string touch_rotation_str =
+ android::base::GetProperty("ro.minui.default_touch_rotation", "ROTATION_NONE");
+ if (touch_rotation_str == "ROTATION_RIGHT") {
+ gr_rotate_touch(GRRotation::RIGHT);
+ } else if (touch_rotation_str == "ROTATION_DOWN") {
+ gr_rotate_touch(GRRotation::DOWN);
+ } else if (touch_rotation_str == "ROTATION_LEFT") {
+ gr_rotate_touch(GRRotation::LEFT);
+ } else { // "ROTATION_NONE" or unknown string
+ gr_rotate_touch(GRRotation::NONE);
+ }
+
if (gr_draw->pixel_bytes != 4) {
printf("gr_init: Only 4-byte pixel formats supported\n");
}
@@ -519,6 +532,10 @@ int gr_overscan_offset_y() {
return overscan_offset_y;
}
+GRRotation gr_touch_rotation() {
+ return touch_rotation;
+}
+
void gr_fb_blank(bool blank) {
gr_backend->Blank(blank);
}
@@ -531,6 +548,10 @@ void gr_rotate(GRRotation rot) {
rotation = rot;
}
+void gr_rotate_touch(GRRotation rot) {
+ touch_rotation = rot;
+}
+
bool gr_has_multiple_connectors() {
return gr_backend->HasMultipleConnectors();
}