summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpaintengine_opengl.cpp
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-10-13 14:51:53 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-10-13 15:33:38 (GMT)
commit8e709c4a3b8c1b843a662111e23076f8a02b2735 (patch)
tree4032749403a0f2e1d69adcff847d0321358e1623 /src/opengl/qpaintengine_opengl.cpp
parent4b73217ceea55cb77eee550e039f8ec7ad566d80 (diff)
downloadQt-8e709c4a3b8c1b843a662111e23076f8a02b2735.zip
Qt-8e709c4a3b8c1b843a662111e23076f8a02b2735.tar.gz
Qt-8e709c4a3b8c1b843a662111e23076f8a02b2735.tar.bz2
Fixed handling of brush origin in the OpenGL paint engines.
Fixed the OpenGL paint engines so that the brush origin is applied correctly and for all brushes just like in the raster paint engine. Task-number: QTBUG-2676 Reviewed-by: Trond
Diffstat (limited to 'src/opengl/qpaintengine_opengl.cpp')
-rw-r--r--src/opengl/qpaintengine_opengl.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 3e4a8e7..fc1695d 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -1596,7 +1596,8 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF
qreal realRadius = g->radius();
QTransform translate(1, 0, 0, 1, -realFocal.x(), -realFocal.y());
QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
- QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate;
+ QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y());
+ QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate;
setInvMatrixData(inv_matrix);
@@ -1609,7 +1610,8 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF
QPointF realCenter = g->center();
QTransform translate(1, 0, 0, 1, -realCenter.x(), -realCenter.y());
QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
- QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate;
+ QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y());
+ QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate;
setInvMatrixData(inv_matrix);
@@ -1621,8 +1623,8 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF
QPointF realFinal = g->finalStop();
QTransform translate(1, 0, 0, 1, -realStart.x(), -realStart.y());
QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
-
- QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate;
+ QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y());
+ QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate;
setInvMatrixData(inv_matrix);
@@ -1633,10 +1635,9 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF
linear_data[2] = 1.0f / (l.x() * l.x() + l.y() * l.y());
} else if (style != Qt::SolidPattern) {
- QTransform translate(1, 0, 0, 1, brush_origin.x(), brush_origin.y());
QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
-
- QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate;
+ QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y());
+ QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted();
setInvMatrixData(inv_matrix);
}