Remove all uses of getCache with get.

Holding off on removing definition until android cleans
up its code.

Change-Id: I19cce13d6d1f10f172770a926966761686bc7d6a
Reviewed-on: https://skia-review.googlesource.com/113168
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2018-03-09 10:15:52 -05:00 committed by Skia Commit-Bot
parent 03cd6e6dec
commit c2ef4ab423
6 changed files with 13 additions and 13 deletions

View File

@ -47,7 +47,7 @@ private:
void onDelayedSetup() override { void onDelayedSetup() override {
SkPaint defaultPaint; SkPaint defaultPaint;
SkAutoGlyphCache agc(defaultPaint, nullptr, &SkMatrix::I()); SkAutoGlyphCache agc(defaultPaint, nullptr, &SkMatrix::I());
SkGlyphCache* cache = agc.getCache(); SkGlyphCache* cache = agc.get();
for (int i = 0; i < kNumGlyphs; ++i) { for (int i = 0; i < kNumGlyphs; ++i) {
SkGlyphID id = cache->unicharToGlyph(kGlyphs[i]); SkGlyphID id = cache->unicharToGlyph(kGlyphs[i]);
cache->getScalerContext()->getPath(SkPackedGlyphID(id), &fGlyphs[i]); cache->getScalerContext()->getPath(SkPackedGlyphID(id), &fGlyphs[i]);

View File

@ -21,7 +21,7 @@ static void do_font_stuff(SkPaint* paint) {
for (SkScalar i = 8; i < 64; i++) { for (SkScalar i = 8; i < 64; i++) {
paint->setTextSize(i); paint->setTextSize(i);
SkAutoGlyphCacheNoGamma autoCache(*paint, nullptr, nullptr); SkAutoGlyphCacheNoGamma autoCache(*paint, nullptr, nullptr);
SkGlyphCache* cache = autoCache.getCache(); SkGlyphCache* cache = autoCache.get();
uint16_t glyphs['z']; uint16_t glyphs['z'];
for (int c = ' '; c < 'z'; c++) { for (int c = ' '; c < 'z'; c++) {
glyphs[c] = cache->unicharToGlyph(c); glyphs[c] = cache->unicharToGlyph(c);

View File

@ -25,7 +25,7 @@ public:
PathText() { PathText() {
SkPaint defaultPaint; SkPaint defaultPaint;
SkAutoGlyphCache agc(defaultPaint, nullptr, &SkMatrix::I()); SkAutoGlyphCache agc(defaultPaint, nullptr, &SkMatrix::I());
SkGlyphCache* cache = agc.getCache(); SkGlyphCache* cache = agc.get();
SkPath glyphPaths[52]; SkPath glyphPaths[52];
for (int i = 0; i < 52; ++i) { for (int i = 0; i < 52; ++i) {
// I and l are rects on OS X ... // I and l are rects on OS X ...

View File

@ -431,7 +431,7 @@ int SkPaint::textToGlyphs(const void* textData, size_t byteLength, uint16_t glyp
} }
SkAutoGlyphCache autoCache(*this, nullptr, nullptr); SkAutoGlyphCache autoCache(*this, nullptr, nullptr);
SkGlyphCache* cache = autoCache.getCache(); SkGlyphCache* cache = autoCache.get();
const char* text = (const char*)textData; const char* text = (const char*)textData;
const char* stop = text + byteLength; const char* stop = text + byteLength;
@ -489,7 +489,7 @@ bool SkPaint::containsText(const void* textData, size_t byteLength) const {
} }
SkAutoGlyphCache autoCache(*this, nullptr, nullptr); SkAutoGlyphCache autoCache(*this, nullptr, nullptr);
SkGlyphCache* cache = autoCache.getCache(); SkGlyphCache* cache = autoCache.get();
switch (this->getTextEncoding()) { switch (this->getTextEncoding()) {
case SkPaint::kUTF8_TextEncoding: { case SkPaint::kUTF8_TextEncoding: {
@ -539,7 +539,7 @@ void SkPaint::glyphsToUnichars(const uint16_t glyphs[], int count, SkUnichar tex
SkSurfaceProps props(0, kUnknown_SkPixelGeometry); SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
SkAutoGlyphCache autoCache(*this, &props, nullptr); SkAutoGlyphCache autoCache(*this, &props, nullptr);
SkGlyphCache* cache = autoCache.getCache(); SkGlyphCache* cache = autoCache.get();
for (int index = 0; index < count; index++) { for (int index = 0; index < count; index++) {
textData[index] = cache->glyphToUnichar(glyphs[index]); textData[index] = cache->glyphToUnichar(glyphs[index]);
@ -805,7 +805,7 @@ SkScalar SkPaint::measureText(const void* textData, size_t length, SkRect* bound
SkScalar scale = canon.getScale(); SkScalar scale = canon.getScale();
SkAutoGlyphCache autoCache(paint, nullptr, nullptr); SkAutoGlyphCache autoCache(paint, nullptr, nullptr);
SkGlyphCache* cache = autoCache.getCache(); SkGlyphCache* cache = autoCache.get();
SkScalar width = 0; SkScalar width = 0;
@ -859,7 +859,7 @@ size_t SkPaint::breakText(const void* textD, size_t length, SkScalar maxWidth,
} }
SkAutoGlyphCache autoCache(paint, nullptr, nullptr); SkAutoGlyphCache autoCache(paint, nullptr, nullptr);
SkGlyphCache* cache = autoCache.getCache(); SkGlyphCache* cache = autoCache.get();
GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(paint.getTextEncoding(), GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(paint.getTextEncoding(),
paint.isDevKernText(), paint.isDevKernText(),
@ -965,7 +965,7 @@ int SkPaint::getTextWidths(const void* textData, size_t byteLength,
SkScalar scale = canon.getScale(); SkScalar scale = canon.getScale();
SkAutoGlyphCache autoCache(paint, nullptr, nullptr); SkAutoGlyphCache autoCache(paint, nullptr, nullptr);
SkGlyphCache* cache = autoCache.getCache(); SkGlyphCache* cache = autoCache.get();
GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(paint.getTextEncoding(), GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(paint.getTextEncoding(),
paint.isDevKernText(), paint.isDevKernText(),
nullptr != bounds); nullptr != bounds);

View File

@ -505,7 +505,7 @@ void GrAtlasTextContext::DrawBmpPosTextAsPaths(GrAtlasTextBlob* blob, int runInd
pathPaint.isDevKernText(), pathPaint.isDevKernText(),
true); true);
SkAutoGlyphCache autoCache(pathPaint, &props, nullptr); SkAutoGlyphCache autoCache(pathPaint, &props, nullptr);
SkGlyphCache* cache = autoCache.getCache(); SkGlyphCache* cache = autoCache.get();
const char* stop = text + byteLength; const char* stop = text + byteLength;
const char* lastText = text; const char* lastText = text;

View File

@ -1877,7 +1877,7 @@ HRESULT SkXPSDevice::CreateTypefaceUse(const SkPaint& paint,
newTypefaceUse.xpsFont = xpsFontResource.release(); newTypefaceUse.xpsFont = xpsFontResource.release();
SkAutoGlyphCache agc(paint, &this->surfaceProps(), &SkMatrix::I()); SkAutoGlyphCache agc(paint, &this->surfaceProps(), &SkMatrix::I());
SkGlyphCache* glyphCache = agc.getCache(); SkGlyphCache* glyphCache = agc.get();
unsigned int glyphCount = glyphCache->getGlyphCount(); unsigned int glyphCount = glyphCache->getGlyphCount();
newTypefaceUse.glyphsUsed = new SkBitSet(glyphCount); newTypefaceUse.glyphsUsed = new SkBitSet(glyphCount);
@ -2064,7 +2064,7 @@ void SkXPSDevice::drawText(const void* text, size_t byteLen,
const SkMatrix& matrix = SkMatrix::I(); const SkMatrix& matrix = SkMatrix::I();
SkAutoGlyphCache autoCache(paint, &this->surfaceProps(), &matrix); SkAutoGlyphCache autoCache(paint, &this->surfaceProps(), &matrix);
SkGlyphCache* cache = autoCache.getCache(); SkGlyphCache* cache = autoCache.get();
// Advance width and offsets for glyphs measured in hundredths of the font em size // Advance width and offsets for glyphs measured in hundredths of the font em size
// (XPS Spec 5.1.3). // (XPS Spec 5.1.3).
@ -2122,7 +2122,7 @@ void SkXPSDevice::drawPosText(const void* text, size_t byteLen,
const SkMatrix& matrix = SkMatrix::I(); const SkMatrix& matrix = SkMatrix::I();
SkAutoGlyphCache autoCache(paint, &this->surfaceProps(), &matrix); SkAutoGlyphCache autoCache(paint, &this->surfaceProps(), &matrix);
SkGlyphCache* cache = autoCache.getCache(); SkGlyphCache* cache = autoCache.get();
// Advance width and offsets for glyphs measured in hundredths of the font em size // Advance width and offsets for glyphs measured in hundredths of the font em size
// (XPS Spec 5.1.3). // (XPS Spec 5.1.3).