Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[mer] Work around missing glyphs problem.
This problem seems to manifest itself primarily on libhybris based
systems, but this flush seems to fix it.

It also includes a warning for an out-of-memory situation which would
also result in missing glyphs, though that is not the one we are
normally hitting.

Change-Id: I177d78cf9c70bd71b939fa72215bd3f6a977ba26
  • Loading branch information
sletta committed May 11, 2015
1 parent be85203 commit 7606b1d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gui/opengl/qopengltextureglyphcache.cpp
Expand Up @@ -192,7 +192,6 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height)
glBindTexture(GL_TEXTURE_2D, 0);
funcs.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, tmp_texture, 0);

funcs.glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
glBindTexture(GL_TEXTURE_2D, oldTexture);

Expand Down Expand Up @@ -263,6 +262,8 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height)

glBindTexture(GL_TEXTURE_2D, m_textureResource->m_texture);

glFlush();

glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, oldWidth, oldHeight);

funcs.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
Expand Down Expand Up @@ -316,6 +317,10 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
}
const int maskWidth = mask.width();
const int maskHeight = mask.height();
if (maskWidth == 0 || maskHeight == 0 || mask.format() == QImage::Format_Invalid) {
qWarning() << "Failed to acquire glyph alpha mask. Characters will be missing during rendering!";
return;
}

if (mask.format() == QImage::Format_Mono) {
mask = mask.convertToFormat(QImage::Format_Indexed8);
Expand Down

0 comments on commit 7606b1d

Please sign in to comment.