diff --git a/src/core/SkGlyph.h b/src/core/SkGlyph.h index 7a1318b335..eef6f60391 100644 --- a/src/core/SkGlyph.h +++ b/src/core/SkGlyph.h @@ -70,7 +70,7 @@ struct SkPackedGlyphID { return this->fID < that.fID; } - uint32_t code() const { + SkGlyphID glyphID() const { return fID & kGlyphIDMask; } @@ -92,7 +92,7 @@ struct SkPackedGlyphID { SkString dump() const { SkString str; - str.appendf("code: %d, x: %d, y:%d", code(), getSubXFixed(), getSubYFixed()); + str.appendf("code: %d, x: %d, y:%d", glyphID(), getSubXFixed(), getSubYFixed()); return str; } @@ -130,7 +130,7 @@ public: SkScalar advanceX() const { return fAdvanceX; } SkScalar advanceY() const { return fAdvanceY; } - SkGlyphID getGlyphID() const { return fID.code(); } + SkGlyphID getGlyphID() const { return fID.glyphID(); } SkPackedGlyphID getPackedID() const { return fID; } SkFixed getSubXFixed() const { return fID.getSubXFixed(); } SkFixed getSubYFixed() const { return fID.getSubYFixed(); } diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index fb783c965f..f2893a2383 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -627,7 +627,7 @@ void SkScalerContext::getFontMetrics(SkFontMetrics* fm) { bool SkScalerContext::internalGetPath(SkPackedGlyphID glyphID, SkPath* devPath) { SkPath path; - if (!generatePath(glyphID.code(), &path)) { + if (!generatePath(glyphID.glyphID(), &path)) { return false; } diff --git a/tests/SkGlyphBufferTest.cpp b/tests/SkGlyphBufferTest.cpp index 4ce50416ce..6840396fac 100644 --- a/tests/SkGlyphBufferTest.cpp +++ b/tests/SkGlyphBufferTest.cpp @@ -105,7 +105,7 @@ DEF_TEST(SkDrawableGlyphBufferBasic, reporter) { for (auto t : SkMakeEnumerate(drawable.input())) { size_t i; SkGlyphVariant packedID; SkPoint pos; std::forward_as_tuple(i, std::tie(packedID, pos)) = t; - REPORTER_ASSERT(reporter, glyphIDs[i] == packedID.packedID().code()); + REPORTER_ASSERT(reporter, glyphIDs[i] == packedID.packedID().glyphID()); REPORTER_ASSERT(reporter, pos.x() == positions[i].x() * 0.5 + 50 + 0.125); REPORTER_ASSERT(reporter, pos.y() == positions[i].y() * 0.5 + 50 + 0.5); } diff --git a/tests/SkRemoteGlyphCacheTest.cpp b/tests/SkRemoteGlyphCacheTest.cpp index 51dd5b57b3..f56a4a36ac 100644 --- a/tests/SkRemoteGlyphCacheTest.cpp +++ b/tests/SkRemoteGlyphCacheTest.cpp @@ -893,7 +893,7 @@ DEF_TEST(SkRemoteGlyphCache_SearchOfDesperation, reporter) { { SkPoint pt{SkFixedToScalar(lostGlyphID.getSubXFixed()), SkFixedToScalar(lostGlyphID.getSubYFixed())}; - SkGlyph* lostGlyph = testCache->glyph(lostGlyphID.code(), pt); + SkGlyph* lostGlyph = testCache->glyph(lostGlyphID.glyphID(), pt); testCache->prepareImage(lostGlyph); REPORTER_ASSERT(reporter, lostGlyph->height() == 1); @@ -906,7 +906,7 @@ DEF_TEST(SkRemoteGlyphCache_SearchOfDesperation, reporter) { { SkPoint pt{SkFixedToScalar(SK_FixedQuarter), SkFixedToScalar(SK_FixedQuarter)}; - SkGlyph* lostGlyph = testCache->glyph(lostGlyphID.code(), pt); + SkGlyph* lostGlyph = testCache->glyph(lostGlyphID.glyphID(), pt); testCache->prepareImage(lostGlyph); REPORTER_ASSERT(reporter, lostGlyph->height() == 1);