@@ -31,15 +31,15 @@ namespace uirenderer {
3131 * order, except for the final block (the remainder space at the right, since we fill from the
3232 * left).
3333 */
34- CacheBlock* CacheBlock::insertBlock (CacheBlock* head, CacheBlock * newBlock) {
34+ CacheBlock* CacheBlock::insertBlock (CacheBlock* head, CacheBlock* newBlock) {
3535#if DEBUG_FONT_RENDERER
3636 ALOGD (" insertBlock: this, x, y, w, h = %p, %d, %d, %d, %d" ,
3737 newBlock, newBlock->mX , newBlock->mY ,
3838 newBlock->mWidth , newBlock->mHeight );
3939#endif
4040
41- CacheBlock * currBlock = head;
42- CacheBlock * prevBlock = NULL ;
41+ CacheBlock* currBlock = head;
42+ CacheBlock* prevBlock = NULL ;
4343
4444 while (currBlock && currBlock->mY != TEXTURE_BORDER_SIZE) {
4545 if (newBlock->mWidth < currBlock->mWidth ) {
@@ -75,7 +75,7 @@ CacheBlock* CacheBlock::insertBlock(CacheBlock* head, CacheBlock *newBlock) {
7575 }
7676}
7777
78- CacheBlock* CacheBlock::removeBlock (CacheBlock* head, CacheBlock * blockToRemove) {
78+ CacheBlock* CacheBlock::removeBlock (CacheBlock* head, CacheBlock* blockToRemove) {
7979#if DEBUG_FONT_RENDERER
8080 ALOGD (" removeBlock: this, x, y, w, h = %p, %d, %d, %d, %d" ,
8181 blockToRemove, blockToRemove->mX , blockToRemove->mY ,
@@ -105,8 +105,8 @@ CacheBlock* CacheBlock::removeBlock(CacheBlock* head, CacheBlock *blockToRemove)
105105// CacheTexture
106106// /////////////////////////////////////////////////////////////////////////////
107107
108- bool CacheTexture::fitBitmap (const SkGlyph& glyph, uint32_t * retOriginX, uint32_t * retOriginY) {
109- if (glyph.fHeight + TEXTURE_BORDER_SIZE > mHeight ) {
108+ bool CacheTexture::fitBitmap (const SkGlyph& glyph, uint32_t * retOriginX, uint32_t * retOriginY) {
109+ if (glyph.fHeight + TEXTURE_BORDER_SIZE * 2 > mHeight ) {
110110 return false ;
111111 }
112112
@@ -117,10 +117,9 @@ bool CacheTexture::fitBitmap(const SkGlyph& glyph, uint32_t *retOriginX, uint32_
117117 // This columns for glyphs that are close but not necessarily exactly the same size. It trades
118118 // off the loss of a few pixels for some glyphs against the ability to store more glyphs
119119 // of varying sizes in one block.
120- uint16_t roundedUpW =
121- (glyphW + CACHE_BLOCK_ROUNDING_SIZE - 1 ) & -CACHE_BLOCK_ROUNDING_SIZE;
120+ uint16_t roundedUpW = (glyphW + CACHE_BLOCK_ROUNDING_SIZE - 1 ) & -CACHE_BLOCK_ROUNDING_SIZE;
122121
123- CacheBlock * cacheBlock = mCacheBlocks ;
122+ CacheBlock* cacheBlock = mCacheBlocks ;
124123 while (cacheBlock) {
125124 // Store glyph in this block iff: it fits the block's remaining space and:
126125 // it's the remainder space (mY == 0) or there's only enough height for this one glyph
@@ -146,7 +145,7 @@ bool CacheTexture::fitBitmap(const SkGlyph& glyph, uint32_t *retOriginX, uint32_
146145
147146 if (mHeight - glyphH >= glyphH) {
148147 // There's enough height left over to create a new CacheBlock
149- CacheBlock * newBlock = new CacheBlock (oldX, glyphH + TEXTURE_BORDER_SIZE,
148+ CacheBlock* newBlock = new CacheBlock (oldX, glyphH + TEXTURE_BORDER_SIZE,
150149 roundedUpW, mHeight - glyphH - TEXTURE_BORDER_SIZE);
151150#if DEBUG_FONT_RENDERER
152151 ALOGD (" fitBitmap: Created new block: this, x, y, w, h = %p, %d, %d, %d, %d" ,
0 commit comments