summaryrefslogtreecommitdiffstats
path: root/libs/hwui/font
diff options
context:
space:
mode:
authorChris Craik <ccraik@android.com>2014-05-19 19:27:52 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-19 19:27:52 +0000
commit00fabcbeb035fb513293ea01d245002f40b3234f (patch)
tree18d5a94677faf88715fc9a40e1ef270ae04dedca /libs/hwui/font
parent7099995be5bfadcb03973d4ae952fd345bae264b (diff)
parentb1708e9b764268a06d91219a5c39ee9efd32ab00 (diff)
downloadframeworks_base-00fabcbeb035fb513293ea01d245002f40b3234f.zip
frameworks_base-00fabcbeb035fb513293ea01d245002f40b3234f.tar.gz
frameworks_base-00fabcbeb035fb513293ea01d245002f40b3234f.tar.bz2
am b1708e9b: Merge "Use alpha channel instead of red in drawCachedGlyphBitmap"
* commit 'b1708e9b764268a06d91219a5c39ee9efd32ab00': Use alpha channel instead of red in drawCachedGlyphBitmap
Diffstat (limited to 'libs/hwui/font')
-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 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];
}
}
}