summaryrefslogtreecommitdiffstats
path: root/libs/hwui/font/Font.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@android.com>2014-05-19 19:32:38 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-19 19:32:38 +0000
commit3c769ec02b8b82bec4dec2169bf76af58be94a9a (patch)
tree2453a2cad31cbf378ac6884a8db96c3c88443aed /libs/hwui/font/Font.cpp
parentdc0c52f4f592f6b9731939f0031e977a70515d4a (diff)
parent00fabcbeb035fb513293ea01d245002f40b3234f (diff)
downloadframeworks_base-3c769ec02b8b82bec4dec2169bf76af58be94a9a.zip
frameworks_base-3c769ec02b8b82bec4dec2169bf76af58be94a9a.tar.gz
frameworks_base-3c769ec02b8b82bec4dec2169bf76af58be94a9a.tar.bz2
am 00fabcbe: am b1708e9b: Merge "Use alpha channel instead of red in drawCachedGlyphBitmap"
* commit '00fabcbeb035fb513293ea01d245002f40b3234f': Use alpha channel instead of red in drawCachedGlyphBitmap
Diffstat (limited to 'libs/hwui/font/Font.cpp')
-rw-r--r--libs/hwui/font/Font.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp
index d829f58..e69b0cc 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -217,6 +217,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;
@@ -231,7 +232,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];
}
}
}