Rename shuntGlyphIDs to glyphIDs

This is no longer temporary. glyphIDs are the
wave of the future.

Change-Id: I161367a989c409d96791c554bdb88cdce110bf2b
Reviewed-on: https://skia-review.googlesource.com/c/165022
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2018-10-25 12:27:07 -04:00 committed by Skia Commit-Bot
parent ee4519d042
commit aedc9d2add
6 changed files with 13 additions and 13 deletions

View File

@ -102,7 +102,7 @@ public:
size_t runSize() const { return fGlyphIDs.size(); }
SkSpan<const SkPoint> positions() const { return fPositions.toConst(); }
SkSpan<const SkGlyphID> shuntGlyphsIDs() const { return fGlyphIDs; }
SkSpan<const SkGlyphID> glyphsIDs() const { return fGlyphIDs; }
const SkPaint& paint() const { return fRunPaint; }
SkPaint* mutablePaint() { return &fRunPaint; }
SkSpan<const uint32_t> clusters() const { return fClusters; }

View File

@ -87,7 +87,7 @@ void SkGlyphRunListPainter::drawUsingPaths(
const SkGlyphRun& glyphRun, SkPoint origin, SkGlyphCache* cache, PerPath perPath) const {
const SkPoint* positionCursor = glyphRun.positions().data();
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
for (auto glyphID : glyphRun.glyphsIDs()) {
SkPoint position = *positionCursor++;
const SkGlyph& glyph = cache->getGlyphIDMetrics(glyphID);
if (glyph.fWidth > 0) {
@ -151,7 +151,7 @@ void SkGlyphRunListPainter::drawGlyphRunAsSubpixelMask(
matrix.mapPoints(fPositions, glyphRun.positions().data(), runSize);
const SkPoint* positionCursor = fPositions;
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
for (auto glyphID : glyphRun.glyphsIDs()) {
auto position = *positionCursor++;
if (SkScalarsAreFinite(position.fX, position.fY)) {
const SkGlyph& glyph = cache->getGlyphMetrics(glyphID, position);
@ -179,7 +179,7 @@ void SkGlyphRunListPainter::drawGlyphRunAsFullpixelMask(
matrix.mapPoints(fPositions, glyphRun.positions().data(), runSize);
const SkPoint* positionCursor = fPositions;
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
for (auto glyphID : glyphRun.glyphsIDs()) {
auto position = *positionCursor++;
if (SkScalarsAreFinite(position.fX, position.fY)) {
const SkGlyph& glyph = cache->getGlyphIDMetrics(glyphID);

View File

@ -141,7 +141,7 @@ void SkGlyphRunListPainter::drawGlyphRunAsPathWithARGBFallback(
SkScalar maxFallbackDimension{-SK_ScalarInfinity};
const SkPoint* positionCursor = glyphRun.positions().data();
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
for (auto glyphID : glyphRun.glyphsIDs()) {
SkPoint position = *positionCursor++;
if (SkScalarsAreFinite(position.x(), position.y())) {
const SkGlyph& glyph = pathCache->getGlyphMetrics(glyphID, {0, 0});
@ -178,7 +178,7 @@ void SkGlyphRunListPainter::drawGlyphRunAsBMPWithPathFallback(
if (this->ensureBitmapBuffers(runSize)) {
mapping.mapPoints(fPositions, glyphRun.positions().data(), runSize);
const SkPoint* mappedPtCursor = fPositions;
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
for (auto glyphID : glyphRun.glyphsIDs()) {
auto mappedPt = *mappedPtCursor++;
if (SkScalarsAreFinite(mappedPt.x(), mappedPt.y())) {
const SkGlyph& glyph = cache->getGlyphMetrics(glyphID, mappedPt);
@ -210,7 +210,7 @@ void SkGlyphRunListPainter::drawGlyphRunAsSDFWithARGBFallback(
SkScalar maxFallbackDimension{-SK_ScalarInfinity};
const SkPoint* positionCursor = glyphRun.positions().data();
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
for (auto glyphID : glyphRun.glyphsIDs()) {
const SkGlyph& glyph = cache->getGlyphMetrics(glyphID, {0, 0});
SkPoint glyphPos = origin + *positionCursor++;
if (glyph.fMaskFormat == SkMask::kSDF_Format || glyph.isEmpty()) {

View File

@ -28,7 +28,7 @@ static bool is_reversed(const uint32_t* clusters, uint32_t count) {
SkClusterator::SkClusterator(const SkGlyphRun& run)
: fClusters(run.clusters().data())
, fUtf8Text(run.text().data())
, fGlyphCount(SkToU32(run.shuntGlyphsIDs().size()))
, fGlyphCount(SkToU32(run.glyphsIDs().size()))
, fTextByteLength(SkToU32(run.text().size()))
{
if (fClusters) {

View File

@ -1038,8 +1038,8 @@ void SkPDFDevice::drawGlyphRunAsPath(const SkGlyphRun& glyphRun, SkPoint offset)
SkPath path;
SkASSERT(paint.getTextEncoding() == SkPaint::kGlyphID_TextEncoding);
paint.getPosTextPath(glyphRun.shuntGlyphsIDs().data(),
glyphRun.shuntGlyphsIDs().size() * sizeof(SkGlyphID),
paint.getPosTextPath(glyphRun.glyphsIDs().data(),
glyphRun.glyphsIDs().size() * sizeof(SkGlyphID),
glyphRun.positions().data(),
&path);
path.offset(offset.x(), offset.y());
@ -1088,8 +1088,8 @@ static bool needs_new_font(SkPDFFont* font, SkGlyphID gid, SkGlyphCache* cache,
void SkPDFDevice::internalDrawGlyphRun(const SkGlyphRun& glyphRun, SkPoint offset) {
const SkGlyphID* glyphs = glyphRun.shuntGlyphsIDs().data();
uint32_t glyphCount = SkToU32(glyphRun.shuntGlyphsIDs().size());
const SkGlyphID* glyphs = glyphRun.glyphsIDs().data();
uint32_t glyphCount = SkToU32(glyphRun.glyphsIDs().size());
SkPaint srcPaint{glyphRun.paint()};
srcPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
srcPaint.setTextAlign(SkPaint::kLeft_Align);

View File

@ -872,7 +872,7 @@ public:
const SkPaint& paint = glyphRun.paint();
auto runSize = glyphRun.runSize();
SkAutoSTArray<64, SkUnichar> unichars(runSize);
paint.glyphsToUnichars(glyphRun.shuntGlyphsIDs().data(), runSize, unichars.get());
paint.glyphsToUnichars(glyphRun.glyphsIDs().data(), runSize, unichars.get());
auto positions = glyphRun.positions();
for (size_t i = 0; i < runSize; ++i) {
this->appendUnichar(unichars[i], positions[i]);