hash_t TessellationCache::Description::hash() const { uint32_t hash = JenkinsHashMix(0, type); hash = JenkinsHashMix(hash, aa); hash = JenkinsHashMix(hash, cap); hash = JenkinsHashMix(hash, style); hash = JenkinsHashMix(hash, android::hash_type(strokeWidth)); hash = JenkinsHashMix(hash, android::hash_type(scaleX)); hash = JenkinsHashMix(hash, android::hash_type(scaleY)); hash = JenkinsHashMixBytes(hash, (uint8_t*) &shape, sizeof(Shape)); return JenkinsHashWhiten(hash); }
hash_t PathDescription::hash() const { uint32_t hash = JenkinsHashMix(0, type); hash = JenkinsHashMix(hash, join); hash = JenkinsHashMix(hash, cap); hash = JenkinsHashMix(hash, style); hash = JenkinsHashMix(hash, android::hash_type(miter)); hash = JenkinsHashMix(hash, android::hash_type(strokeWidth)); hash = JenkinsHashMix(hash, android::hash_type(pathEffect)); hash = JenkinsHashMixBytes(hash, (uint8_t*) &shape, sizeof(Shape)); return JenkinsHashWhiten(hash); }
hash_t ShadowText::hash() const { uint32_t hash = JenkinsHashMix(0, glyphCount); hash = JenkinsHashMix(hash, android::hash_type(radius)); hash = JenkinsHashMix(hash, android::hash_type(textSize)); hash = JenkinsHashMix(hash, android::hash_type(typeface)); hash = JenkinsHashMix(hash, flags); hash = JenkinsHashMix(hash, android::hash_type(italicStyle)); hash = JenkinsHashMix(hash, android::hash_type(scaleX)); if (glyphs) { hash = JenkinsHashMixShorts(hash, reinterpret_cast<const uint16_t*>(glyphs), glyphCount); } if (positions) { for (uint32_t i = 0; i < glyphCount * 2; i++) { hash = JenkinsHashMix(hash, android::hash_type(positions[i])); } } return JenkinsHashWhiten(hash); }
hash_t ShadowText::hash() const { uint32_t charCount = len / sizeof(char16_t); uint32_t hash = JenkinsHashMix(0, len); hash = JenkinsHashMix(hash, android::hash_type(radius)); hash = JenkinsHashMix(hash, android::hash_type(textSize)); hash = JenkinsHashMix(hash, android::hash_type(typeface)); hash = JenkinsHashMix(hash, flags); hash = JenkinsHashMix(hash, android::hash_type(italicStyle)); hash = JenkinsHashMix(hash, android::hash_type(scaleX)); if (text) { hash = JenkinsHashMixShorts(hash, text, charCount); } if (positions) { for (uint32_t i = 0; i < charCount * 2; i++) { hash = JenkinsHashMix(hash, android::hash_type(positions[i])); } } return JenkinsHashWhiten(hash); }
hash_t Font::FontDescription::hash() const { uint32_t hash = JenkinsHashMix(0, mFontId); hash = JenkinsHashMix(hash, android::hash_type(mFontSize)); hash = JenkinsHashMix(hash, android::hash_type(mFlags)); hash = JenkinsHashMix(hash, android::hash_type(mItalicStyle)); hash = JenkinsHashMix(hash, android::hash_type(mScaleX)); hash = JenkinsHashMix(hash, android::hash_type(mStyle)); hash = JenkinsHashMix(hash, android::hash_type(mStrokeWidth)); hash = JenkinsHashMix(hash, int(mAntiAliasing)); hash = JenkinsHashMix(hash, android::hash_type(mHinting)); hash = JenkinsHashMix(hash, android::hash_type(mLookupTransform[SkMatrix::kMScaleX])); hash = JenkinsHashMix(hash, android::hash_type(mLookupTransform[SkMatrix::kMScaleY])); return JenkinsHashWhiten(hash); }
uint32_t hash_int(int x) { return JenkinsHashWhiten(JenkinsHashMix(0, x)); }