Make fForceBW private.

It is only used by SkScalerContext_DW to communicate with itself.

Change-Id: I2926a31e285368d1825b13e4ec1d597c6ddc7fe1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220257
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2019-06-11 13:48:41 -04:00 committed by Skia Commit-Bot
parent 19e8a7185d
commit cc5dc01824
2 changed files with 8 additions and 5 deletions

View File

@ -203,15 +203,13 @@ public:
int16_t fTop = 0,
fLeft = 0;
// Used by the GDI scaler to track state.
int8_t fForceBW = 0;
// This is a combination of SkMask::Format and SkGlyph state. The SkGlyph can be in one of two
// states, just the advances have been calculated, and all the metrics are available. The
// illegal mask format is used to signal that only the advances are available.
uint8_t fMaskFormat = MASK_FORMAT_UNKNOWN;
private:
friend class SkScalerContext_DW;
// Support horizontal and vertical skipping strike-through / underlines.
// The caller walks the linked list looking for a match. For a horizontal underline,
@ -230,6 +228,9 @@ private:
bool fHasPath{false};
};
// Used by the DirectWrite scaler to track state.
int8_t fForceBW = 0;
// TODO(herb) remove friend statement after SkStrike cleanup.
friend class SkStrike;
SkPackedGlyphID fID;

View File

@ -458,6 +458,8 @@ void SkStrikeServer::SkGlyphCacheState::addGlyph(SkPackedGlyphID glyph, bool asP
pending->push_back(glyph);
}
// No need to write fForceBW because it is a flag private to SkScalerContext_DW, which will never
// be called on the GPU side.
static void writeGlyph(SkGlyph* glyph, Serializer* serializer) {
serializer->write<SkPackedGlyphID>(glyph->getPackedID());
serializer->write<float>(glyph->fAdvanceX);
@ -466,7 +468,6 @@ static void writeGlyph(SkGlyph* glyph, Serializer* serializer) {
serializer->write<uint16_t>(glyph->fHeight);
serializer->write<int16_t>(glyph->fTop);
serializer->write<int16_t>(glyph->fLeft);
serializer->write<int8_t>(glyph->fForceBW);
serializer->write<uint8_t>(glyph->fMaskFormat);
}
@ -703,6 +704,8 @@ SkStrikeClient::~SkStrikeClient() = default;
return false; \
}
// No need to read fForceBW because it is a flag private to SkScalerContext_DW, which will never
// be called on the GPU side.
static bool readGlyph(SkTLazy<SkGlyph>& glyph, Deserializer* deserializer) {
SkPackedGlyphID glyphID;
if (!deserializer->read<SkPackedGlyphID>(&glyphID)) return false;
@ -713,7 +716,6 @@ static bool readGlyph(SkTLazy<SkGlyph>& glyph, Deserializer* deserializer) {
if (!deserializer->read<uint16_t>(&glyph->fHeight)) return false;
if (!deserializer->read<int16_t>(&glyph->fTop)) return false;
if (!deserializer->read<int16_t>(&glyph->fLeft)) return false;
if (!deserializer->read<int8_t>(&glyph->fForceBW)) return false;
if (!deserializer->read<uint8_t>(&glyph->fMaskFormat)) return false;
if (!SkMask::IsValidFormat(glyph->fMaskFormat)) return false;