Swap SkPackedGlyphID bitfields around
Change-Id: Ic286357dc637edf0c8df003422a43252590250f5 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251768 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
parent
9fa8a909dd
commit
c7a8df8b1c
@ -32,9 +32,9 @@ struct SkPackedGlyphID {
|
||||
kSubPixelPosLen = 2u,
|
||||
|
||||
// Bit positions
|
||||
kGlyphID = 0u,
|
||||
kSubPixelY = kGlyphIDLen,
|
||||
kSubPixelX = kGlyphIDLen + kSubPixelPosLen,
|
||||
kSubPixelX = 0u,
|
||||
kGlyphID = kSubPixelPosLen,
|
||||
kSubPixelY = kGlyphIDLen + kSubPixelPosLen,
|
||||
kEndData = kGlyphIDLen + 2 * kSubPixelPosLen,
|
||||
|
||||
// Masks
|
||||
@ -51,9 +51,7 @@ struct SkPackedGlyphID {
|
||||
: fID{(uint32_t)glyphID << kGlyphID} { }
|
||||
|
||||
constexpr SkPackedGlyphID(SkGlyphID glyphID, SkFixed x, SkFixed y)
|
||||
: fID {PackIDXY(glyphID, x, y)} {
|
||||
SkASSERT(fID != kImpossibleID);
|
||||
}
|
||||
: fID {PackIDXY(glyphID, x, y)} { }
|
||||
|
||||
constexpr SkPackedGlyphID(SkGlyphID glyphID, SkIPoint pt)
|
||||
: SkPackedGlyphID(glyphID, pt.fX, pt.fY) { }
|
||||
|
@ -91,7 +91,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, packedID.packedID().value() == glyphIDs[i]);
|
||||
REPORTER_ASSERT(reporter, packedID.packedID().glyphID() == glyphIDs[i]);
|
||||
REPORTER_ASSERT(reporter, pos == positions[i] + SkPoint::Make(100, 100));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user