diff options
Diffstat (limited to 'examples/quick/scenegraph')
9 files changed, 16 insertions, 15 deletions
diff --git a/examples/quick/scenegraph/graph/shaders/line.fsh b/examples/quick/scenegraph/graph/shaders/line.fsh index 5d38c46d4d..41c0ee3c00 100644 --- a/examples/quick/scenegraph/graph/shaders/line.fsh +++ b/examples/quick/scenegraph/graph/shaders/line.fsh @@ -44,7 +44,7 @@ uniform lowp float spread; varying lowp float vT; -#define PI 3.14159265359 +#define PI 3.14159265358979323846 void main(void) { diff --git a/examples/quick/scenegraph/graph/shaders/noisy.fsh b/examples/quick/scenegraph/graph/shaders/noisy.fsh index 30b0def932..c217e635ef 100644 --- a/examples/quick/scenegraph/graph/shaders/noisy.fsh +++ b/examples/quick/scenegraph/graph/shaders/noisy.fsh @@ -45,7 +45,7 @@ uniform lowp vec4 color; varying highp vec2 vTexCoord; varying lowp vec2 vShadeCoord; -#define PI 3.14159265359 +#define PI 3.14159265358979323846 void main() { diff --git a/examples/quick/scenegraph/rendernode/d3d12renderer.h b/examples/quick/scenegraph/rendernode/d3d12renderer.h index 1d2726819f..b071f45191 100644 --- a/examples/quick/scenegraph/rendernode/d3d12renderer.h +++ b/examples/quick/scenegraph/rendernode/d3d12renderer.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -45,7 +45,7 @@ #if QT_CONFIG(d3d12) -class QQuickItem; +QT_FORWARD_DECLARE_CLASS(QQuickItem) #include <d3d12.h> #include <wrl/client.h> diff --git a/examples/quick/scenegraph/rendernode/openglrenderer.h b/examples/quick/scenegraph/rendernode/openglrenderer.h index ea2bbcbc38..213e77fade 100644 --- a/examples/quick/scenegraph/rendernode/openglrenderer.h +++ b/examples/quick/scenegraph/rendernode/openglrenderer.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -51,6 +51,8 @@ class QQuickItem; class QOpenGLShaderProgram; class QOpenGLBuffer; +QT_END_NAMESPACE + class OpenGLRenderNode : public QSGRenderNode { public: @@ -73,8 +75,6 @@ private: QOpenGLBuffer *m_vbo = nullptr; }; -QT_END_NAMESPACE - #endif // opengl #endif diff --git a/examples/quick/scenegraph/rendernode/softwarerenderer.cpp b/examples/quick/scenegraph/rendernode/softwarerenderer.cpp index d303b9ef13..f4ee976705 100644 --- a/examples/quick/scenegraph/rendernode/softwarerenderer.cpp +++ b/examples/quick/scenegraph/rendernode/softwarerenderer.cpp @@ -64,11 +64,12 @@ void SoftwareRenderNode::render(const RenderState *renderState) QPainter *p = static_cast<QPainter *>(rif->getResource(m_item->window(), QSGRendererInterface::PainterResource)); Q_ASSERT(p); - p->setTransform(matrix()->toTransform()); - p->setOpacity(inheritedOpacity()); const QRegion *clipRegion = renderState->clipRegion(); if (clipRegion && !clipRegion->isEmpty()) - p->setClipRegion(*clipRegion, Qt::IntersectClip); + p->setClipRegion(*clipRegion, Qt::ReplaceClip); // must be done before setTransform + + p->setTransform(matrix()->toTransform()); + p->setOpacity(inheritedOpacity()); const QPointF p0(m_item->width() - 1, m_item->height() - 1); const QPointF p1(0, 0); diff --git a/examples/quick/scenegraph/shared/logorenderer.cpp b/examples/quick/scenegraph/shared/logorenderer.cpp index 8eb2d44c1e..5c3a770f54 100644 --- a/examples/quick/scenegraph/shared/logorenderer.cpp +++ b/examples/quick/scenegraph/shared/logorenderer.cpp @@ -41,7 +41,7 @@ #include "logorenderer.h" #include <QPainter> #include <QPaintEngine> -#include <math.h> +#include <qmath.h> LogoRenderer::LogoRenderer() { @@ -166,7 +166,7 @@ void LogoRenderer::createGeometry() extrude(x4, y4, y4, x4); extrude(y4, x4, y3, x3); - const qreal Pi = 3.14159f; + const qreal Pi = M_PI; const int NumSectors = 100; for (int i = 0; i < NumSectors; ++i) { diff --git a/examples/quick/scenegraph/textureinsgnode/main.qml b/examples/quick/scenegraph/textureinsgnode/main.qml index fe145b0f05..ba110a278d 100644 --- a/examples/quick/scenegraph/textureinsgnode/main.qml +++ b/examples/quick/scenegraph/textureinsgnode/main.qml @@ -64,7 +64,7 @@ Item { uniform highp vec2 pixelSize; varying highp vec2 qt_TexCoord0; void main() { - highp vec2 tc = sign(sin(3.14152 * qt_TexCoord0 * pixelSize)); + highp vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * pixelSize)); if (tc.x != tc.y) gl_FragColor = color1; else diff --git a/examples/quick/scenegraph/textureinthread/main.qml b/examples/quick/scenegraph/textureinthread/main.qml index 9108f0281d..2d61488e85 100644 --- a/examples/quick/scenegraph/textureinthread/main.qml +++ b/examples/quick/scenegraph/textureinthread/main.qml @@ -64,7 +64,7 @@ Item { uniform highp vec2 pixelSize; varying highp vec2 qt_TexCoord0; void main() { - highp vec2 tc = sign(sin(3.14152 * qt_TexCoord0 * pixelSize)); + highp vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * pixelSize)); if (tc.x != tc.y) gl_FragColor = color1; else diff --git a/examples/quick/scenegraph/twotextureproviders/main.qml b/examples/quick/scenegraph/twotextureproviders/main.qml index af07f9badd..a6202b5a09 100644 --- a/examples/quick/scenegraph/twotextureproviders/main.qml +++ b/examples/quick/scenegraph/twotextureproviders/main.qml @@ -61,7 +61,7 @@ Item { uniform highp vec2 pixelSize; varying highp vec2 qt_TexCoord0; void main() { - highp vec2 tc = sign(sin(3.14152 * qt_TexCoord0 * pixelSize)); + highp vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * pixelSize)); if (tc.x != tc.y) gl_FragColor = color1; else |