Cleanup and reorganize GrProgramDesc::Build and key layout

Move all of the processor-specific information into functions, rather
than splitting it between the calling and called code.

Stop putting the size of the key into the key. This was an attempt to
avoid collisions (I assume), but felt odd. Instead, add a few important
bits to more reliably protect against collisions, like # of vertex
attributes, # of child FPs, etc.

Important: Stop calling visitTextureEffects to put fp sampler info in
the key. That function visits the entire fp *tree*, so we were adding
sampler information in large FP trees many times. Instead, just add the
sampler information when the specific fp we're emitting is a texture
effect.

Finally, change addString to appendComment, to make it clear that it
doesn't impact the actual key at all.

Bug: skia:11372
Change-Id: Ibf10db1165b27857e5e5e712db538749b41883a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379736
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
4 files changed