Simplify persistent cache code, make GLSL easier for tools to access

Using SkWriter32/SkReader32 cleans up the construction and unpacking of
cache entries (I first tried adding a dedicated class to manage this,
but it added too much scaffolding). Importantly, this also externalizes
the GLSL packing/unpacking so that other tools (GLSL inspector, offline
compiler dumps, etc...) can also unpack the cache entries.

For the cache entries that will never be inspected, we can leave their
serialization code in the relevant backend location. Putting the GLSL
(and later SPIR-V) serialization in helpers seems like a good
compromise (given that it doesn't require any backend types).

Change-Id: I9e8ccc458939ae30e18bc67f9161dbffa1648bda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206702
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
3 files changed