Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36b73a89 authored by Derek Sollenberger's avatar Derek Sollenberger
Browse files

Update legacy font renderer to use the updated method names from Skia

Test: hwui_unit_tests
Change-Id: Ie7c823a135f17b851dbf7d3305f3f12591e93daf
parent 3fe18d9c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -276,8 +276,8 @@ CachedGlyphInfo* Font::getCachedGlyph(const SkPaint* paint, glyph_t textUnit, bo
            SkSurfaceProps surfaceProps(0, kUnknown_SkPixelGeometry);
            SkAutoGlyphCacheNoGamma autoCache(*paint, &surfaceProps,
                                              &mDescription.mLookupTransform);
            const SkGlyph& skiaGlyph = GET_METRICS(autoCache.getCache(), textUnit);
            updateGlyphCache(paint, skiaGlyph, autoCache.getCache(), cachedGlyph, precaching);
            const SkGlyph& skiaGlyph = GET_METRICS(autoCache.get(), textUnit);
            updateGlyphCache(paint, skiaGlyph, autoCache.get(), cachedGlyph, precaching);
        }
    } else {
        cachedGlyph = cacheGlyph(paint, textUnit, precaching);
@@ -464,11 +464,11 @@ CachedGlyphInfo* Font::cacheGlyph(const SkPaint* paint, glyph_t glyph, bool prec

    SkSurfaceProps surfaceProps(0, kUnknown_SkPixelGeometry);
    SkAutoGlyphCacheNoGamma autoCache(*paint, &surfaceProps, &mDescription.mLookupTransform);
    const SkGlyph& skiaGlyph = GET_METRICS(autoCache.getCache(), glyph);
    const SkGlyph& skiaGlyph = GET_METRICS(autoCache.get(), glyph);
    newGlyph->mIsValid = false;
    newGlyph->mGlyphIndex = skiaGlyph.fID;

    updateGlyphCache(paint, skiaGlyph, autoCache.getCache(), newGlyph, precaching);
    updateGlyphCache(paint, skiaGlyph, autoCache.get(), newGlyph, precaching);

    return newGlyph;
}
+2 −2
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ void TestUtils::layoutTextUnscaled(const SkPaint& paint, const char* text,
        int32_t unichar = utf32_from_utf8_at(text, 4, 0, &nextIndex);
        text += nextIndex;

        glyph_t glyph = autoCache.getCache()->unicharToGlyph(unichar);
        glyph_t glyph = autoCache.get()->unicharToGlyph(unichar);
        autoCache.getCache()->unicharToGlyph(unichar);

        // push glyph and its relative position
@@ -105,7 +105,7 @@ void TestUtils::layoutTextUnscaled(const SkPaint& paint, const char* text,
        outPositions->push_back(0);

        // compute bounds
        SkGlyph skGlyph = autoCache.getCache()->getUnicharMetrics(unichar);
        SkGlyph skGlyph = autoCache.get()->getUnicharMetrics(unichar);
        Rect glyphBounds(skGlyph.fWidth, skGlyph.fHeight);
        glyphBounds.translate(totalAdvance + skGlyph.fLeft, skGlyph.fTop);
        bounds.unionWith(glyphBounds);