From b528809fc46ae80b291b62a9da45ea3147977dd2 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Sat, 18 May 2013 08:31:54 +0200 Subject: [PATCH] Avoid redundant QColor::alphaF() calls. Change-Id: I3694b075e98eab9f3eacf7758881a9473999b46e Reviewed-by: Yoann Lopes --- src/quick/scenegraph/util/qsgflatcolormaterial.cpp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) 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); } -- 1.7.2.5