Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0aa87bbf authored by Romain Guy's avatar Romain Guy
Browse files

Fix crash with new LookupGammaFontRenderer

Bug #6853934

Change-Id: I15e6ca73bfe00eff1a37c4b9d2f7f709ee018eb6
parent 3a136fc0
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);
+2 −3
Original line number Diff line number Diff line
@@ -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) {
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ public:

    void clear() {
        delete mRenderer;
        mRenderer = NULL;
    }

    void flush() {