Limit when Resource#getBitmap can be called
Only call Resource#getBitmap once per onResourceLoaded(), and assert DynamicResource#getBitmap is only called when dirty. This makes it possible to release the local Bitmap copy in BitmapDynamicResource when it is passed to the native side. The only user of BitmapDynamicResource is LayerTitleCache, which releases resources explicitly itself, so this CL doesn't reduce memory usage. However, this should make memory leak less likely for the next user. Bug: 965580 Change-Id: I00c3032f05dbe0cd66881cd99063ed4fb82cb0fa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626992 Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org> Reviewed-by:David Trainor <dtrainor@chromium.org> Cr-Commit-Position: refs/heads/master@{#664378}
Showing
Please register or sign in to comment