Skip to content

Commit

Permalink
Merge pull request #37 from sletta/flush-glyph-cache
Browse files Browse the repository at this point in the history
[mer] Work around missing glyphs problem.
  • Loading branch information
sletta committed May 11, 2015
2 parents be85203 + 7606b1d commit 4b71f8d
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 4b71f8d

Please sign in to comment.