diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-11-08 10:28:30 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-11-08 12:32:01 +0100 |
commit | 0a27a14ec1879096e5fffca75b3bd107b813db87 (patch) | |
tree | 2e4332c9545af969903cb9c8bd619f2adc53f5a8 /src/imports | |
parent | b853a1e1b003d4dc01884201c09c2fcbf75f2cf6 (diff) | |
parent | 7bedd55551fbe95355b0db11f9d576924e829f9d (diff) |
Merge remote-tracking branch 'origin/dev' into new-backend
Change-Id: I1a49b4a242ed0764101521d06ec612e96bff0e4c
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/shapes/qquickshapenvprrenderer.cpp | 25 | ||||
-rw-r--r-- | src/imports/shapes/shapes.pro | 2 | ||||
-rw-r--r-- | src/imports/testlib/toucheventsequence.qdoc | 8 |
3 files changed, 30 insertions, 5 deletions
diff --git a/src/imports/shapes/qquickshapenvprrenderer.cpp b/src/imports/shapes/qquickshapenvprrenderer.cpp index c0a918bda5..88f367fe70 100644 --- a/src/imports/shapes/qquickshapenvprrenderer.cpp +++ b/src/imports/shapes/qquickshapenvprrenderer.cpp @@ -43,6 +43,7 @@ #include <QOpenGLShaderProgram> #include <QOpenGLBuffer> #include <qmath.h> +#include <private/qpainterpath_p.h> #include <private/qquickpath_p_p.h> QT_BEGIN_NAMESPACE @@ -287,6 +288,30 @@ void QQuickShapeNvprRenderer::convertPath(const QQuickPath *path, ShapePathGuiDa if (d->path.str.isEmpty()) d->path.str = QString(QStringLiteral("M %1 %2 ")).arg(pos.x()).arg(pos.y()).toUtf8(); d->path.str.append(o->path().toUtf8()); + } else if (QQuickPathAngleArc *o = qobject_cast<QQuickPathAngleArc *>(e)) { + QRectF rect(o->centerX() - o->radiusX(), o->centerY() - o->radiusY(), o->radiusX() * 2, o->radiusY() * 2); + QPointF startPoint; + QPointF endPoint; + qt_find_ellipse_coords(rect, o->startAngle(), -o->sweepAngle(), &startPoint, &endPoint); + + // get to our starting position + if (o->moveToStart()) + d->path.cmd.append(GL_MOVE_TO_NV); + else + d->path.cmd.append(GL_LINE_TO_NV); // ### should we check if startPoint == pos? + d->path.coord.append(startPoint.x()); + d->path.coord.append(startPoint.y()); + + const bool sweepFlag = o->sweepAngle() > 0; // maps to CCW, not a typo + d->path.cmd.append(qAbs(o->sweepAngle()) > 180.0 + ? (sweepFlag ? GL_LARGE_CCW_ARC_TO_NV : GL_LARGE_CW_ARC_TO_NV) + : (sweepFlag ? GL_SMALL_CCW_ARC_TO_NV : GL_SMALL_CW_ARC_TO_NV)); + d->path.coord.append(o->radiusX()); + d->path.coord.append(o->radiusY()); + d->path.coord.append(0); // xAxisRotation + d->path.coord.append(endPoint.x()); + d->path.coord.append(endPoint.y()); + pos = endPoint; } else { qWarning() << "Shape/NVPR: unsupported Path element" << e; } diff --git a/src/imports/shapes/shapes.pro b/src/imports/shapes/shapes.pro index 4406474c3f..60cc61e974 100644 --- a/src/imports/shapes/shapes.pro +++ b/src/imports/shapes/shapes.pro @@ -3,7 +3,7 @@ TARGET = qmlshapesplugin TARGETPATH = QtQuick/Shapes IMPORT_VERSION = 1.0 -QT = core gui qml quick quick-private +QT = core gui-private qml quick-private HEADERS += \ qquickshape_p.h \ diff --git a/src/imports/testlib/toucheventsequence.qdoc b/src/imports/testlib/toucheventsequence.qdoc index f85a1cd4f9..d7cc48c5dd 100644 --- a/src/imports/testlib/toucheventsequence.qdoc +++ b/src/imports/testlib/toucheventsequence.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 Jeremy Katz -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ |