Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c8c41e48 authored by Abdelrahman Awadalla's avatar Abdelrahman Awadalla
Browse files

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
parent a8a1fbb0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment