diff options
Diffstat (limited to 'libs/hwui/font/Font.cpp')
-rw-r--r-- | libs/hwui/font/Font.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp index 1d50bd5..b115756 100644 --- a/libs/hwui/font/Font.cpp +++ b/libs/hwui/font/Font.cpp @@ -216,6 +216,7 @@ void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y, uint8_t* PixelBuffer* pixelBuffer = cacheTexture->getPixelBuffer(); uint32_t formatSize = PixelBuffer::formatSize(pixelBuffer->getFormat()); + uint32_t alpha_channel_offset = PixelBuffer::formatAlphaOffset(pixelBuffer->getFormat()); uint32_t cacheWidth = cacheTexture->getWidth(); uint32_t srcStride = formatSize * cacheWidth; uint32_t startY = glyph->mStartY * srcStride; @@ -230,7 +231,7 @@ void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y, uint8_t* memcpy(&bitmap[bitmapY + dstX], &cacheBuffer[cacheY + glyph->mStartX], glyph->mBitmapWidth); } else { for (uint32_t i = 0; i < glyph->mBitmapWidth; ++i) { - bitmap[bitmapY + dstX + i] = cacheBuffer[cacheY + (glyph->mStartX + i)*formatSize]; + bitmap[bitmapY + dstX + i] = cacheBuffer[cacheY + (glyph->mStartX + i)*formatSize + alpha_channel_offset]; } } } |