aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/util/qsgdistancefieldutil.cpp
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-03-13 18:19:33 +0100
committerRobin Burchell <robin.burchell@crimson.no>2017-03-21 15:22:50 +0000
commitb5903ba46e065b096d7bcc12b11cde32b1c0f0c7 (patch)
tree04dbff0e563b51bf1b2d3c6395ff32f779268b40 /src/quick/scenegraph/util/qsgdistancefieldutil.cpp
parent6825b37a48de6a69def38897b03ff7f9974226dd (diff)
QSGDistanceFieldUtil: Remove a layer of indirection
These mysterious setters appear to be unused (and always were, as far as I can see). How useful they are is not entirely clear (as opposed to a patch to the source for instance, and as it's private API anyway, you'd be touching internals to use this. Additionally, removing the indirection makes the code a bit cleaner and more self-contained in my opinion. This removal leaves the value of QSGDistanceFieldGlyphCacheManager in some question to me, given that it's basically a glorified wrapper around QHash. Change-Id: I6d18eb40d8cd00ebe389b4ed53448f3401962ae6 Reviewed-by: Gunnar Sletta <gunnar@crimson.no> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Diffstat (limited to 'src/quick/scenegraph/util/qsgdistancefieldutil.cpp')
-rw-r--r--src/quick/scenegraph/util/qsgdistancefieldutil.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/quick/scenegraph/util/qsgdistancefieldutil.cpp b/src/quick/scenegraph/util/qsgdistancefieldutil.cpp
index 9ca9cdb107..97a5853bd6 100644
--- a/src/quick/scenegraph/util/qsgdistancefieldutil.cpp
+++ b/src/quick/scenegraph/util/qsgdistancefieldutil.cpp
@@ -47,33 +47,7 @@
QT_BEGIN_NAMESPACE
-static float qt_sg_envFloat(const char *name, float defaultValue)
-{
- if (Q_LIKELY(!qEnvironmentVariableIsSet(name)))
- return defaultValue;
- bool ok = false;
- const float value = qgetenv(name).toFloat(&ok);
- return ok ? value : defaultValue;
-}
-
-static float defaultThresholdFunc(float glyphScale)
-{
- static const float base = qt_sg_envFloat("QT_DF_BASE", 0.5f);
- static const float baseDev = qt_sg_envFloat("QT_DF_BASEDEVIATION", 0.065f);
- static const float devScaleMin = qt_sg_envFloat("QT_DF_SCALEFORMAXDEV", 0.15f);
- static const float devScaleMax = qt_sg_envFloat("QT_DF_SCALEFORNODEV", 0.3f);
- return base - ((qBound(devScaleMin, glyphScale, devScaleMax) - devScaleMin) / (devScaleMax - devScaleMin) * -baseDev + baseDev);
-}
-
-static float defaultAntialiasingSpreadFunc(float glyphScale)
-{
- static const float range = qt_sg_envFloat("QT_DF_RANGE", 0.06f);
- return range / glyphScale;
-}
-
QSGDistanceFieldGlyphCacheManager::QSGDistanceFieldGlyphCacheManager()
- : m_threshold_func(defaultThresholdFunc)
- , m_antialiasingSpread_func(defaultAntialiasingSpreadFunc)
{
}