aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-01-22 10:35:09 +0100
committerLiang Qi <liang.qi@qt.io>2019-01-22 11:20:29 +0100
commit1b4d2741f90d3f4daf79940b9c8713dda0fb7f3d (patch)
tree40cee4f6af7bf9a5fc87c43f024f417a5d09e18d /src/quick/scenegraph
parent536868fad50778ec5bf4c6c7269c721b05d8a2d5 (diff)
parent84e15a609b37a64baf82ed20f8d4f79474989226 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: .qmake.conf tests/auto/quick/qquickpathview/tst_qquickpathview.cpp Change-Id: Ic1f5e219a255d0613f7654368a5ce3eccb8f0ee9
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer.cpp7
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer_p.h9
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp4
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h2
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp2
5 files changed, 8 insertions, 16 deletions
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp
index c99e149aa5..252e5a9c55 100644
--- a/src/quick/scenegraph/qsgadaptationlayer.cpp
+++ b/src/quick/scenegraph/qsgadaptationlayer.cpp
@@ -56,7 +56,7 @@ static QElapsedTimer qsg_render_timer;
QSGDistanceFieldGlyphCache::Texture QSGDistanceFieldGlyphCache::s_emptyTexture;
-QSGDistanceFieldGlyphCache::QSGDistanceFieldGlyphCache(QOpenGLContext *c, const QRawFont &font)
+QSGDistanceFieldGlyphCache::QSGDistanceFieldGlyphCache(const QRawFont &font)
: m_pendingGlyphs(64)
{
Q_ASSERT(font.isValid());
@@ -71,11 +71,6 @@ QSGDistanceFieldGlyphCache::QSGDistanceFieldGlyphCache(QOpenGLContext *c, const
// this allows us to call pathForGlyph once and reuse the result.
m_referenceFont.setPixelSize(QT_DISTANCEFIELD_BASEFONTSIZE(m_doubleGlyphResolution) * QT_DISTANCEFIELD_SCALE(m_doubleGlyphResolution));
Q_ASSERT(m_referenceFont.isValid());
-#if QT_CONFIG(opengl)
- m_coreProfile = (c->format().profile() == QSurfaceFormat::CoreProfile);
-#else
- Q_UNUSED(c)
-#endif
}
QSGDistanceFieldGlyphCache::~QSGDistanceFieldGlyphCache()
diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h
index ba5c4353b2..58ecae94e7 100644
--- a/src/quick/scenegraph/qsgadaptationlayer_p.h
+++ b/src/quick/scenegraph/qsgadaptationlayer_p.h
@@ -62,7 +62,6 @@
#include <QtCore/qurl.h>
#include <private/qfontengine_p.h>
#include <QtGui/private/qdatabuffer_p.h>
-#include <private/qopenglcontext_p.h>
#include <private/qdistancefield_p.h>
#include <private/qintrusivelist_p.h>
@@ -75,7 +74,6 @@ class QSGNode;
class QImage;
class TextureReference;
class QSGDistanceFieldGlyphNode;
-class QOpenGLContext;
class QSGInternalImageNode;
class QSGPainterNode;
class QSGInternalRectangleNode;
@@ -413,7 +411,7 @@ typedef QIntrusiveList<QSGDistanceFieldGlyphConsumer, &QSGDistanceFieldGlyphCons
class Q_QUICK_PRIVATE_EXPORT QSGDistanceFieldGlyphCache
{
public:
- QSGDistanceFieldGlyphCache(QOpenGLContext *c, const QRawFont &font);
+ QSGDistanceFieldGlyphCache(const QRawFont &font);
virtual ~QSGDistanceFieldGlyphCache();
struct Metrics {
@@ -514,8 +512,6 @@ protected:
void saveTexture(GLuint textureId, int width, int height) const;
#endif
- inline bool isCoreProfile() const { return m_coreProfile; }
-
bool m_doubleGlyphResolution;
protected:
@@ -523,9 +519,6 @@ protected:
private:
int m_glyphCount;
-
- bool m_coreProfile;
-
QList<Texture> m_textures;
QHash<glyph_t, GlyphData> m_glyphsData;
QDataBuffer<glyph_t> m_pendingGlyphs;
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
index ccc57b0b86..8121b4559e 100644
--- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
+++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
@@ -67,7 +67,7 @@ DEFINE_BOOL_CONFIG_OPTION(qsgPreferFullSizeGlyphCacheTextures, QSG_PREFER_FULLSI
QSGDefaultDistanceFieldGlyphCache::QSGDefaultDistanceFieldGlyphCache(QOpenGLContext *c,
const QRawFont &font)
- : QSGDistanceFieldGlyphCache(c, font)
+ : QSGDistanceFieldGlyphCache(font)
, m_maxTextureSize(0)
, m_maxTextureCount(3)
, m_areaAllocator(nullptr)
@@ -89,6 +89,8 @@ QSGDefaultDistanceFieldGlyphCache::QSGDefaultDistanceFieldGlyphCache(QOpenGLCont
qWarning("Buffer creation failed");
}
+ m_coreProfile = (c->format().profile() == QSurfaceFormat::CoreProfile);
+
// Load a pregenerated cache if the font contains one
loadPregeneratedCache(font);
}
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
index a0e4387af9..c64adddd91 100644
--- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
+++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
@@ -88,6 +88,7 @@ public:
private:
bool loadPregeneratedCache(const QRawFont &font);
+ inline bool isCoreProfile() const { return m_coreProfile; }
struct TextureInfo {
GLuint texture;
@@ -137,6 +138,7 @@ private:
mutable int m_maxTextureSize;
int m_maxTextureCount;
+ bool m_coreProfile;
QList<TextureInfo> m_textures;
QHash<glyph_t, TextureInfo *> m_glyphsTexture;
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index 720f08f69b..042eee19f5 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -389,7 +389,7 @@ QSGTexture::~QSGTexture()
it to a shader that operates on the texture coordinates 0-1 instead
of the texture subrect inside the atlas.
- If the texture is not part of a texture atlas, this function returns 0.
+ If the texture is not part of a texture atlas, this function returns \nullptr.
Implementations of this function are recommended to return the same instance
for multiple calls to limit memory usage.