diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-04 21:32:01 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-08 09:55:53 +0200 |
commit | 3f5e21a0cc9f41f1747e5c431695e7798ee489db (patch) | |
tree | ccd9f02554d16f68fb66a8f2dd59368dd1a43c30 /src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | |
parent | c8dd51333f14941d9a5c2d3798768df342aa48d4 (diff) |
Remove OpenGL dependency from QSGTexture
The QSGTexture API is now clean, the OpenGL-specific functions are
removed.
Docs are to be updated in a separate patch.
QSGPlainTexture, and a number of texture related places have to follow
suit.
The OpenGL atlas texture implementation is now removed.
Task-number: QTBUG-84717
Task-number: QTBUG-84623
Change-Id: I1aab3b8b9145bb74ad39ef836ce540fc851292c5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultglyphnode_p.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index e13b16c95b..8c66dc348f 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -638,35 +638,19 @@ int QSGTextMaskMaterial::compare(const QSGMaterial *o) const bool QSGTextMaskMaterial::ensureUpToDate() { - if (m_rhi) { - QSGRhiTextureGlyphCache *gc = rhiGlyphCache(); - QSize glyphCacheSize(gc->width(), gc->height()); - if (glyphCacheSize != m_size) { - if (m_texture) - delete m_texture; - m_texture = new QSGPlainTexture; - m_texture->setTexture(gc->texture()); - m_texture->setTextureSize(QSize(gc->width(), gc->height())); - m_texture->setOwnsTexture(false); - m_size = glyphCacheSize; - return true; - } - return false; - - } else { - QSize glyphCacheSize(openglGlyphCache()->width(), openglGlyphCache()->height()); - if (glyphCacheSize != m_size) { - if (m_texture) - delete m_texture; - m_texture = new QSGPlainTexture(); - m_texture->setTextureId(openglGlyphCache()->texture()); - m_texture->setTextureSize(QSize(openglGlyphCache()->width(), openglGlyphCache()->height())); - m_texture->setOwnsTexture(false); - m_size = glyphCacheSize; - return true; - } - return false; + QSGRhiTextureGlyphCache *gc = rhiGlyphCache(); + QSize glyphCacheSize(gc->width(), gc->height()); + if (glyphCacheSize != m_size) { + if (m_texture) + delete m_texture; + m_texture = new QSGPlainTexture; + m_texture->setTexture(gc->texture()); + m_texture->setTextureSize(QSize(gc->width(), gc->height())); + m_texture->setOwnsTexture(false); + m_size = glyphCacheSize; + return true; } + return false; } |