Add field to directly pass glyphs when using glyph encoding

Change-Id: Iad7c9d7a801c961d2c5965012af16659d55a371c
Reviewed-on: https://skia-review.googlesource.com/140340
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2018-07-10 14:41:17 -04:00
parent 4b15dc202f
commit 3c9bfec0d5
2 changed files with 5 additions and 1 deletions

View File

@ -179,6 +179,9 @@ void SkGlyphRunBuilder::addDenseAndUnique(
glyphIDs = (SkGlyphID*)bytes;
}
// TODO: Remove when glyphIds are passed back.
fGlyphIDs = glyphIDs;
SkASSERT(glyphIDs != nullptr);
if (runSize > 0) {
@ -203,7 +206,7 @@ void SkGlyphRunBuilder::makeGlyphRun(
std::move(glyphRunPaint),
SkSpan<const uint16_t>{fDenseIndex},
SkSpan<const SkPoint>{fPositions},
SkSpan<const SkGlyphID>{fScratchGlyphIDs},
SkSpan<const SkGlyphID>{fGlyphIDs, SkTo<ptrdiff_t>(fDenseIndex.size())},
SkSpan<const SkGlyphID>{fUniqueGlyphIDs},
text,
clusters

View File

@ -141,6 +141,7 @@ private:
std::vector<uint16_t> fDenseIndex;
std::vector<SkPoint> fPositions;
std::vector<SkGlyphID> fUniqueGlyphIDs;
SkGlyphID* fGlyphIDs{nullptr};
// Used as a temporary for preparing using utfN text. This implies that only one run of
// glyph ids will ever be needed because blobs are already glyph based.