From: Gunnar Sletta Date: Sat, 18 May 2013 06:31:54 +0000 (+0200) Subject: Avoid redundant QColor::alphaF() calls. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=b528809fc46ae80b291b62a9da45ea3147977dd2;p=konrad%2Fqtdeclarative.git Avoid redundant QColor::alphaF() calls. Change-Id: I3694b075e98eab9f3eacf7758881a9473999b46e Reviewed-by: Yoann Lopes --- diff --git a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp index 3072012..09e2a7d 100644 --- a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp +++ b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp @@ -74,11 +74,11 @@ void FlatColorMaterialShader::updateState(const RenderState &state, QSGMaterial const QColor &c = newMaterial->color(); if (oldMaterial == 0 || c != oldMaterial->color() || state.isOpacityDirty()) { - float opacity = state.opacity(); - QVector4D v(c.redF() * c.alphaF() * opacity, - c.greenF() * c.alphaF() * opacity, - c.blueF() * c.alphaF() * opacity, - c.alphaF() * opacity); + float opacity = state.opacity() * c.alphaF(); + QVector4D v(c.redF() * opacity, + c.greenF() * opacity, + c.blueF() * opacity, + opacity); program()->setUniformValue(m_color_id, v); }