diff options
Diffstat (limited to 'libs/hwui/font')
-rw-r--r-- | libs/hwui/font/Font.cpp | 16 | ||||
-rw-r--r-- | libs/hwui/font/FontUtil.h | 11 |
2 files changed, 16 insertions, 11 deletions
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp index af39f16..e1a38dd 100644 --- a/libs/hwui/font/Font.cpp +++ b/libs/hwui/font/Font.cpp @@ -139,7 +139,8 @@ void Font::invalidateTextureCache(CacheTexture* cacheTexture) { } void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y, - uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) { + uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, + const float* pos) { int width = (int) glyph->mBitmapWidth; int height = (int) glyph->mBitmapHeight; @@ -161,7 +162,8 @@ void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y, } void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y, - uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) { + uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, + const float* pos) { float width = (float) glyph->mBitmapWidth; float height = (float) glyph->mBitmapHeight; @@ -180,7 +182,8 @@ void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y, } void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y, - uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) { + uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, + const float* pos) { float width = (float) glyph->mBitmapWidth; float height = (float) glyph->mBitmapHeight; @@ -210,7 +213,8 @@ void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y, } void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y, uint8_t* bitmap, - uint32_t bitmapWidth, uint32_t bitmapHeight, Rect* bounds, const float* pos) { + uint32_t bitmapWidth, uint32_t bitmapHeight, Rect* bounds, + const float* pos) { int dstX = x + glyph->mBitmapLeft; int dstY = y + glyph->mBitmapTop; @@ -378,7 +382,7 @@ void Font::precache(const SkPaint* paint, const char* text, int numGlyphs) { break; } - CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph, true); + getCachedGlyph(paint, glyph, true); glyphsCount++; } } @@ -403,8 +407,6 @@ void Font::render(const SkPaint* paint, const char* text, uint32_t start, uint32 text += start; int glyphsCount = 0; - const SkPaint::Align align = paint->getTextAlign(); - while (glyphsCount < numGlyphs) { glyph_t glyph = GET_GLYPH(text); diff --git a/libs/hwui/font/FontUtil.h b/libs/hwui/font/FontUtil.h index c2fd5f5..4e5debe 100644 --- a/libs/hwui/font/FontUtil.h +++ b/libs/hwui/font/FontUtil.h @@ -30,9 +30,12 @@ #define DEFAULT_TEXT_LARGE_CACHE_WIDTH 2048 #define DEFAULT_TEXT_LARGE_CACHE_HEIGHT 512 -#define TEXTURE_BORDER_SIZE 1 -#if TEXTURE_BORDER_SIZE != 1 -# error TEXTURE_BORDER_SIZE other than 1 is not currently supported +#ifdef TEXTURE_BORDER_SIZE + #if TEXTURE_BORDER_SIZE != 1 + #error TEXTURE_BORDER_SIZE other than 1 is not currently supported + #endif +#else + #define TEXTURE_BORDER_SIZE 1 #endif #define CACHE_BLOCK_ROUNDING_SIZE 4 @@ -44,7 +47,7 @@ #define GET_GLYPH(text) nextGlyph((const uint16_t**) &text) #define IS_END_OF_STRING(glyph) false - static glyph_t nextGlyph(const uint16_t** srcPtr) { + static inline glyph_t nextGlyph(const uint16_t** srcPtr) { const uint16_t* src = *srcPtr; glyph_t g = *src++; *srcPtr = src; |