From 3f858a07726666222372f793f1e1a5de3c8ec373 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 26 Feb 2015 13:53:00 +0100 Subject: Remove some uses of the private Q_PI constant The patch removes several uses of the private Q_PI constant and removes the qmath_p.h from the includes. A few places are optimized to multiply with reciprocals instead of dividing by Q_PI. Change-Id: I097af6a929e0609d6935563064e81c856005f4bc Reviewed-by: Marc Mutz --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/opengl') diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index e461dd0fd4..e049f53fac 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -63,7 +63,6 @@ #include #include -#include #include #include #include @@ -288,7 +287,7 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms() const QConicalGradient *g = static_cast(currentBrush.gradient()); translationPoint = g->center(); - GLfloat angle = -(g->angle() * 2 * Q_PI) / 360.0; + GLfloat angle = -qDegreesToRadians(g->angle()); shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::Angle), angle); @@ -1945,8 +1944,8 @@ void QGL2PaintEngineExPrivate::drawPixmapFragments(const QPainter::PixmapFragmen qreal s = 0; qreal c = 1; if (fragments[i].rotation != 0) { - s = qFastSin(fragments[i].rotation * Q_PI / 180); - c = qFastCos(fragments[i].rotation * Q_PI / 180); + s = qFastSin(qDegreesToRadians(fragments[i].rotation)); + c = qFastCos(qDegreesToRadians(fragments[i].rotation)); } qreal right = 0.5 * fragments[i].scaleX * fragments[i].width; -- cgit v1.2.3