summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-03-06 16:03:43 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-03-31 06:27:23 +0000
commit635f95846ee8eba25b36d0b83ad658ae56c63ed0 (patch)
tree02c83e7730b23439e7eeadc1fd2a2b7c79268957
parent641b8d2b84896e277678307a3e7bbac9f64cff76 (diff)
Windows: Fix QT_NO_OPENGL build
Change-Id: Ieb99dce5389c37fb28a28691c75bf879740398e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
-rw-r--r--src/plugins/platforms/windows/qwindowsopengltester.cpp19
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp3
2 files changed, 15 insertions, 7 deletions
diff --git a/src/plugins/platforms/windows/qwindowsopengltester.cpp b/src/plugins/platforms/windows/qwindowsopengltester.cpp
index 67548a0836..f5065a22b8 100644
--- a/src/plugins/platforms/windows/qwindowsopengltester.cpp
+++ b/src/plugins/platforms/windows/qwindowsopengltester.cpp
@@ -208,15 +208,22 @@ static inline QString resolveBugListFile(const QString &fileName)
return QStandardPaths::locate(QStandardPaths::ConfigLocation, fileName);
}
+# ifndef QT_NO_OPENGL
typedef QHash<QOpenGLConfig::Gpu, QWindowsOpenGLTester::Renderers> SupportedRenderersCache;
Q_GLOBAL_STATIC(SupportedRenderersCache, supportedRenderersCache)
+# endif
#endif // !Q_OS_WINCE
QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::detectSupportedRenderers(const GpuDescription &gpu, bool glesOnly)
{
Q_UNUSED(gpu)
-#ifndef Q_OS_WINCE
+ Q_UNUSED(glesOnly)
+#if defined(QT_NO_OPENGL)
+ return 0;
+#elif defined(Q_OS_WINCE)
+ return QWindowsOpenGLTester::Gles;
+#else
QOpenGLConfig::Gpu qgpu;
qgpu.deviceId = gpu.deviceId;
qgpu.vendorId = gpu.vendorId;
@@ -265,9 +272,7 @@ QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::detectSupportedRenderers(c
srCache->insert(qgpu, result);
return result;
-#else // !Q_OS_WINCE
- return QWindowsOpenGLTester::Gles;
-#endif
+#endif // !Q_OS_WINCE && !QT_NO_OPENGL
}
QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::supportedGlesRenderers()
@@ -288,7 +293,7 @@ QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::supportedRenderers()
bool QWindowsOpenGLTester::testDesktopGL()
{
-#ifndef Q_OS_WINCE
+#if !defined(QT_NO_OPENGL) && !defined(Q_OS_WINCE)
HMODULE lib = 0;
HWND wnd = 0;
HDC dc = 0;
@@ -414,9 +419,9 @@ cleanup:
// No FreeLibrary. Some implementations, Mesa in particular, deadlock when trying to unload.
return result;
-#else // !Q_OS_WINCE
+#else
return false;
-#endif
+#endif // !QT_NO_OPENGL && !Q_OS_WINCE
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index fc389ecf15..b1208d9793 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -2265,6 +2265,7 @@ void QWindowsWindow::setCustomMargins(const QMargins &newCustomMargins)
void *QWindowsWindow::surface(void *nativeConfig, int *err)
{
#ifdef QT_NO_OPENGL
+ Q_UNUSED(nativeConfig)
return 0;
#else
if (!m_surface) {
@@ -2278,11 +2279,13 @@ void *QWindowsWindow::surface(void *nativeConfig, int *err)
void QWindowsWindow::invalidateSurface()
{
+#ifndef QT_NO_OPENGL
if (m_surface) {
if (QWindowsStaticOpenGLContext *staticOpenGLContext = QWindowsIntegration::staticOpenGLContext())
staticOpenGLContext->destroyWindowSurface(m_surface);
m_surface = 0;
}
+#endif // QT_NO_OPENGL
}
void QWindowsWindow::setTouchWindowTouchTypeStatic(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes)