diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-26 13:53:00 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-26 20:31:20 +0000 |
commit | 3f858a07726666222372f793f1e1a5de3c8ec373 (patch) | |
tree | 99b8f41136575040587a6ebd3ff54211320cb214 /src/gui/opengl | |
parent | 4ed795df247c5859089e3a6b6ca7c24e8c973a31 (diff) |
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 <marc.mutz@kdab.com>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r-- | src/gui/opengl/qopenglpaintengine.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index 576558022e..e87f7bfcef 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -67,7 +67,6 @@ #include <private/qopengl_p.h> #include <private/qopenglcontext_p.h> #include <private/qopenglextensions_p.h> -#include <private/qmath_p.h> #include <private/qpaintengineex_p.h> #include <QPaintEngine> #include <private/qpainter_p.h> @@ -350,7 +349,7 @@ void QOpenGL2PaintEngineExPrivate::updateBrushUniforms() const QConicalGradient *g = static_cast<const QConicalGradient *>(currentBrush.gradient()); translationPoint = g->center(); - GLfloat angle = -(g->angle() * 2 * Q_PI) / 360.0; + GLfloat angle = -qDegreesToRadians(g->angle()); shaderManager->currentProgram()->setUniformValue(location(QOpenGLEngineShaderManager::Angle), angle); @@ -2010,8 +2009,8 @@ void QOpenGL2PaintEngineExPrivate::drawPixmapFragments(const QPainter::PixmapFra 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; |