Allow SkTHash functions to return size_t.

Switching some SkVM code from std::unordered_map to SkTHashMap caused
the -MSRTC bot to barf unexpectedly, but in a way that makes sense in
retrospect.  The code to hash skvm::Builder::Instructions returns size_t
to fit the unordered_map convention, and I forgot to change that to
SkTHashMap's preferred uint32_t.  So we began to implicitly truncate
that size_t to uint32_t on 64-bit machines, one of the potential issues
the -MSRTC bot exists to catch.

This change simply masks any user-provided hash to 32 bits explicitly.
We could alternatively update the Instruction hash code, but I think the
mask here is so cheap (usually notional, zero-cost) that compatibility
with std::unordered_map makes this approach more desirable.

Cq-Include-Trybots: skia.primary:Test-Win2016-MSVC-GCE-CPU-AVX2-x86_64-Debug-All-MSRTC
Change-Id: I0551e7590d5039962e213c6672927bd84e1a0856
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223136
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
1 file changed