summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-01-17 15:51:29 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-17 08:01:27 +0100
commitf2bbc9c69f5265986dd5574a790e189a7a126c61 (patch)
tree77affb6415c6b276bcc3e7f17a2e663c189ef82d
parentbd4635009d3ba6ea560bc5f70811fa0afee518fc (diff)
Move QOpenGLFrameBufferObject from QtGui to QtOpenGL
Task-number: QTBUG-74409 Change-Id: I817ea6f052fc61a6465d443450c8017ac5d0c0e9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--examples/opengl/paintedwindow/paintedwindow.h2
-rw-r--r--src/gui/.prev_CMakeLists.txt1
-rw-r--r--src/gui/CMakeLists.txt1
-rw-r--r--src/gui/opengl/opengl.pri3
-rw-r--r--src/opengl/CMakeLists.txt1
-rw-r--r--src/opengl/opengl.pro3
-rw-r--r--src/opengl/qopenglframebufferobject.cpp (renamed from src/gui/opengl/qopenglframebufferobject.cpp)8
-rw-r--r--src/opengl/qopenglframebufferobject.h (renamed from src/gui/opengl/qopenglframebufferobject.h)12
-rw-r--r--src/opengl/qopenglframebufferobject_p.h (renamed from src/gui/opengl/qopenglframebufferobject_p.h)4
-rw-r--r--src/opengl/qopenglwidget.cpp5
-rw-r--r--src/opengl/qopenglwindow.cpp6
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositor.cpp2
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp2
13 files changed, 22 insertions, 28 deletions
diff --git a/examples/opengl/paintedwindow/paintedwindow.h b/examples/opengl/paintedwindow/paintedwindow.h
index 7281451924..0dace49a33 100644
--- a/examples/opengl/paintedwindow/paintedwindow.h
+++ b/examples/opengl/paintedwindow/paintedwindow.h
@@ -52,7 +52,7 @@
#include <QtGui/qopengl.h>
#include <QtGui/qopenglshaderprogram.h>
-#include <QtGui/qopenglframebufferobject.h>
+#include <QtOpenGL/qopenglframebufferobject.h>
#include <QPropertyAnimation>
diff --git a/src/gui/.prev_CMakeLists.txt b/src/gui/.prev_CMakeLists.txt
index 933a8eae6d..1f950e27c0 100644
--- a/src/gui/.prev_CMakeLists.txt
+++ b/src/gui/.prev_CMakeLists.txt
@@ -258,7 +258,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_opengl
opengl/qopenglbuffer.cpp opengl/qopenglbuffer.h
opengl/qopenglextensions_p.h
opengl/qopenglextrafunctions.h
- opengl/qopenglframebufferobject.cpp opengl/qopenglframebufferobject.h opengl/qopenglframebufferobject_p.h
opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h
opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h
opengl/qopenglshaderprogram.cpp opengl/qopenglshaderprogram.h
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 3e93b1ddea..5b812628ea 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -340,7 +340,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_opengl
opengl/qopenglbuffer.cpp opengl/qopenglbuffer.h
opengl/qopenglextensions_p.h
opengl/qopenglextrafunctions.h
- opengl/qopenglframebufferobject.cpp opengl/qopenglframebufferobject.h opengl/qopenglframebufferobject_p.h
opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h
opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h
opengl/qopenglshaderprogram.cpp opengl/qopenglshaderprogram.h
diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri
index 8d91a9e4b2..00ac48fa75 100644
--- a/src/gui/opengl/opengl.pri
+++ b/src/gui/opengl/opengl.pri
@@ -8,8 +8,6 @@ qtConfig(opengl) {
HEADERS += opengl/qopengl.h \
opengl/qopengl_p.h \
opengl/qopenglfunctions.h \
- opengl/qopenglframebufferobject.h \
- opengl/qopenglframebufferobject_p.h \
opengl/qopenglbuffer.h \
opengl/qopenglshaderprogram.h \
opengl/qopenglextensions_p.h \
@@ -21,7 +19,6 @@ qtConfig(opengl) {
SOURCES += opengl/qopengl.cpp \
opengl/qopenglfunctions.cpp \
- opengl/qopenglframebufferobject.cpp \
opengl/qopenglbuffer.cpp \
opengl/qopenglshaderprogram.cpp \
opengl/qopenglversionfunctions.cpp \
diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt
index acad98a681..6fa346ff89 100644
--- a/src/opengl/CMakeLists.txt
+++ b/src/opengl/CMakeLists.txt
@@ -11,6 +11,7 @@ qt_add_module(OpenGL
qopengldebug.cpp qopengldebug.h
qopenglengineshadermanager.cpp qopenglengineshadermanager_p.h
qopenglengineshadersource_p.h
+ qopenglframebufferobject.cpp qopenglframebufferobject.h qopenglframebufferobject_p.h
qopenglgradientcache.cpp qopenglgradientcache_p.h
qopenglpaintdevice.cpp qopenglpaintdevice.h qopenglpaintdevice_p.h
qopenglpaintengine.cpp qopenglpaintengine_p.h
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 2a5d7edbee..f7224da13b 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -15,6 +15,8 @@ HEADERS += \
qopengldebug.h \
qopenglengineshadermanager_p.h \
qopenglengineshadersource_p.h \
+ qopenglframebufferobject.h \
+ qopenglframebufferobject_p.h \
qopenglgradientcache_p.h \
qopenglpaintdevice.h \
qopenglpaintdevice_p.h \
@@ -35,6 +37,7 @@ SOURCES += \
qopengl2pexvertexarray.cpp \
qopenglcustomshaderstage.cpp \
qopenglengineshadermanager.cpp \
+ qopenglframebufferobject.cpp \
qopenglgradientcache.cpp \
qopenglpaintdevice.cpp \
qopenglpaintengine.cpp \
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/opengl/qopenglframebufferobject.cpp
index d7a6d32218..d39f5b5b75 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/opengl/qopenglframebufferobject.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -156,7 +156,7 @@ QT_BEGIN_NAMESPACE
\class QOpenGLFramebufferObjectFormat
\brief The QOpenGLFramebufferObjectFormat class specifies the format of an OpenGL
framebuffer object.
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.0
@@ -808,7 +808,7 @@ void QOpenGLFramebufferObjectPrivate::initDepthStencilAttachments(QOpenGLContext
\class QOpenGLFramebufferObject
\brief The QOpenGLFramebufferObject class encapsulates an OpenGL framebuffer object.
\since 5.0
- \inmodule QtGui
+ \inmodule QtOpenGL
\ingroup painting-3D
@@ -1405,7 +1405,7 @@ static QImage qt_gl_read_framebuffer(const QSize &size, GLenum internal_format,
return QImage();
}
-Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha)
+Q_OPENGL_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha)
{
return qt_gl_read_framebuffer(size, alpha_format ? GL_RGBA : GL_RGB, include_alpha, true);
}
diff --git a/src/gui/opengl/qopenglframebufferobject.h b/src/opengl/qopenglframebufferobject.h
index 161054d1bf..da3347eaec 100644
--- a/src/gui/opengl/qopenglframebufferobject.h
+++ b/src/opengl/qopenglframebufferobject.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -40,9 +40,7 @@
#ifndef QOPENGLFRAMEBUFFEROBJECT_H
#define QOPENGLFRAMEBUFFEROBJECT_H
-#include <QtGui/qtguiglobal.h>
-
-#ifndef QT_NO_OPENGL
+#include <QtOpenGL/qtopenglglobal.h>
#include <QtGui/qopengl.h>
#include <QtGui/qpaintdevice.h>
@@ -65,7 +63,7 @@ QT_BEGIN_NAMESPACE
class QOpenGLFramebufferObjectPrivate;
class QOpenGLFramebufferObjectFormat;
-class Q_GUI_EXPORT QOpenGLFramebufferObject
+class Q_OPENGL_EXPORT QOpenGLFramebufferObject
{
Q_DECLARE_PRIVATE(QOpenGLFramebufferObject)
public:
@@ -161,7 +159,7 @@ private:
};
class QOpenGLFramebufferObjectFormatPrivate;
-class Q_GUI_EXPORT QOpenGLFramebufferObjectFormat
+class Q_OPENGL_EXPORT QOpenGLFramebufferObjectFormat
{
public:
QOpenGLFramebufferObjectFormat();
@@ -195,6 +193,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_OPENGL
-
#endif // QOPENGLFRAMEBUFFEROBJECT_H
diff --git a/src/gui/opengl/qopenglframebufferobject_p.h b/src/opengl/qopenglframebufferobject_p.h
index 644bb6c59b..df87734a58 100644
--- a/src/gui/opengl/qopenglframebufferobject_p.h
+++ b/src/opengl/qopenglframebufferobject_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -51,7 +51,6 @@
// We mean it.
//
-#include <QtGui/private/qtguiglobal_p.h>
#include <qopenglframebufferobject.h>
#include <private/qopenglcontext_p.h>
#include <private/qopenglextensions_p.h>
@@ -147,6 +146,7 @@ public:
inline GLuint fbo() const { return fbo_guard ? fbo_guard->id() : 0; }
};
+Q_OPENGL_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
QT_END_NAMESPACE
diff --git a/src/opengl/qopenglwidget.cpp b/src/opengl/qopenglwidget.cpp
index b334ba867b..cf22a5e2df 100644
--- a/src/opengl/qopenglwidget.cpp
+++ b/src/opengl/qopenglwidget.cpp
@@ -39,7 +39,6 @@
#include "qopenglwidget.h"
#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLFramebufferObject>
#include <QtGui/QOffscreenSurface>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/QWindow>
@@ -47,12 +46,14 @@
#include <QtGui/QScreen>
#include <QtGui/qpa/qplatformwindow.h>
#include <QtGui/qpa/qplatformintegration.h>
+#include <QtOpenGL/QOpenGLFramebufferObject>
#include <QtOpenGL/QOpenGLPaintDevice>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/private/qopenglextensions_p.h>
#include <QtGui/private/qfont_p.h>
#include <QtGui/private/qopenglcontext_p.h>
+#include <QtOpenGL/private/qopenglframebufferobject_p.h>
#include <QtOpenGL/private/qopenglpaintdevice_p.h>
#include <QtWidgets/private/qwidget_p.h>
@@ -930,8 +931,6 @@ void QOpenGLWidgetPrivate::invalidateFbo()
}
}
-extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
-
QImage QOpenGLWidgetPrivate::grabFramebuffer()
{
Q_Q(QOpenGLWidget);
diff --git a/src/opengl/qopenglwindow.cpp b/src/opengl/qopenglwindow.cpp
index 5da20dc559..f473d849cf 100644
--- a/src/opengl/qopenglwindow.cpp
+++ b/src/opengl/qopenglwindow.cpp
@@ -38,13 +38,15 @@
****************************************************************************/
#include "qopenglwindow.h"
-#include <QtGui/QOpenGLFramebufferObject>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/private/qpaintdevicewindow_p.h>
#include <QtGui/private/qopenglextensions_p.h>
#include <QtGui/private/qopenglcontext_p.h>
#include <QtGui/QMatrix4x4>
#include <QtGui/QOffscreenSurface>
+
+#include <QtOpenGL/private/qopenglframebufferobject_p.h>
+#include <QtOpenGL/QOpenGLFramebufferObject>
#include <QtOpenGL/QOpenGLTextureBlitter>
#include <QtOpenGL/QOpenGLPaintDevice>
@@ -508,8 +510,6 @@ GLuint QOpenGLWindow::defaultFramebufferObject() const
return 0;
}
-extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
-
/*!
Returns a copy of the framebuffer.
diff --git a/src/platformsupport/platformcompositor/qopenglcompositor.cpp b/src/platformsupport/platformcompositor/qopenglcompositor.cpp
index 635bf0107f..abfaca3f9c 100644
--- a/src/platformsupport/platformcompositor/qopenglcompositor.cpp
+++ b/src/platformsupport/platformcompositor/qopenglcompositor.cpp
@@ -37,8 +37,8 @@
**
****************************************************************************/
+#include <QtOpenGL/QOpenGLFramebufferObject>
#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLFramebufferObject>
#include <QtGui/QWindow>
#include <qpa/qplatformbackingstore.h>
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index cf839e1931..03508056f3 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -26,11 +26,11 @@
**
****************************************************************************/
+#include <QtOpenGL/QOpenGLFramebufferObject>
#include <QtOpenGL/QOpenGLPaintDevice>
#include <QtOpenGL/QOpenGLTexture>
#include <QtOpenGL/qopengltextureblitter.h>
#include <QtGui/private/qopenglcontext_p.h>
-#include <QtGui/QOpenGLFramebufferObject>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/QOpenGLFunctions_4_2_Core>
#include <QtGui/QOpenGLVertexArrayObject>