diff options
author | 2023-08-18 19:44:55 +0000 | |
---|---|---|
committer | 2023-08-18 19:56:15 +0000 | |
commit | 27c6d99600422ee96fcc29de26c2be84c6a9838d (patch) | |
tree | ced5bc81068c3e7ff2b9c0c94afb91a974cbc16a /libs/input/TouchSpotController.cpp | |
parent | bbd57bc5f77c57b6cebd4b1bcab7a8c5430d36bd (diff) |
Use std::shared_ptr for SpriteController
Remove RefBase from SpriteController, and use std::shared_ptr. We cannot
migrate to std::unique_ptr because we have to post messages to the
handler, which needs to have a weak reference to the object.
Bug: 278783893
Test: presubmit
Change-Id: I0ea4bb220e5b1866375ed39335f9035cd4bb766c
Diffstat (limited to 'libs/input/TouchSpotController.cpp')
-rw-r--r-- | libs/input/TouchSpotController.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/input/TouchSpotController.cpp b/libs/input/TouchSpotController.cpp index c212608e4ea5..b8de919fbd8c 100644 --- a/libs/input/TouchSpotController.cpp +++ b/libs/input/TouchSpotController.cpp @@ -98,8 +98,8 @@ void TouchSpotController::setSpots(const PointerCoords* spotCoords, const uint32 #endif std::scoped_lock lock(mLock); - sp<SpriteController> spriteController = mContext.getSpriteController(); - spriteController->openTransaction(); + auto& spriteController = mContext.getSpriteController(); + spriteController.openTransaction(); // Add or move spots for fingers that are down. for (BitSet32 idBits(spotIdBits); !idBits.isEmpty();) { @@ -125,7 +125,7 @@ void TouchSpotController::setSpots(const PointerCoords* spotCoords, const uint32 } } - spriteController->closeTransaction(); + spriteController.closeTransaction(); } void TouchSpotController::clearSpots() { @@ -167,7 +167,7 @@ TouchSpotController::Spot* TouchSpotController::createAndAddSpotLocked(uint32_t sprite = mLocked.recycledSprites.back(); mLocked.recycledSprites.pop_back(); } else { - sprite = mContext.getSpriteController()->createSprite(); + sprite = mContext.getSpriteController().createSprite(); } // Return the new spot. |