Fix crash with new LookupGammaFontRenderer

Bug #6853934

Change-Id: I15e6ca73bfe00eff1a37c4b9d2f7f709ee018eb6
This commit is contained in:
Romain Guy
2012-07-20 11:14:32 -07:00
parent 3a136fc0e8
commit 0aa87bbfc4
3 changed files with 4 additions and 5 deletions

View File

@@ -697,8 +697,7 @@ void FontRenderer::cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyp
}
CacheTexture* FontRenderer::createCacheTexture(int width, int height, bool allocate) {
uint8_t* textureMemory = NULL;
CacheTexture* cacheTexture = new CacheTexture(textureMemory, width, height);
CacheTexture* cacheTexture = new CacheTexture(width, height);
if (allocate) {
allocateTextureMemory(cacheTexture);

View File

@@ -61,9 +61,8 @@ class FontRenderer;
class CacheTexture {
public:
CacheTexture() { }
CacheTexture(uint8_t* texture, uint16_t width, uint16_t height) :
mTexture(texture), mTextureId(0), mWidth(width), mHeight(height),
CacheTexture(uint16_t width, uint16_t height) :
mTexture(NULL), mTextureId(0), mWidth(width), mHeight(height),
mLinearFiltering(false) { }
~CacheTexture() {
if (mTexture) {

View File

@@ -59,6 +59,7 @@ public:
void clear() {
delete mRenderer;
mRenderer = NULL;
}
void flush() {