summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-02-26 13:53:00 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-02-26 20:31:20 +0000
commit3f858a07726666222372f793f1e1a5de3c8ec373 (patch)
tree99b8f41136575040587a6ebd3ff54211320cb214 /src/opengl/gl2paintengineex
parent4ed795df247c5859089e3a6b6ca7c24e8c973a31 (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/opengl/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp7
1 files changed, 3 insertions, 4 deletions
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 <qmath.h>
#include <private/qgl_p.h>
-#include <private/qmath_p.h>
#include <private/qpaintengineex_p.h>
#include <QPaintEngine>
#include <private/qpainter_p.h>
@@ -288,7 +287,7 @@ void QGL2PaintEngineExPrivate::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(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;