summaryrefslogtreecommitdiff
path: root/libs/input/PointerController.h
diff options
context:
space:
mode:
authorArthur Hung <arthurhung@google.com>2019-01-25 17:53:22 +0800
committerArthur Hung <arthurhung@google.com>2019-02-13 16:23:22 +0800
commitd25699a122570dfae3c1a634c46cd22876293c10 (patch)
tree862cc71095e0755c8f6539982d822b2b00fa87ba /libs/input/PointerController.h
parent9c6db23f79371ac1a7200fc013739d46cd35a031 (diff)
Support showTouches on multi-display (2/2)
Currently the PointerController would be associated with the top most freeform or external display if enable desktop mode. But for presenting spots when enable showTouches from develop options, they should be shown on the corresponding display where user touched. Also changed Vector to std::vector. Test: atest inputflinger_tests Test: Use device support multi-display and touch screen (like mojave). Enable showTaps from develop options and check if show tap spots. Bug: 120815589 Change-Id: I0854fa97813aabf005dccb8ec6fbda10106126e9
Diffstat (limited to 'libs/input/PointerController.h')
-rw-r--r--libs/input/PointerController.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h
index be057867890d..52305b8244a6 100644
--- a/libs/input/PointerController.h
+++ b/libs/input/PointerController.h
@@ -103,7 +103,7 @@ public:
virtual void setPresentation(Presentation presentation);
virtual void setSpots(const PointerCoords* spotCoords,
- const uint32_t* spotIdToIndex, BitSet32 spotIdBits);
+ const uint32_t* spotIdToIndex, BitSet32 spotIdBits, int32_t displayId);
virtual void clearSpots();
void updatePointerIcon(int32_t iconId);
@@ -133,7 +133,7 @@ private:
: id(id), sprite(sprite), alpha(1.0f), scale(1.0f),
x(0.0f), y(0.0f), lastIcon(NULL) { }
- void updateSprite(const SpriteIcon* icon, float x, float y);
+ void updateSprite(const SpriteIcon* icon, float x, float y, int32_t displayId);
private:
const SpriteIcon* lastIcon;
@@ -180,8 +180,8 @@ private:
int32_t buttonState;
- Vector<Spot*> spots;
- Vector<sp<Sprite> > recycledSprites;
+ std::map<int32_t /* displayId */, std::vector<Spot*>> spotsByDisplay;
+ std::vector<sp<Sprite> > recycledSprites;
} mLocked GUARDED_BY(mLock);
bool getBoundsLocked(float* outMinX, float* outMinY, float* outMaxX, float* outMaxY) const;
@@ -200,9 +200,9 @@ private:
void removeInactivityTimeoutLocked();
void updatePointerLocked();
- Spot* getSpotLocked(uint32_t id);
- Spot* createAndAddSpotLocked(uint32_t id);
- Spot* removeFirstFadingSpotLocked();
+ Spot* getSpot(uint32_t id, const std::vector<Spot*>& spots);
+ Spot* createAndAddSpotLocked(uint32_t id, std::vector<Spot*>& spots);
+ Spot* removeFirstFadingSpotLocked(std::vector<Spot*>& spots);
void releaseSpotLocked(Spot* spot);
void fadeOutAndReleaseSpotLocked(Spot* spot);
void fadeOutAndReleaseAllSpotsLocked();