diff options
Diffstat (limited to 'libs/input/PointerController.h')
-rw-r--r-- | libs/input/PointerController.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h index 97567bab202b..58bb01466d25 100644 --- a/libs/input/PointerController.h +++ b/libs/input/PointerController.h @@ -72,6 +72,8 @@ public: void reloadPointerResources(); void onDisplayViewportsUpdated(std::vector<DisplayViewport>& viewports); + void onDisplayInfosChanged(const std::vector<gui::DisplayInfo>& displayInfos); + private: friend PointerControllerContext::LooperCallback; friend PointerControllerContext::MessageHandler; @@ -85,9 +87,23 @@ private: struct Locked { Presentation presentation; + std::vector<gui::DisplayInfo> mDisplayInfos; std::unordered_map<int32_t /* displayId */, TouchSpotController> spotControllers; } mLocked GUARDED_BY(mLock); + class DisplayInfoListener : public gui::WindowInfosListener { + public: + explicit DisplayInfoListener(PointerController& pc) : mPointerController(pc){}; + void onWindowInfosChanged(const std::vector<android::gui::WindowInfo>&, + const std::vector<android::gui::DisplayInfo>&) override; + + private: + PointerController& mPointerController; + }; + sp<DisplayInfoListener> mDisplayInfoListener; + + const ui::Transform& getTransformForDisplayLocked(int displayId) const REQUIRES(mLock); + PointerController(const sp<PointerControllerPolicyInterface>& policy, const sp<Looper>& looper, const sp<SpriteController>& spriteController); void clearSpotsLocked(); |