From 6a2ce94936c11e3851a619a3287a8916a7da1ff5 Mon Sep 17 00:00:00 2001 From: Byoungho Jung Date: Sat, 7 Oct 2023 16:19:19 +0900 Subject: Pointer icon refactor for mouse (base) When PointerChoreographer is enabled, CursorInputMapper no longer depends on the legacy PointerController. PointerChoreographer is responsible for accumulating movements, fading/unfading pointers, and deciding display/coordinates. Test: atest libinputservice_test Bug: 293587049 Change-Id: Ie35b385a99623bbcb2e47b394b7cf2c0f7c5bc0e --- libs/input/PointerController.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'libs/input/PointerController.h') diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h index aa7ca3c52ecf..08e19a096d87 100644 --- a/libs/input/PointerController.h +++ b/libs/input/PointerController.h @@ -47,7 +47,8 @@ class PointerController : public PointerControllerInterface { public: static std::shared_ptr create( const sp& policy, const sp& looper, - SpriteController& spriteController, bool enabled); + SpriteController& spriteController, bool enabled, + ControllerType type = ControllerType::LEGACY); ~PointerController() override; @@ -75,7 +76,7 @@ public: void onDisplayInfosChangedLocked(const std::vector& displayInfos) REQUIRES(getLock()); - std::string dump(); + std::string dump() override; protected: using WindowListenerConsumer = @@ -87,10 +88,10 @@ protected: WindowListenerConsumer registerListener, WindowListenerConsumer unregisterListener); -private: PointerController(const sp& policy, const sp& looper, SpriteController& spriteController, bool enabled); +private: friend PointerControllerContext::LooperCallback; friend PointerControllerContext::MessageHandler; @@ -135,6 +136,24 @@ private: void clearSpotsLocked() REQUIRES(getLock()); }; +class MousePointerController : public PointerController { +public: + /** A version of PointerController that controls one mouse pointer. */ + MousePointerController(const sp& policy, + const sp& looper, SpriteController& spriteController, + bool enabled); + + void setPresentation(Presentation) override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void setSpots(const PointerCoords*, const uint32_t*, BitSet32, int32_t) override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void clearSpots() override { + LOG_ALWAYS_FATAL("Should not be called"); + } +}; + } // namespace android #endif // _UI_POINTER_CONTROLLER_H -- cgit v1.2.3-59-g8ed1b