diff options
author | jschung <jschung@google.com> | 2024-01-05 19:10:44 +0900 |
---|---|---|
committer | jschung <jschung@google.com> | 2024-01-05 19:10:44 +0900 |
commit | f505f53decd13f6202d52415fb8fb6c012f3ca36 (patch) | |
tree | dd94f3052478b3b9e1d0bbadbc68c26732c381aa | |
parent | caf5a079f321b6c60ab7b4bf6e5516378c6a7b37 (diff) | |
download | aemu-f505f53decd13f6202d52415fb8fb6c012f3ca36.tar.gz |
Apply stacked layout for automotive devices
Especially for the wide width displays such as Distant Display, it's
hard to use the emulator when all displays are located on one row.
This change locates a display on a separate row when the total width
exceeds 50% of monitor width.
Bug: 316033487
Test: launch multi display targets such as gcar_dd_x86_64,
gcar_md_x86_64 and gcar_x86_86 in main trunk
Change-Id: I7c9846985ea147ff94f2374cd44840af5ae29b5d
-rw-r--r-- | base/include/aemu/base/LayoutResolver.h | 4 | ||||
-rw-r--r-- | host-common/include/host-common/MultiDisplay.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/base/include/aemu/base/LayoutResolver.h b/base/include/aemu/base/LayoutResolver.h index 1e30d3c..00940bb 100644 --- a/base/include/aemu/base/LayoutResolver.h +++ b/base/include/aemu/base/LayoutResolver.h @@ -28,5 +28,9 @@ std::unordered_map<uint32_t, std::pair<uint32_t, uint32_t>> resolveLayout( std::unordered_map<uint32_t, std::pair<uint32_t, uint32_t>> rect, const double monitorAspectRatio); +std::unordered_map<uint32_t, std::pair<uint32_t, uint32_t>> resolveStackedLayout( + std::unordered_map<uint32_t, std::pair<uint32_t, uint32_t>> rectangles, + const uint32_t monitorWidth); + } // namespace base } // namespace android diff --git a/host-common/include/host-common/MultiDisplay.h b/host-common/include/host-common/MultiDisplay.h index 909d840..879ecf2 100644 --- a/host-common/include/host-common/MultiDisplay.h +++ b/host-common/include/host-common/MultiDisplay.h @@ -126,6 +126,7 @@ public: void performRotation(int rot); bool notifyDisplayChanges(); + bool isOrientationSupported(); // 0 for default Android display // 1-5 for Emulator UI @@ -145,6 +146,7 @@ private: void performRotationLocked(int rot); void recomputeLayoutLocked(); + void recomputeStackedLayoutLocked(); void getCombinedDisplaySizeLocked(uint32_t* w, uint32_t* h); bool getMultiDisplay(uint32_t id, int32_t* x, |