diff options
author | Jun Tian <jun.j.tian@intel.com> | 2012-09-11 10:36:28 +0800 |
---|---|---|
committer | Jun Tian <jun.j.tian@intel.com> | 2012-09-11 10:36:28 +0800 |
commit | ee309635d23fa6a9b17be7b1d85dcb8ad065d6c8 (patch) | |
tree | a9aad94d07f80d705f466d3ce4c379be9a2ed0c2 /libs | |
parent | bfe1ab825731d365fef169deab646d7ceeafc998 (diff) | |
download | frameworks_base-ee309635d23fa6a9b17be7b1d85dcb8ad065d6c8.zip frameworks_base-ee309635d23fa6a9b17be7b1d85dcb8ad065d6c8.tar.gz frameworks_base-ee309635d23fa6a9b17be7b1d85dcb8ad065d6c8.tar.bz2 |
Fix CacheBitmap crash issue when using H/W UI rendering
Avoid to access invalid index in CacheBitmap. That will cause the android SDK image cannot be booted up
with H/W GL enabling. This patch is required by both ARM and x86 SDK system image.
Change-Id: I705b7f06915a2338a2f94509486344bfd92b4bfb
Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Signed-off-by: Jackie Wu <jackie.wu@intel.com>
Signed-off-by: Liang Chen <liang.l.chen@intel.com>
Signed-off-by: Panfeng Chang <panfengx.chang@intel.com>
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/FontRenderer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp index 5fdbc11..b51b1e1 100644 --- a/libs/hwui/FontRenderer.cpp +++ b/libs/hwui/FontRenderer.cpp @@ -617,7 +617,7 @@ void FontRenderer::cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyp uint32_t* retOriginX, uint32_t* retOriginY) { cachedGlyph->mIsValid = false; // If the glyph is too tall, don't cache it - if (glyph.fHeight + TEXTURE_BORDER_SIZE > mCacheLines[mCacheLines.size() - 1]->mMaxHeight) { + if (mCacheLines.size() != 0 && (glyph.fHeight + TEXTURE_BORDER_SIZE > mCacheLines[mCacheLines.size() - 1]->mMaxHeight)) { ALOGE("Font size to large to fit in cache. width, height = %i, %i", (int) glyph.fWidth, (int) glyph.fHeight); return; |