Change code() to glyphID() on SkGlyph.
Change-Id: Id13cd5039df7ff3042858c8c89a2dc629b589d3c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244998 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
parent
8a666d42c6
commit
95ea4c4c9e
@ -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(); }
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user