DescriptionCreating RectF as member variable to save unnecessary allocation on each invocation of onDraw
When onDraw is called, everytime RectF is created which allocates new object. To compute the rect, it needs to be created only once and re-used every time when onDraw() is called altering its values, else too many RectF objects could affect performance.
This issue is found from below lint warning:
../../../tmp/tmppzTHqO/0/PopupZoomer.java:466 Avoid object allocations during draw/layout operations (preallocate and reuse instead): DrawAllocation [warning]
RectF rect = new RectF();
Bug=None.
Committed: https://crrev.com/fc16325bd1737582a405c84f2fd7355a1a1964d2
Cr-Commit-Position: refs/heads/master@{#294349}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Changes Incorporated #Messages
Total messages: 10 (2 generated)
|