Handle animations calling onImageAvailable multiple times.
Actually fix the crash by handling the fact that animations can cause onImageAvailable to be called multiple times (previously we thought 1 draw equaled 1 onImageAvailable). Due to someone giving us a way to repo the crash I was able to determine that when a user clicks the toolbar we preform a ripple animation. We take a screenshot (in hardware or software mode), but I had baked in the assumption that onImageAvailable would only be called once per requestDraw(). This is incorrect so instead we now ignore calls after. This more closely replicates the software draw behaviour. A future optimization would be to not request a new bitmap when we are just doing an animation. In my tests we already had a bitmap before the animation that would have worked. Bug: 1185197,1186567,b:170620133 Change-Id: I8ee1adea1057fe7216693a6c6f3cde588fa29d69 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2773198 Auto-Submit: Stephen Nusko <nuskos@chromium.org> Commit-Queue: David Trainor <dtrainor@chromium.org> Reviewed-by:David Trainor <dtrainor@chromium.org> Reviewed-by:
Sami Kyöstilä <skyostil@chromium.org> Cr-Commit-Position: refs/heads/master@{#864687}
Loading
Please register or sign in to comment