Enable generating SkImage with the same uniqueID in SkImageGenerator subclass

Enable reusing uniqueID when instantiating SkImageGenerator subclasses enables
using uniqueID in client code to cache generated bitmaps with no need to keep
the reference to SkImageGenerator.

This is a bug fix for out of memory cause in chromium and 100% CPU usage
described in issue 165750#13:
- cache uses SkImage::uniqueID() to cache decoded bitmaps.
- every animation loop creates new SkImage instances.
- after decoding, bitmap copies are added to cache, filling it up with
duplicates of previous loops frames.

BUG=165750

Blink patch that depends on this:
https://codereview.chromium.org/1925533003/
"High CPU and increased memory usage fix for high-res (GIF, WEBP...) animations."

Review-Url: https://codereview.chromium.org/1928403002
2 files changed