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:
parent
ee4519d042
commit
aedc9d2add
@ -102,7 +102,7 @@ public:
|
|||||||
|
|
||||||
size_t runSize() const { return fGlyphIDs.size(); }
|
size_t runSize() const { return fGlyphIDs.size(); }
|
||||||
SkSpan<const SkPoint> positions() const { return fPositions.toConst(); }
|
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; }
|
const SkPaint& paint() const { return fRunPaint; }
|
||||||
SkPaint* mutablePaint() { return &fRunPaint; }
|
SkPaint* mutablePaint() { return &fRunPaint; }
|
||||||
SkSpan<const uint32_t> clusters() const { return fClusters; }
|
SkSpan<const uint32_t> clusters() const { return fClusters; }
|
||||||
|
@ -87,7 +87,7 @@ void SkGlyphRunListPainter::drawUsingPaths(
|
|||||||
const SkGlyphRun& glyphRun, SkPoint origin, SkGlyphCache* cache, PerPath perPath) const {
|
const SkGlyphRun& glyphRun, SkPoint origin, SkGlyphCache* cache, PerPath perPath) const {
|
||||||
|
|
||||||
const SkPoint* positionCursor = glyphRun.positions().data();
|
const SkPoint* positionCursor = glyphRun.positions().data();
|
||||||
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
|
for (auto glyphID : glyphRun.glyphsIDs()) {
|
||||||
SkPoint position = *positionCursor++;
|
SkPoint position = *positionCursor++;
|
||||||
const SkGlyph& glyph = cache->getGlyphIDMetrics(glyphID);
|
const SkGlyph& glyph = cache->getGlyphIDMetrics(glyphID);
|
||||||
if (glyph.fWidth > 0) {
|
if (glyph.fWidth > 0) {
|
||||||
@ -151,7 +151,7 @@ void SkGlyphRunListPainter::drawGlyphRunAsSubpixelMask(
|
|||||||
matrix.mapPoints(fPositions, glyphRun.positions().data(), runSize);
|
matrix.mapPoints(fPositions, glyphRun.positions().data(), runSize);
|
||||||
|
|
||||||
const SkPoint* positionCursor = fPositions;
|
const SkPoint* positionCursor = fPositions;
|
||||||
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
|
for (auto glyphID : glyphRun.glyphsIDs()) {
|
||||||
auto position = *positionCursor++;
|
auto position = *positionCursor++;
|
||||||
if (SkScalarsAreFinite(position.fX, position.fY)) {
|
if (SkScalarsAreFinite(position.fX, position.fY)) {
|
||||||
const SkGlyph& glyph = cache->getGlyphMetrics(glyphID, position);
|
const SkGlyph& glyph = cache->getGlyphMetrics(glyphID, position);
|
||||||
@ -179,7 +179,7 @@ void SkGlyphRunListPainter::drawGlyphRunAsFullpixelMask(
|
|||||||
matrix.mapPoints(fPositions, glyphRun.positions().data(), runSize);
|
matrix.mapPoints(fPositions, glyphRun.positions().data(), runSize);
|
||||||
|
|
||||||
const SkPoint* positionCursor = fPositions;
|
const SkPoint* positionCursor = fPositions;
|
||||||
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
|
for (auto glyphID : glyphRun.glyphsIDs()) {
|
||||||
auto position = *positionCursor++;
|
auto position = *positionCursor++;
|
||||||
if (SkScalarsAreFinite(position.fX, position.fY)) {
|
if (SkScalarsAreFinite(position.fX, position.fY)) {
|
||||||
const SkGlyph& glyph = cache->getGlyphIDMetrics(glyphID);
|
const SkGlyph& glyph = cache->getGlyphIDMetrics(glyphID);
|
||||||
|
@ -141,7 +141,7 @@ void SkGlyphRunListPainter::drawGlyphRunAsPathWithARGBFallback(
|
|||||||
SkScalar maxFallbackDimension{-SK_ScalarInfinity};
|
SkScalar maxFallbackDimension{-SK_ScalarInfinity};
|
||||||
|
|
||||||
const SkPoint* positionCursor = glyphRun.positions().data();
|
const SkPoint* positionCursor = glyphRun.positions().data();
|
||||||
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
|
for (auto glyphID : glyphRun.glyphsIDs()) {
|
||||||
SkPoint position = *positionCursor++;
|
SkPoint position = *positionCursor++;
|
||||||
if (SkScalarsAreFinite(position.x(), position.y())) {
|
if (SkScalarsAreFinite(position.x(), position.y())) {
|
||||||
const SkGlyph& glyph = pathCache->getGlyphMetrics(glyphID, {0, 0});
|
const SkGlyph& glyph = pathCache->getGlyphMetrics(glyphID, {0, 0});
|
||||||
@ -178,7 +178,7 @@ void SkGlyphRunListPainter::drawGlyphRunAsBMPWithPathFallback(
|
|||||||
if (this->ensureBitmapBuffers(runSize)) {
|
if (this->ensureBitmapBuffers(runSize)) {
|
||||||
mapping.mapPoints(fPositions, glyphRun.positions().data(), runSize);
|
mapping.mapPoints(fPositions, glyphRun.positions().data(), runSize);
|
||||||
const SkPoint* mappedPtCursor = fPositions;
|
const SkPoint* mappedPtCursor = fPositions;
|
||||||
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
|
for (auto glyphID : glyphRun.glyphsIDs()) {
|
||||||
auto mappedPt = *mappedPtCursor++;
|
auto mappedPt = *mappedPtCursor++;
|
||||||
if (SkScalarsAreFinite(mappedPt.x(), mappedPt.y())) {
|
if (SkScalarsAreFinite(mappedPt.x(), mappedPt.y())) {
|
||||||
const SkGlyph& glyph = cache->getGlyphMetrics(glyphID, mappedPt);
|
const SkGlyph& glyph = cache->getGlyphMetrics(glyphID, mappedPt);
|
||||||
@ -210,7 +210,7 @@ void SkGlyphRunListPainter::drawGlyphRunAsSDFWithARGBFallback(
|
|||||||
SkScalar maxFallbackDimension{-SK_ScalarInfinity};
|
SkScalar maxFallbackDimension{-SK_ScalarInfinity};
|
||||||
|
|
||||||
const SkPoint* positionCursor = glyphRun.positions().data();
|
const SkPoint* positionCursor = glyphRun.positions().data();
|
||||||
for (auto glyphID : glyphRun.shuntGlyphsIDs()) {
|
for (auto glyphID : glyphRun.glyphsIDs()) {
|
||||||
const SkGlyph& glyph = cache->getGlyphMetrics(glyphID, {0, 0});
|
const SkGlyph& glyph = cache->getGlyphMetrics(glyphID, {0, 0});
|
||||||
SkPoint glyphPos = origin + *positionCursor++;
|
SkPoint glyphPos = origin + *positionCursor++;
|
||||||
if (glyph.fMaskFormat == SkMask::kSDF_Format || glyph.isEmpty()) {
|
if (glyph.fMaskFormat == SkMask::kSDF_Format || glyph.isEmpty()) {
|
||||||
|
@ -28,7 +28,7 @@ static bool is_reversed(const uint32_t* clusters, uint32_t count) {
|
|||||||
SkClusterator::SkClusterator(const SkGlyphRun& run)
|
SkClusterator::SkClusterator(const SkGlyphRun& run)
|
||||||
: fClusters(run.clusters().data())
|
: fClusters(run.clusters().data())
|
||||||
, fUtf8Text(run.text().data())
|
, fUtf8Text(run.text().data())
|
||||||
, fGlyphCount(SkToU32(run.shuntGlyphsIDs().size()))
|
, fGlyphCount(SkToU32(run.glyphsIDs().size()))
|
||||||
, fTextByteLength(SkToU32(run.text().size()))
|
, fTextByteLength(SkToU32(run.text().size()))
|
||||||
{
|
{
|
||||||
if (fClusters) {
|
if (fClusters) {
|
||||||
|
@ -1038,8 +1038,8 @@ void SkPDFDevice::drawGlyphRunAsPath(const SkGlyphRun& glyphRun, SkPoint offset)
|
|||||||
SkPath path;
|
SkPath path;
|
||||||
SkASSERT(paint.getTextEncoding() == SkPaint::kGlyphID_TextEncoding);
|
SkASSERT(paint.getTextEncoding() == SkPaint::kGlyphID_TextEncoding);
|
||||||
|
|
||||||
paint.getPosTextPath(glyphRun.shuntGlyphsIDs().data(),
|
paint.getPosTextPath(glyphRun.glyphsIDs().data(),
|
||||||
glyphRun.shuntGlyphsIDs().size() * sizeof(SkGlyphID),
|
glyphRun.glyphsIDs().size() * sizeof(SkGlyphID),
|
||||||
glyphRun.positions().data(),
|
glyphRun.positions().data(),
|
||||||
&path);
|
&path);
|
||||||
path.offset(offset.x(), offset.y());
|
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) {
|
void SkPDFDevice::internalDrawGlyphRun(const SkGlyphRun& glyphRun, SkPoint offset) {
|
||||||
|
|
||||||
const SkGlyphID* glyphs = glyphRun.shuntGlyphsIDs().data();
|
const SkGlyphID* glyphs = glyphRun.glyphsIDs().data();
|
||||||
uint32_t glyphCount = SkToU32(glyphRun.shuntGlyphsIDs().size());
|
uint32_t glyphCount = SkToU32(glyphRun.glyphsIDs().size());
|
||||||
SkPaint srcPaint{glyphRun.paint()};
|
SkPaint srcPaint{glyphRun.paint()};
|
||||||
srcPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
|
srcPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
|
||||||
srcPaint.setTextAlign(SkPaint::kLeft_Align);
|
srcPaint.setTextAlign(SkPaint::kLeft_Align);
|
||||||
|
@ -872,7 +872,7 @@ public:
|
|||||||
const SkPaint& paint = glyphRun.paint();
|
const SkPaint& paint = glyphRun.paint();
|
||||||
auto runSize = glyphRun.runSize();
|
auto runSize = glyphRun.runSize();
|
||||||
SkAutoSTArray<64, SkUnichar> unichars(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();
|
auto positions = glyphRun.positions();
|
||||||
for (size_t i = 0; i < runSize; ++i) {
|
for (size_t i = 0; i < runSize; ++i) {
|
||||||
this->appendUnichar(unichars[i], positions[i]);
|
this->appendUnichar(unichars[i], positions[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user