Skip to content

Commit e4c9dd1

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Fix crash with new LookupGammaFontRenderer Bug #6853934"
2 parents 2eeeec2 + 0aa87bb commit e4c9dd1

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

libs/hwui/FontRenderer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,7 @@ void FontRenderer::cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyp
697697
}
698698

699699
CacheTexture* FontRenderer::createCacheTexture(int width, int height, bool allocate) {
700-
uint8_t* textureMemory = NULL;
701-
CacheTexture* cacheTexture = new CacheTexture(textureMemory, width, height);
700+
CacheTexture* cacheTexture = new CacheTexture(width, height);
702701

703702
if (allocate) {
704703
allocateTextureMemory(cacheTexture);

libs/hwui/FontRenderer.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ class FontRenderer;
6161

6262
class CacheTexture {
6363
public:
64-
CacheTexture() { }
65-
CacheTexture(uint8_t* texture, uint16_t width, uint16_t height) :
66-
mTexture(texture), mTextureId(0), mWidth(width), mHeight(height),
64+
CacheTexture(uint16_t width, uint16_t height) :
65+
mTexture(NULL), mTextureId(0), mWidth(width), mHeight(height),
6766
mLinearFiltering(false) { }
6867
~CacheTexture() {
6968
if (mTexture) {

libs/hwui/GammaFontRenderer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class ShaderGammaFontRenderer: public GammaFontRenderer {
5959

6060
void clear() {
6161
delete mRenderer;
62+
mRenderer = NULL;
6263
}
6364

6465
void flush() {

0 commit comments

Comments
 (0)