aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@theqtcompany.com>2016-05-08 20:17:35 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-08 20:04:37 +0000
commitddbe4ec52b747b3504180a15c7e5a2da3a6332c8 (patch)
treeaa8c9aa421856db1fdebd5817f665f892bc37440
parent92da3afdb69c52b955f3828ec10574031f094c7d (diff)
Fix build with QT_NO_OPENGL after rebase
Change-Id: Ia4243de07ec75030bb98f4f6d95f70d88e29fdba Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp8
-rw-r--r--src/quick/scenegraph/qsgbasicimagenode.cpp6
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgtexturematerial.cpp2
-rw-r--r--tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp6
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp3
6 files changed, 17 insertions, 10 deletions
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index ed3eaf0703..b43adac0c5 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -4099,12 +4099,14 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args
case QQuickCanvasItem::Image:
m_texture = new QQuickContext2DImageTexture;
break;
-#ifndef QT_NO_OPENGL
case QQuickCanvasItem::FramebufferObject:
-
+#ifndef QT_NO_OPENGL
m_texture = new QQuickContext2DFBOTexture;
- break;
+#else
+ // It shouldn't be possible to use a FramebufferObject without OpenGL
+ m_texture = nullptr;
#endif
+ break;
}
m_texture->setItem(canvasItem);
diff --git a/src/quick/scenegraph/qsgbasicimagenode.cpp b/src/quick/scenegraph/qsgbasicimagenode.cpp
index 36a43b754a..24077cc947 100644
--- a/src/quick/scenegraph/qsgbasicimagenode.cpp
+++ b/src/quick/scenegraph/qsgbasicimagenode.cpp
@@ -314,7 +314,7 @@ QSGGeometry *QSGBasicImageNode::updateGeometry(const QRectF &targetRect,
g->allocate(hCells * vCells * 4 + (hCells + vCells - 1) * 4,
hCells * vCells * 6 + (hCells + vCells) * 12);
- g->setDrawingMode(GL_TRIANGLES);
+ g->setDrawingMode(QSGGeometry::DrawTriangles);
SmoothVertex *vertices = reinterpret_cast<SmoothVertex *>(g->vertexData());
memset(vertices, 0, g->vertexCount() * g->sizeOfVertex());
quint16 *indices = g->indexDataAsUShort();
@@ -427,11 +427,11 @@ QSGGeometry *QSGBasicImageNode::updateGeometry(const QRectF &targetRect,
if (!geometry) {
geometry = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(),
hCells * vCells * 4, hCells * vCells * 6,
- GL_UNSIGNED_SHORT);
+ QSGGeometry::TypeUnsignedShort);
} else {
geometry->allocate(hCells * vCells * 4, hCells * vCells * 6);
}
- geometry->setDrawingMode(GL_TRIANGLES);
+ geometry->setDrawingMode(QSGGeometry::DrawTriangles);
QSGGeometry::TexturedPoint2D *vertices = geometry->vertexDataAsTexturedPoint2D();
ys = yData.data();
for (int j = 0; j < vCells; ++j, ys += 2) {
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index 1ec1db5ab5..19403deb73 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -288,6 +288,8 @@ bool qsg_safeguard_texture(QSGTexture *texture)
QOpenGLContext::currentContext()->functions()->glBindTexture(GL_TEXTURE_2D, 0);
return false;
}
+#else
+ Q_UNUSED(texture)
#endif
return true;
}
diff --git a/src/quick/scenegraph/util/qsgtexturematerial.cpp b/src/quick/scenegraph/util/qsgtexturematerial.cpp
index 12a1b474e3..744df5e143 100644
--- a/src/quick/scenegraph/util/qsgtexturematerial.cpp
+++ b/src/quick/scenegraph/util/qsgtexturematerial.cpp
@@ -104,6 +104,8 @@ void QSGOpaqueTextureMaterialShader::updateState(const RenderState &state, QSGMa
t->setVerticalWrapMode(QSGTexture::ClampToEdge);
}
}
+#else
+ Q_UNUSED(state)
#endif
t->setMipmapFiltering(tx->mipmapFiltering());
diff --git a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
index e1435e739f..40cead6ac0 100644
--- a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
+++ b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
@@ -76,7 +76,9 @@ private slots:
void statusChanges_data();
void sourceSizeChanges();
void progressAndStatusChanges();
+#ifndef QT_NO_OPENGL
void borderImageMesh();
+#endif
private:
QQmlEngine engine;
@@ -576,7 +578,7 @@ void tst_qquickborderimage::progressAndStatusChanges()
delete obj;
}
-
+#ifndef QT_NO_OPENGL
void tst_qquickborderimage::borderImageMesh()
{
QQuickView *window = new QQuickView;
@@ -591,7 +593,7 @@ void tst_qquickborderimage::borderImageMesh()
QVERIFY(QQuickVisualTestUtil::compareImages(mesh, nonmesh));
}
-
+#endif
QTEST_MAIN(tst_qquickborderimage)
#include "tst_qquickborderimage.moc"
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 9c4043791f..138f2759a4 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -2203,8 +2203,8 @@ void tst_qquickwindow::testRenderJob()
QCOMPARE(int(readPixel[2]), 0);
QCOMPARE(int(readPixel[3]), 255);
}
- }
#endif
+ }
// Verify that jobs are deleted when window is not rendered at all
completedJobs.clear();
@@ -2221,7 +2221,6 @@ void tst_qquickwindow::testRenderJob()
class EventCounter : public QQuickRectangle
{
- Q_OBJECT
public:
EventCounter(QQuickItem *parent = 0)
: QQuickRectangle(parent)