From 65c7ddd9dd0c86bb532b6a2ad979141a8f24dfea Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Thu, 25 Aug 2016 15:09:10 +0300 Subject: Use QByteArrayLiteral more judiciously Replace it with char* literal in overloaded functions. Saves some text size. Change-Id: Iede24c2169d7329aa17c2175b10873c98c27361f Reviewed-by: Shawn Rutledge Reviewed-by: Marc Mutz Reviewed-by: Ulf Hermann --- src/quick/items/qquickgenericshadereffect.cpp | 4 ++-- .../scenegraph/adaptations/software/qsgsoftwareadaptation.cpp | 2 +- src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp | 8 ++++---- src/quick/scenegraph/qsgrenderloop.cpp | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickgenericshadereffect.cpp b/src/quick/items/qquickgenericshadereffect.cpp index 9714f39663..2f8d71fc11 100644 --- a/src/quick/items/qquickgenericshadereffect.cpp +++ b/src/quick/items/qquickgenericshadereffect.cpp @@ -510,9 +510,9 @@ void QQuickGenericShaderEffect::updateShaderVars(Shader shaderType) QSGShaderEffectNode::VariableData &vd(m_shaders[shaderType].varData[i]); const bool isSpecial = v.name.startsWith("qt_"); // special names not mapped to properties if (isSpecial) { - if (v.name == QByteArrayLiteral("qt_Opacity")) + if (v.name == "qt_Opacity") vd.specialType = QSGShaderEffectNode::VariableData::Opacity; - else if (v.name == QByteArrayLiteral("qt_Matrix")) + else if (v.name == "qt_Matrix") vd.specialType = QSGShaderEffectNode::VariableData::Matrix; else if (v.name.startsWith("qt_SubRect_")) vd.specialType = QSGShaderEffectNode::VariableData::SubRect; diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwareadaptation.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwareadaptation.cpp index 8ad9b50b09..92c02b4966 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwareadaptation.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwareadaptation.cpp @@ -78,7 +78,7 @@ QSGRenderLoop *QSGSoftwareAdaptation::createWindowManager() static bool envChecked = false; if (!envChecked) { envChecked = true; - threaded = qgetenv("QSG_RENDER_LOOP") == QByteArrayLiteral("threaded"); + threaded = qgetenv("QSG_RENDER_LOOP") == "threaded"; } if (threaded) diff --git a/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp b/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp index 96b489cd24..48ab1aa52f 100644 --- a/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp +++ b/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp @@ -193,13 +193,13 @@ QByteArray qsgShaderRewriter_insertZAttributes(const char *input, QSurfaceFormat switch (profile) { case QSurfaceFormat::NoProfile: case QSurfaceFormat::CompatibilityProfile: - result += QByteArrayLiteral("attribute highp float _qt_order;\n"); - result += QByteArrayLiteral("uniform highp float _qt_zRange;\n"); + result += "attribute highp float _qt_order;\n" + "uniform highp float _qt_zRange;\n"; break; case QSurfaceFormat::CoreProfile: - result += QByteArrayLiteral("in float _qt_order;\n"); - result += QByteArrayLiteral("uniform float _qt_zRange;\n"); + result += "in float _qt_order;\n" + "uniform float _qt_zRange;\n"; break; } diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index e99e8dfe2e..a59f9ddcc7 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -209,11 +209,11 @@ QSGRenderLoop *QSGRenderLoop::instance() if (Q_UNLIKELY(qEnvironmentVariableIsSet("QSG_RENDER_LOOP"))) { const QByteArray loopName = qgetenv("QSG_RENDER_LOOP"); - if (loopName == QByteArrayLiteral("windows")) + if (loopName == "windows") loopType = WindowsRenderLoop; - else if (loopName == QByteArrayLiteral("basic")) + else if (loopName == "basic") loopType = BasicRenderLoop; - else if (loopName == QByteArrayLiteral("threaded")) + else if (loopName == "threaded") loopType = ThreadedRenderLoop; } -- cgit v1.2.3