Commit b528809f authored by Gunnar Sletta's avatar Gunnar Sletta Committed by The Qt Project
Browse files

Avoid redundant QColor::alphaF() calls.


Change-Id: I3694b075e98eab9f3eacf7758881a9473999b46e
Reviewed-by: default avatarYoann Lopes <yoann.lopes@digia.com>
parent 81a9dd71
No related merge requests found
Showing with 5 additions and 5 deletions
......@@ -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);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment