Reduce side effect of dropping the Bitmap cache in ViewResourceAdapter

Before this CL, dropping the Bitmap in ViewResourceAdapter would make
isDirty() return true, which would cause re-drawing the next time
this UI resource is used in the compositor layer. There is another copy
of the Bitmap in native land, so keeping the Java copy for longer than
necessary is wasteful.

This CL allows dropping the Bitmap without affecting isDirty(), so that
we can drop it more frequently without causing re-draws.

Bug: 965580
Change-Id: I41f930b0c034b7f373b4c9868ff29a85372a2074
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1622747
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662813}
4 files changed