hash and encode rework, wip

Convert all bitmaps to a single common format before hashing.
Also, include bitmap dimensions in the hash.

There's no good format supported by Skia / SkPngEncoder to use,
so we do the converison manually to 16-bit big-endian Rec.2020
RGBA and call libpng directly.

This format is just about as far as wide as we can stretch PNG.

I've temporarily bumped PNG compression level to 9.
Expecting zillions of new images, it'll help to keep them small.
I think we can probably turn this knob back down once this settles.

No-Tree-Checks: true
Change-Id: Ia438289731ae06ac129cb2ff658b7940981c6136
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198760
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
1 file changed