Fix a couple potential bugs when adding sampler info to a program key

Calling add32 can re-allocate the key storage, so it isn't safe to call
add32n and then keep writing into the returned pointer if an extra
sampler key is encountered.

Also fix the GP sampler key code to actually set the last bit, not the
16th bit.

Change-Id: I9c83435a164ab0391e2e6a9e1a9bdf6839490a15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229278
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
1 file changed