summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-12-09 16:17:22 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-12-09 16:27:23 (GMT)
commit0c7687458c524252dae26deb32f7a3b8a38491f5 (patch)
tree6de5ea6f13c1e9682d90367b29eaf031d29d7709 /src/opengl
parenta23cab16dd4dd3505578d2747debaa28a21190ea (diff)
downloadQt-0c7687458c524252dae26deb32f7a3b8a38491f5.zip
Qt-0c7687458c524252dae26deb32f7a3b8a38491f5.tar.gz
Qt-0c7687458c524252dae26deb32f7a3b8a38491f5.tar.bz2
Try using pure scissor clip in GL 2 engine for rotations.
As long as the final clip area is rectangular and axis aligned we can use a scissor clip. This prevents performance problems when doing 90-degree rotated rectangle clips. Reviewed-by: Bjørn Erik Nilsen
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index ac41c04..7045fe9 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -2141,7 +2141,11 @@ void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op)
const QPointF* const points = reinterpret_cast<const QPointF*>(path.points());
QRectF rect(points[0], points[2]);
- if (state()->matrix.type() <= QTransform::TxScale) {
+ if (state()->matrix.type() <= QTransform::TxScale
+ || (state()->matrix.type() == QTransform::TxRotate
+ && qFuzzyIsNull(state()->matrix.m11())
+ && qFuzzyIsNull(state()->matrix.m22())))
+ {
state()->rectangleClip = state()->rectangleClip.intersected(state()->matrix.mapRect(rect).toRect());
d->updateClipScissorTest();
return;