summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2024-04-11 13:56:51 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2024-04-18 10:58:18 +0200
commite4632beaa2e7411595bc4398bba3882668cf3851 (patch)
tree6469e73161996b80269e7d09873da68d9c6fc6b0 /src/core
parent1eee86a1850407e76897fbeb565af1346db71ce3 (diff)
Fix -no-opengl build
Pick-to: 6.7 Change-Id: Ibb6cb75a25f9b6d69ec03bc2c6734a869ab21899 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ozone/gl_context_qt.cpp4
-rw-r--r--src/core/ozone/gl_context_qt.h7
-rw-r--r--src/core/ozone/surface_factory_qt.cpp15
3 files changed, 20 insertions, 6 deletions
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp
index 608d5c21a..0042f2bce 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -175,7 +175,7 @@ bool GLContextHelper::isCreateContextRobustnessSupported()
return contextHelper->m_robustness;
}
-#if defined(USE_OZONE)
+#if QT_CONFIG(opengl) && defined(USE_OZONE)
class ScopedGLContext
{
public:
@@ -363,7 +363,7 @@ bool EGLHelper::isDmaBufSupported()
close(fd);
return true;
}
-#endif // defined(USE_OZONE)
+#endif // QT_CONFIG(opengl) && defined(USE_OZONE)
QT_END_NAMESPACE
diff --git a/src/core/ozone/gl_context_qt.h b/src/core/ozone/gl_context_qt.h
index c1524abf2..bd1137053 100644
--- a/src/core/ozone/gl_context_qt.h
+++ b/src/core/ozone/gl_context_qt.h
@@ -6,10 +6,11 @@
#include <QObject>
#include <QtCore/qscopedpointer.h>
+#include <QtGui/qtgui-config.h>
#include "ui/gl/gl_context.h"
-#if defined(USE_OZONE)
+#if QT_CONFIG(opengl) && defined(USE_OZONE)
#include <EGL/egl.h>
#include <EGL/eglext.h>
#endif
@@ -45,7 +46,7 @@ private:
bool m_robustness = false;
};
-#if defined(USE_OZONE)
+#if QT_CONFIG(opengl) && defined(USE_OZONE)
#undef eglCreateImage
#undef eglDestroyImage
#undef eglExportDMABUFImageMESA
@@ -81,7 +82,7 @@ private:
QScopedPointer<EGLFunctions> m_functions;
bool m_isDmaBufSupported = false;
};
-#endif // defined(USE_OZONE)
+#endif // QT_CONFIG(opengl) && defined(USE_OZONE)
QT_END_NAMESPACE
diff --git a/src/core/ozone/surface_factory_qt.cpp b/src/core/ozone/surface_factory_qt.cpp
index 374f870e2..204f4d62d 100644
--- a/src/core/ozone/surface_factory_qt.cpp
+++ b/src/core/ozone/surface_factory_qt.cpp
@@ -16,6 +16,7 @@
#include "ui/ozone/buildflags.h"
#include <QDebug>
+#include <QtGui/qtgui-config.h>
#if BUILDFLAG(OZONE_PLATFORM_X11)
#include "ozone/gl_ozone_glx_qt.h"
@@ -92,6 +93,8 @@ scoped_refptr<gfx::NativePixmap> SurfaceFactoryQt::CreateNativePixmap(
absl::optional<gfx::Size> framebuffer_size)
{
Q_ASSERT(SupportsNativePixmaps());
+
+#if QT_CONFIG(opengl)
if (framebuffer_size && !gfx::Rect(size).Contains(gfx::Rect(*framebuffer_size)))
return nullptr;
@@ -125,6 +128,9 @@ scoped_refptr<gfx::NativePixmap> SurfaceFactoryQt::CreateNativePixmap(
}
return base::MakeRefCounted<gfx::NativePixmapDmaBuf>(size, format, std::move(handle));
+#else
+ return nullptr;
+#endif // QT_CONFIG(opengl)
}
void SurfaceFactoryQt::CreateNativePixmapAsync(
@@ -149,6 +155,8 @@ SurfaceFactoryQt::CreateNativePixmapFromHandle(
gfx::NativePixmapHandle handle)
{
Q_ASSERT(SupportsNativePixmaps());
+
+#if QT_CONFIG(opengl)
gfx::NativePixmapHandle bufferHandle;
#if BUILDFLAG(OZONE_PLATFORM_X11)
@@ -228,17 +236,22 @@ SurfaceFactoryQt::CreateNativePixmapFromHandle(
}
return base::MakeRefCounted<gfx::NativePixmapDmaBuf>(size, format, std::move(bufferHandle));
+#else
+ return nullptr;
+#endif // QT_CONFIG(opengl)
}
bool SurfaceFactoryQt::SupportsNativePixmaps() const
{
+#if QT_CONFIG(opengl)
#if BUILDFLAG(OZONE_PLATFORM_X11)
if (GLContextHelper::getGlxPlatformInterface())
return ui::GpuMemoryBufferSupportX11::GetInstance()->has_gbm_device();
-#endif
+#endif // BUILDFLAG(OZONE_PLATFORM_X11)
if (GLContextHelper::getEglPlatformInterface())
return EGLHelper::instance()->isDmaBufSupported();
+#endif // QT_CONFIG(opengl)
return false;
}