From 3aacbc1e2bea0855f5a405be0e1577320af784f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 6 Feb 2012 11:48:46 +0100 Subject: [PATCH] Compile without OpenGL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since a GLuint returning virtual was added to QPlatformOpenGLContext we need to make sure it's protected by #ifndef QT_NO_OPENGL. Change-Id: Id2f56ccdccc3863986250ee1b3aa7efccf88ba5c Reviewed-by: Casper van Donderen Reviewed-by: Jørgen Lind --- src/gui/kernel/qplatformintegration_qpa.cpp | 2 ++ src/gui/kernel/qplatformintegration_qpa.h | 2 ++ src/plugins/platforms/xcb/qxcbintegration.cpp | 2 ++ src/plugins/platforms/xcb/qxcbintegration.h | 2 ++ src/plugins/platforms/xcb/xcb.pro | 2 +- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp index 1336a1a9a2..7a3fe05f7a 100644 --- a/src/gui/kernel/qplatformintegration_qpa.cpp +++ b/src/gui/kernel/qplatformintegration_qpa.cpp @@ -220,12 +220,14 @@ QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::Pix return new QRasterPlatformPixmap(type); } +#ifndef QT_NO_OPENGL QPlatformOpenGLContext *QPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { Q_UNUSED(context); qWarning("This plugin does not support createPlatformOpenGLContext!"); return 0; } +#endif /*! Factory function for QPlatformSharedGraphicsCache. This function will return 0 if the platform diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h index bd9ecd54dc..483964b8f3 100644 --- a/src/gui/kernel/qplatformintegration_qpa.h +++ b/src/gui/kernel/qplatformintegration_qpa.h @@ -87,7 +87,9 @@ public: virtual QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const; virtual QPlatformWindow *createPlatformWindow(QWindow *window) const = 0; virtual QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const = 0; +#ifndef QT_NO_OPENGL virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; +#endif virtual QPlatformSharedGraphicsCache *createPlatformSharedGraphicsCache(const char *cacheId) const; // Event dispatcher: diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 0f7648a21b..c976e75dbf 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -171,6 +171,7 @@ private: }; #endif +#ifndef QT_NO_OPENGL QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { QXcbScreen *screen = static_cast(context->screen()->handle()); @@ -185,6 +186,7 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont qWarning("Cannot create platform GL context, none of GLX, EGL, DRI2 is enabled"); return 0; } +#endif QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *window) const { diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h index 77d0e4903c..0f20658c70 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.h +++ b/src/plugins/platforms/xcb/qxcbintegration.h @@ -58,7 +58,9 @@ public: ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const; +#ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; +#endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; bool hasCapability(Capability cap) const; diff --git a/src/plugins/platforms/xcb/xcb.pro b/src/plugins/platforms/xcb/xcb.pro index d80a6df0b6..50ca8bf269 100644 --- a/src/plugins/platforms/xcb/xcb.pro +++ b/src/plugins/platforms/xcb/xcb.pro @@ -78,7 +78,7 @@ contains(DEFINES, XCB_USE_DRI2) { HEADERS += qdri2context.h SOURCES += qdri2context.cpp -} else { +} else:contains(QT_CONFIG, opengl) { contains(QT_CONFIG, opengles2) { DEFINES += XCB_USE_EGL LIBS += -lEGL