Creating 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. Review URL: https://codereview.chromium.org/549163002 Cr-Commit-Position: refs/heads/master@{#294349}
Showing
Please register or sign in to comment