Remove unused variables

These presented as warnings while compiling on Applie silicone.

Change-Id: Icfcd2b0ad163a8bb429d81354b628ca00b0c1a8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429137
Auto-Submit: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This commit is contained in:
Chris Dalton 2021-07-16 12:17:38 -06:00 committed by Skia Commit-Bot
parent 67b1b2a105
commit 3b7ec0fa0f
4 changed files with 5 additions and 21 deletions

View File

@ -305,14 +305,12 @@ private:
// Only the first block is allowed to have all its nodes in the free list. // Only the first block is allowed to have all its nodes in the free list.
SkASSERT(block->fNodesInUse > 0 || block == &fFirstBlock); SkASSERT(block->fNodesInUse > 0 || block == &fFirstBlock);
SkASSERT((unsigned)block->fNodesInUse < N); SkASSERT((unsigned)block->fNodesInUse < N);
int activeCnt = 0; SkDEBUGCODE(int activeCnt = 0;)
int freeCnt = 0;
for (unsigned int i = 0; i < N; ++i) { for (unsigned int i = 0; i < N; ++i) {
bool free = fFreeList.isInList(block->fNodes + i); bool free = fFreeList.isInList(block->fNodes + i);
bool active = fList.isInList(block->fNodes + i); bool active = fList.isInList(block->fNodes + i);
SkASSERT(free != active); SkASSERT(free != active);
activeCnt += active; SkDEBUGCODE(activeCnt += active;)
freeCnt += free;
} }
SkASSERT(activeCnt == block->fNodesInUse); SkASSERT(activeCnt == block->fNodesInUse);
freeNode = iter.next(); freeNode = iter.next();
@ -326,14 +324,12 @@ private:
Block* block = activeNode->fBlock; Block* block = activeNode->fBlock;
SkASSERT(block->fNodesInUse > 0 && (unsigned)block->fNodesInUse <= N); SkASSERT(block->fNodesInUse > 0 && (unsigned)block->fNodesInUse <= N);
int activeCnt = 0; SkDEBUGCODE(int activeCnt = 0;)
int freeCnt = 0;
for (unsigned int i = 0; i < N; ++i) { for (unsigned int i = 0; i < N; ++i) {
bool free = fFreeList.isInList(block->fNodes + i); bool free = fFreeList.isInList(block->fNodes + i);
bool active = fList.isInList(block->fNodes + i); bool active = fList.isInList(block->fNodes + i);
SkASSERT(free != active); SkASSERT(free != active);
activeCnt += active; SkDEBUGCODE(activeCnt += active;)
freeCnt += free;
} }
SkASSERT(activeCnt == block->fNodesInUse); SkASSERT(activeCnt == block->fNodesInUse);
activeNode = iter.next(); activeNode = iter.next();

View File

@ -895,16 +895,10 @@ int get_glyph_run_intercepts(const SkGlyphRun& glyphRun,
SkStrikeSpec strikeSpec = SkStrikeSpec::MakeWithNoDevice(interceptFont, &interceptPaint); SkStrikeSpec strikeSpec = SkStrikeSpec::MakeWithNoDevice(interceptFont, &interceptPaint);
SkBulkGlyphMetricsAndPaths metricsAndPaths{strikeSpec}; SkBulkGlyphMetricsAndPaths metricsAndPaths{strikeSpec};
SkScalar xOffset = 0;
SkScalar xPos = xOffset;
SkScalar prevAdvance = 0;
const SkPoint* posCursor = glyphRun.positions().begin(); const SkPoint* posCursor = glyphRun.positions().begin();
for (const SkGlyph* glyph : metricsAndPaths.glyphs(glyphRun.glyphsIDs())) { for (const SkGlyph* glyph : metricsAndPaths.glyphs(glyphRun.glyphsIDs())) {
SkPoint pos = *posCursor++; SkPoint pos = *posCursor++;
xPos += prevAdvance * scale;
prevAdvance = glyph->advanceX();
if (glyph->path() != nullptr) { if (glyph->path() != nullptr) {
// The typeface is scaled, so un-scale the bounds to be in the space of the typeface. // The typeface is scaled, so un-scale the bounds to be in the space of the typeface.
// Also ensure the bounds are properly offset by the vertical positioning of the glyph. // Also ensure the bounds are properly offset by the vertical positioning of the glyph.

View File

@ -2045,9 +2045,8 @@ void SkTSect::BinarySearch(SkTSect* sect1,
break; break;
} }
SkTSpan* result2 = sect2->fHead; SkTSpan* result2 = sect2->fHead;
bool found = false;
while (result2) { while (result2) {
found |= closest.find(result1, result2 SkDEBUGPARAMS(intersections)); closest.find(result1, result2 SkDEBUGPARAMS(intersections));
result2 = result2->fNext; result2 = result2->fNext;
} }
} while ((result1 = result1->fNext)); } while ((result1 = result1->fNext));

View File

@ -228,13 +228,8 @@ private:
const RunDef out[], unsigned outCount) { const RunDef out[], unsigned outCount) {
SkFont font; SkFont font;
unsigned glyphCount = 0;
unsigned posCount = 0;
for (unsigned i = 0; i < inCount; ++i) { for (unsigned i = 0; i < inCount; ++i) {
AddRun(font, in[i].count, in[i].pos, SkPoint::Make(in[i].x, in[i].y), builder); AddRun(font, in[i].count, in[i].pos, SkPoint::Make(in[i].x, in[i].y), builder);
glyphCount += in[i].count;
posCount += in[i].count * in[i].pos;
} }
sk_sp<SkTextBlob> blob(builder.make()); sk_sp<SkTextBlob> blob(builder.make());