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

Commit 4c970642 authored by Chet Haase's avatar Chet Haase Committed by Android Git Automerger
Browse files

am e73e5d33: am 42bb0be6: Merge "Glyph cache optimization" into jb-mr1-dev

* commit 'e73e5d33':
  Glyph cache optimization
parents 861e0303 e73e5d33
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -699,7 +699,6 @@ void FontRenderer::flushAllAndInvalidate() {
    }

#if DEBUG_FONT_RENDERER
    ALOGD("FontRenderer: flushAllAndInvalidatel");
    // Erase caches, just as a debugging facility
    if (mCacheTextureSmall && mCacheTextureSmall->mTexture) {
        memset(mCacheTextureSmall->mTexture, 0,
@@ -792,14 +791,12 @@ void FontRenderer::allocateTextureMemory(CacheTexture* cacheTexture) {

void FontRenderer::cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyph,
        uint32_t* retOriginX, uint32_t* retOriginY) {
    checkInit();
    cachedGlyph->mIsValid = false;
    // If the glyph is too tall, don't cache it
    if (mCacheLines.size() == 0 ||
        glyph.fHeight + TEXTURE_BORDER_SIZE * 2 > mCacheLines[mCacheLines.size() - 1]->mMaxHeight) {
        if (mCacheLines.size() != 0) {
    if (glyph.fHeight + TEXTURE_BORDER_SIZE * 2 > mCacheLines[mCacheLines.size() - 1]->mMaxHeight) {
        ALOGE("Font size too large to fit in cache. width, height = %i, %i",
                (int) glyph.fWidth, (int) glyph.fHeight);
        }
        return;
    }