summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Abdelrahman Awadalla <blobou@google.com> 2024-09-19 14:43:39 +0000
committer Abdelrahman Awadalla <blobou@google.com> 2024-09-23 16:51:02 +0000
commitc8c41e4868e42cf9a64d0a86376fe2301800f6a6 (patch)
tree8e6eaee16213a54cd6c630e75eae9cd9bb96375b /libs/androidfw/StringPool.cpp
parenta8a1fbb05c15e4c53338bdd6acec7a143a3f1464 (diff)
An optimization for Pointer Location for drawing the trace
In the past, the history of the X and Y coordinates was stored in two arrays which had initial sizes of 32 each and whenever a new pointer event is received it stores that into the first empty slot in the array. But, whenever it reaches the end of the array it starts to double the size of it and copy the data to the doubled size array, giving a indefinite space complexity to that algorithm. It was also noticed that after some time the device goes laggy and the Pointer Location is so delayed. This is an optimization to change the space complexity from indefinite to O(1) by doing a bitmap of the size of the device's screen and draw the trace on it. Whenever a new pointer event is send it will draw a line from the last X and Y coordinates to the current ones and save it in that bitmap. Test: Build Test: Presubmit checks Bug: 283195699 Flag: EXEMPT bugfix Change-Id: I6a5c5953ef80537e7066396e085cb15ad67f33b7
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions