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
Loading
Please register or sign in to comment