@@ -699,7 +699,6 @@ void FontRenderer::flushAllAndInvalidate() {
699699 }
700700
701701#if DEBUG_FONT_RENDERER
702- ALOGD (" FontRenderer: flushAllAndInvalidatel" );
703702 // Erase caches, just as a debugging facility
704703 if (mCacheTextureSmall && mCacheTextureSmall ->mTexture ) {
705704 memset (mCacheTextureSmall ->mTexture , 0 ,
@@ -792,14 +791,12 @@ void FontRenderer::allocateTextureMemory(CacheTexture* cacheTexture) {
792791
793792void FontRenderer::cacheBitmap (const SkGlyph& glyph, CachedGlyphInfo* cachedGlyph,
794793 uint32_t * retOriginX, uint32_t * retOriginY) {
794+ checkInit ();
795795 cachedGlyph->mIsValid = false ;
796796 // If the glyph is too tall, don't cache it
797- if (mCacheLines .size () == 0 ||
798- glyph.fHeight + TEXTURE_BORDER_SIZE * 2 > mCacheLines [mCacheLines .size () - 1 ]->mMaxHeight ) {
799- if (mCacheLines .size () != 0 ) {
800- ALOGE (" Font size too large to fit in cache. width, height = %i, %i" ,
801- (int ) glyph.fWidth , (int ) glyph.fHeight );
802- }
797+ if (glyph.fHeight + TEXTURE_BORDER_SIZE * 2 > mCacheLines [mCacheLines .size () - 1 ]->mMaxHeight ) {
798+ ALOGE (" Font size too large to fit in cache. width, height = %i, %i" ,
799+ (int ) glyph.fWidth , (int ) glyph.fHeight );
803800 return ;
804801 }
805802
0 commit comments