summaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h')
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
index c64adddd91..0420ef251e 100644
--- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
+++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
@@ -80,7 +80,6 @@ public:
bool useTextureResizeWorkaround() const;
bool useTextureUploadWorkaround() const;
bool createFullSizeTextures() const;
- int maxTextureSize() const;
void setMaxTextureCount(int max) { m_maxTextureCount = max; }
int maxTextureCount() const { return m_maxTextureCount; }
@@ -97,7 +96,7 @@ private:
QDistanceField image;
int padding = -1;
- TextureInfo(const QRect &preallocRect = QRect()) : texture(0), allocatedArea(preallocRect) { }
+ TextureInfo(const QRect &preallocRect = QRect(0, 0, 1, 1)) : texture(0), allocatedArea(preallocRect) { }
};
void createTexture(TextureInfo * texInfo, int width, int height, const void *pixels);
@@ -106,9 +105,10 @@ private:
TextureInfo *textureInfo(int index)
{
+ Q_ASSERT(m_maxTextureWidth > 0 && m_maxTextureHeight > 0);
for (int i = m_textures.count(); i <= index; ++i) {
if (createFullSizeTextures())
- m_textures.append(QRect(0, 0, maxTextureSize(), maxTextureSize()));
+ m_textures.append(QRect(0, 0, m_maxTextureWidth, m_maxTextureWidth));
else
m_textures.append(TextureInfo());
}
@@ -136,7 +136,8 @@ private:
m_blitProgram->link();
}
- mutable int m_maxTextureSize;
+ int m_maxTextureWidth;
+ int m_maxTextureHeight;
int m_maxTextureCount;
bool m_coreProfile;