Specialized character type constructors to improve ShapeCache hashing

This allows to avoid copying text runs character-per-character
for 16bits text.

Also there is no need to hash per character, just hash the
whole string in one go. This also helps to save the construction
of a StringHasher object (as we use the static method to hash
the strings).

Bug: 735674
Change-Id: I5221ea9722970f4d977924ad3183fa73097c4184
Reviewed-on: https://chromium-review.googlesource.com/604215
Reviewed-by: Emil A Eklund <[email protected]>
Commit-Queue: Adenilson Cavalcanti <[email protected]>
Cr-Commit-Position: refs/heads/master@{#493152}
3 files changed