summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;
}