canvas2d: Manage lifetime of SharedImage resource for StaticBitmapImage.

The StaticBitmapImage holds a reference to the SharedImage's mailbox
used by a canvas2d instance. Use a callback which wraps the
CanvasResource that owns this SharedImage to both ensure that the
SharedImage stays alive for the lifetime of the StaticBitmapImage and
the resource is recycled once all refs to the StaticBitmapImage have
been released.,

Bug: 948133
Change-Id: Ibc6f578fd8656a90b32a0267511d723f20cf745e
Commit-Queue: Khushal <>
Auto-Submit: Khushal <>
Reviewed-by: Kenneth Russell <>
Reviewed-by: Antoine Labour <>
Cr-Commit-Position: refs/heads/master@{#660271}
7 files changed