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

Commit 1de1083e authored by Romain Guy's avatar Romain Guy
Browse files

Initialize font texture cache.

Now that text is renderer using bilinear filtering, each character is surrounded by
a 1 pixel border. This border needs to be initialized to a transparent value.

Change-Id: I26d3195db4bd576ac1f2da4c8f8e4dd18768bf12
parent 7afbb30d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -426,6 +426,8 @@ bool FontRenderer::cacheBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint3

void FontRenderer::initTextTexture() {
    mTextTexture = new uint8_t[mCacheWidth * mCacheHeight];
    memset(mTextTexture, 0, mCacheWidth * mCacheHeight * sizeof(uint8_t));

    mUploadTexture = false;

    glGenTextures(1, &mTextureId);