From c3d2a7bd8af4102441c113e088bd6a2cb50b97cf Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.agocs@digia.com>
Date: Tue, 14 Oct 2014 10:48:10 +0200
Subject: [PATCH] Fix -no-opengl builds

Task-number: QTBUG-41677
Change-Id: I039ec581e960eb70eb04aed6e65add70c563ba77
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
---
 src/client/qwaylandintegration.cpp     | 2 ++
 src/client/qwaylandintegration_p.h     | 2 ++
 src/client/qwaylandshmbackingstore.cpp | 2 ++
 src/client/qwaylandshmbackingstore_p.h | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index d9bf82e4f..aa5a1cea8 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -175,12 +175,14 @@ QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) cons
     return new QWaylandShmWindow(window);
 }
 
+#ifndef QT_NO_OPENGL
 QPlatformOpenGLContext *QWaylandIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
 {
     if (mDisplay->clientBufferIntegration())
         return mDisplay->clientBufferIntegration()->createPlatformOpenGLContext(context->format(), context->shareHandle());
     return 0;
 }
+#endif // QT_NO_OPENGL
 
 QPlatformBackingStore *QWaylandIntegration::createPlatformBackingStore(QWindow *window) const
 {
diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h
index bbe982853..699702482 100644
--- a/src/client/qwaylandintegration_p.h
+++ b/src/client/qwaylandintegration_p.h
@@ -61,7 +61,9 @@ public:
 
     bool hasCapability(QPlatformIntegration::Capability cap) const;
     QPlatformWindow *createPlatformWindow(QWindow *window) const;
+#ifndef QT_NO_OPENGL
     QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
+#endif
     QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
 
     QAbstractEventDispatcher *createEventDispatcher() const;
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
index 332ea9265..d407335d3 100644
--- a/src/client/qwaylandshmbackingstore.cpp
+++ b/src/client/qwaylandshmbackingstore.cpp
@@ -323,6 +323,7 @@ QWaylandWindow *QWaylandShmBackingStore::waylandWindow() const
     return static_cast<QWaylandWindow *>(window()->handle());
 }
 
+#ifndef QT_NO_OPENGL
 QImage QWaylandShmBackingStore::toImage() const
 {
     // Invoked from QPlatformBackingStore::composeAndFlush() that is called
@@ -331,6 +332,7 @@ QImage QWaylandShmBackingStore::toImage() const
 
     return *contentSurface();
 }
+#endif // QT_NO_OPENGL
 
 void QWaylandShmBackingStore::done(void *data, wl_callback *callback, uint32_t time)
 {
diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h
index 319acd9a9..1212e52fe 100644
--- a/src/client/qwaylandshmbackingstore_p.h
+++ b/src/client/qwaylandshmbackingstore_p.h
@@ -94,7 +94,9 @@ public:
     QWaylandWindow *waylandWindow() const;
     void iterateBuffer();
 
+#ifndef QT_NO_OPENGL
     QImage toImage() const Q_DECL_OVERRIDE;
+#endif
 
 private:
     void updateDecorations();
-- 
GitLab