Merge "Remove getButtonState/setButtonState from PointerController" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
10be070b98
@@ -53,8 +53,6 @@ MouseCursorController::MouseCursorController(PointerControllerContext& context)
|
|||||||
mLocked.resolvedPointerType = PointerIconStyle::TYPE_NOT_SPECIFIED;
|
mLocked.resolvedPointerType = PointerIconStyle::TYPE_NOT_SPECIFIED;
|
||||||
|
|
||||||
mLocked.resourcesLoaded = false;
|
mLocked.resourcesLoaded = false;
|
||||||
|
|
||||||
mLocked.buttonState = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseCursorController::~MouseCursorController() {
|
MouseCursorController::~MouseCursorController() {
|
||||||
@@ -95,22 +93,6 @@ void MouseCursorController::move(float deltaX, float deltaY) {
|
|||||||
setPositionLocked(mLocked.pointerX + deltaX, mLocked.pointerY + deltaY);
|
setPositionLocked(mLocked.pointerX + deltaX, mLocked.pointerY + deltaY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseCursorController::setButtonState(int32_t buttonState) {
|
|
||||||
#if DEBUG_MOUSE_CURSOR_UPDATES
|
|
||||||
ALOGD("Set button state 0x%08x", buttonState);
|
|
||||||
#endif
|
|
||||||
std::scoped_lock lock(mLock);
|
|
||||||
|
|
||||||
if (mLocked.buttonState != buttonState) {
|
|
||||||
mLocked.buttonState = buttonState;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t MouseCursorController::getButtonState() const {
|
|
||||||
std::scoped_lock lock(mLock);
|
|
||||||
return mLocked.buttonState;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MouseCursorController::setPosition(float x, float y) {
|
void MouseCursorController::setPosition(float x, float y) {
|
||||||
#if DEBUG_MOUSE_CURSOR_UPDATES
|
#if DEBUG_MOUSE_CURSOR_UPDATES
|
||||||
ALOGD("Set pointer position to x=%0.3f, y=%0.3f", x, y);
|
ALOGD("Set pointer position to x=%0.3f, y=%0.3f", x, y);
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ public:
|
|||||||
|
|
||||||
std::optional<FloatRect> getBounds() const;
|
std::optional<FloatRect> getBounds() const;
|
||||||
void move(float deltaX, float deltaY);
|
void move(float deltaX, float deltaY);
|
||||||
void setButtonState(int32_t buttonState);
|
|
||||||
int32_t getButtonState() const;
|
|
||||||
void setPosition(float x, float y);
|
void setPosition(float x, float y);
|
||||||
FloatPoint getPosition() const;
|
FloatPoint getPosition() const;
|
||||||
int32_t getDisplayId() const;
|
int32_t getDisplayId() const;
|
||||||
@@ -96,8 +94,6 @@ private:
|
|||||||
PointerIconStyle requestedPointerType;
|
PointerIconStyle requestedPointerType;
|
||||||
PointerIconStyle resolvedPointerType;
|
PointerIconStyle resolvedPointerType;
|
||||||
|
|
||||||
int32_t buttonState;
|
|
||||||
|
|
||||||
bool animating{false};
|
bool animating{false};
|
||||||
|
|
||||||
} mLocked GUARDED_BY(mLock);
|
} mLocked GUARDED_BY(mLock);
|
||||||
|
|||||||
@@ -136,14 +136,6 @@ void PointerController::move(float deltaX, float deltaY) {
|
|||||||
mCursorController.move(transformed.x, transformed.y);
|
mCursorController.move(transformed.x, transformed.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PointerController::setButtonState(int32_t buttonState) {
|
|
||||||
mCursorController.setButtonState(buttonState);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t PointerController::getButtonState() const {
|
|
||||||
return mCursorController.getButtonState();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PointerController::setPosition(float x, float y) {
|
void PointerController::setPosition(float x, float y) {
|
||||||
const int32_t displayId = mCursorController.getDisplayId();
|
const int32_t displayId = mCursorController.getDisplayId();
|
||||||
vec2 transformed;
|
vec2 transformed;
|
||||||
|
|||||||
@@ -50,21 +50,19 @@ public:
|
|||||||
|
|
||||||
~PointerController() override;
|
~PointerController() override;
|
||||||
|
|
||||||
virtual std::optional<FloatRect> getBounds() const;
|
std::optional<FloatRect> getBounds() const override;
|
||||||
virtual void move(float deltaX, float deltaY);
|
void move(float deltaX, float deltaY) override;
|
||||||
virtual void setButtonState(int32_t buttonState);
|
void setPosition(float x, float y) override;
|
||||||
virtual int32_t getButtonState() const;
|
FloatPoint getPosition() const override;
|
||||||
virtual void setPosition(float x, float y);
|
int32_t getDisplayId() const override;
|
||||||
virtual FloatPoint getPosition() const;
|
void fade(Transition transition) override;
|
||||||
virtual int32_t getDisplayId() const;
|
void unfade(Transition transition) override;
|
||||||
virtual void fade(Transition transition);
|
void setDisplayViewport(const DisplayViewport& viewport) override;
|
||||||
virtual void unfade(Transition transition);
|
|
||||||
virtual void setDisplayViewport(const DisplayViewport& viewport);
|
|
||||||
|
|
||||||
virtual void setPresentation(Presentation presentation);
|
void setPresentation(Presentation presentation) override;
|
||||||
virtual void setSpots(const PointerCoords* spotCoords, const uint32_t* spotIdToIndex,
|
void setSpots(const PointerCoords* spotCoords, const uint32_t* spotIdToIndex,
|
||||||
BitSet32 spotIdBits, int32_t displayId);
|
BitSet32 spotIdBits, int32_t displayId) override;
|
||||||
virtual void clearSpots();
|
void clearSpots() override;
|
||||||
|
|
||||||
void updatePointerIcon(PointerIconStyle iconId);
|
void updatePointerIcon(PointerIconStyle iconId);
|
||||||
void setCustomPointerIcon(const SpriteIcon& icon);
|
void setCustomPointerIcon(const SpriteIcon& icon);
|
||||||
|
|||||||
Reference in New Issue
Block a user