From ef77e8b65149a29a541044239fccf5e14b95e94d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 26 Apr 2011 16:21:58 +0200 Subject: Added QWindowContext and got wiggly up and running with xcb. (cherry picked from commit c980e4ef4ebc7699a6c3a7529d3f08ebafc21ffe) --- src/opengl/qgl.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index c57995d8d0..55a06b5483 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -49,7 +49,7 @@ #include #ifdef Q_WS_QPA -#include +#include #endif QT_BEGIN_HEADER @@ -283,8 +283,8 @@ public: static OpenGLVersionFlags openGLVersionFlags(); #if defined(Q_WS_QPA) - static QGLFormat fromPlatformWindowFormat(const QPlatformWindowFormat &format); - static QPlatformWindowFormat toPlatformWindowFormat(const QGLFormat &format); + static QGLFormat fromWindowFormat(const QWindowFormat &format); + static QWindowFormat toWindowFormat(const QGLFormat &format); #endif private: QGLFormatPrivate *d; @@ -393,7 +393,7 @@ public: static const QGLContext* currentContext(); #ifdef Q_WS_QPA - static QGLContext *fromPlatformGLContext(QPlatformGLContext *platformContext); + static QGLContext *fromWindowContext(QWindowContext *platformContext); #endif protected: virtual bool chooseContext(const QGLContext* shareContext = 0); @@ -425,7 +425,7 @@ protected: private: #ifdef Q_WS_QPA - QGLContext(QPlatformGLContext *platformContext); + QGLContext(QWindowContext *windowContext); #endif QScopedPointer d_ptr; -- cgit v1.2.3 From aa566e72972fd3b56f1c004153eb53792bdbfb10 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 7 May 2011 21:24:37 +0200 Subject: some build fixes --- src/opengl/qgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 730e52ba8f..30a8a32cfe 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -42,7 +42,7 @@ #ifndef QGL_H #define QGL_H -#include +#include #include #include #include -- cgit v1.2.3 From 864815ef2efbc3b5dca2a645c1b63f9bb67285d0 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Wed, 18 May 2011 12:09:17 +0200 Subject: Port Qt 5 to Mac. --- src/opengl/qgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 30a8a32cfe..15782dd319 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -58,7 +58,7 @@ QT_BEGIN_HEADER # include #endif -#if defined(Q_WS_MAC) +#if defined(Q_OS_MAC) # include #elif defined(QT_OPENGL_ES_1) # if defined(Q_OS_MAC) -- cgit v1.2.3 From 4a189c188ccd2fb5f8d1d5ddadf06cbd6bc0916f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 7 Jun 2011 17:25:22 +0200 Subject: QWindowContext / QWindowFormat refactor. To enable having a single GL context used for multiple drawables we need to de-couple the context class a bit more from the window class in the plugin API. Now contexts are created stand-alone based on a GL format and a share context, and when calling makeCurrent() a desired surface is specified. This maps well to GLX, EGL, Cocoa, AGL, and WGL, which all support this use case. QWindowContext is renamed to QGuiGLContext, and QWindowFormat is renamed to QGuiGLFormat. We have the ability to introduce a pbuffer or similar other offscreen GL drawable abstraction in the future. --- src/opengl/qgl.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 7e151184c8..7b0a237e83 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -49,7 +49,7 @@ #include #ifdef Q_WS_QPA -#include +#include #endif QT_BEGIN_HEADER @@ -283,8 +283,8 @@ public: static OpenGLVersionFlags openGLVersionFlags(); #if defined(Q_WS_QPA) - static QGLFormat fromWindowFormat(const QWindowFormat &format); - static QWindowFormat toWindowFormat(const QGLFormat &format); + static QGLFormat fromGuiGLFormat(const QGuiGLFormat &format); + static QGuiGLFormat toGuiGLFormat(const QGLFormat &format); #endif private: QGLFormatPrivate *d; @@ -397,7 +397,7 @@ public: static const QGLContext* currentContext(); #ifdef Q_WS_QPA - static QGLContext *fromWindowContext(QWindowContext *platformContext); + static QGLContext *fromGuiGLContext(QGuiGLContext *platformContext); #endif protected: virtual bool chooseContext(const QGLContext* shareContext = 0); @@ -429,7 +429,7 @@ protected: private: #ifdef Q_WS_QPA - QGLContext(QWindowContext *windowContext); + QGLContext(QGuiGLContext *windowContext); #endif QScopedPointer d_ptr; -- cgit v1.2.3 From 6ce6b8a378b0d97ba950240ffb048a4b7e485235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 20 Jun 2011 13:29:26 +0200 Subject: Rename QWindowSurface -> QBackingStore and split into platform / public. Also get rid of GL window surface and related classes. --- src/opengl/qgl.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 7b0a237e83..f6051fa179 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -444,8 +444,6 @@ private: friend class QGL2PaintEngineEx; friend class QGL2PaintEngineExPrivate; friend class QGLEngineShaderManager; - friend class QGLWindowSurface; - friend class QGLPixmapData; friend class QGLPixmapFilterBase; friend class QGLTextureGlyphCache; friend struct QGLGlyphTexture; @@ -467,7 +465,6 @@ private: friend class QGLFBOGLPaintDevice; friend class QGLPaintDevice; friend class QGLWidgetGLPaintDevice; - friend class QX11GLPixmapData; friend class QX11GLSharedContexts; friend class QGLContextResourceBase; friend class QSGDistanceFieldGlyphCache; -- cgit v1.2.3 From 176f30b13739b352cbe453cba7796d9a9c808bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 21 Jun 2011 13:39:26 +0200 Subject: OpenGL API refactor. Rename QGuiGLFormat to QSurfaceFormat, and make QWindow sub-class of QSurface and QPlatformWindow sub-class of QPlatformSurface, instead of having QPlatformGLSurface accessor in QWindow. --- src/opengl/qgl.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index f6051fa179..c9908ad01f 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -48,9 +48,7 @@ #include #include -#ifdef Q_WS_QPA -#include -#endif +#include QT_BEGIN_HEADER @@ -282,10 +280,8 @@ public: static OpenGLVersionFlags openGLVersionFlags(); -#if defined(Q_WS_QPA) - static QGLFormat fromGuiGLFormat(const QGuiGLFormat &format); - static QGuiGLFormat toGuiGLFormat(const QGLFormat &format); -#endif + static QGLFormat fromSurfaceFormat(const QSurfaceFormat &format); + static QSurfaceFormat toSurfaceFormat(const QGLFormat &format); private: QGLFormatPrivate *d; -- cgit v1.2.3 From 8ab2f3d9bdf1119cc13567c9dd2c74879c0b0ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 23 Jun 2011 15:37:37 +0200 Subject: Get declarative and wayland EGL backend working for Qt compositor. --- src/opengl/qgl.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index c9908ad01f..28c56a969a 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -394,7 +394,9 @@ public: #ifdef Q_WS_QPA static QGLContext *fromGuiGLContext(QGuiGLContext *platformContext); + QGuiGLContext *contextHandle() const; #endif + protected: virtual bool chooseContext(const QGLContext* shareContext = 0); -- cgit v1.2.3 From 54ec6d177e0e8fb04cd01e70461484a80ca1f7a4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 11 Jul 2011 14:05:09 +0200 Subject: Bring OpenGL closer to compiling on Windows. Change-Id: I8ebb459f27a1054f8cb5524d2ff77988c6153557 Reviewed-on: http://codereview.qt.nokia.com/1421 Reviewed-by: Qt Sanity Bot Reviewed-by: Oliver Wolff --- src/opengl/qgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 26c0025342..e08e2d234f 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -52,7 +52,7 @@ QT_BEGIN_HEADER -#if defined(Q_WS_WIN) +#if defined(Q_OS_WIN) # include #endif -- cgit v1.2.3 From 0d5170256c1658b0f6e0d3f6c736de01655b29d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 16 Aug 2011 12:53:04 +0200 Subject: Get rid of OpenGL 1.x engine and platform code from QtOpenGL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I646b8e26d5e7214432a044866764d57cc11b2390 Reviewed-on: http://codereview.qt.nokia.com/3006 Reviewed-by: Qt Sanity Bot Reviewed-by: Jørgen Lind --- src/opengl/qgl.h | 91 -------------------------------------------------------- 1 file changed, 91 deletions(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index e08e2d234f..3446e29029 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -58,18 +58,6 @@ QT_BEGIN_HEADER #if defined(Q_OS_MAC) # include -#elif defined(QT_OPENGL_ES_1) -# if defined(Q_OS_MAC) -# include -# else -# include -# endif -# ifndef GL_DOUBLE -# define GL_DOUBLE GL_FLOAT -# endif -# ifndef GLdouble -typedef GLfloat GLdouble; -# endif #elif defined(QT_OPENGL_ES_2) # if defined(Q_OS_MAC) # include @@ -94,31 +82,6 @@ QT_BEGIN_NAMESPACE QT_MODULE(OpenGL) -#if defined(Q_WS_MAC) && defined (QT_BUILD_OPENGL_LIB) && !defined(QT_MAC_USE_COCOA) && !defined(QDOC) -#define Q_MAC_COMPAT_GL_FUNCTIONS - -template -struct QMacGLCompatTypes -{ - typedef long CompatGLint; - typedef unsigned long CompatGLuint; - typedef unsigned long CompatGLenum; -}; - -template <> -struct QMacGLCompatTypes -{ - typedef int CompatGLint; - typedef unsigned int CompatGLuint; - typedef unsigned int CompatGLenum; -}; - -typedef QMacGLCompatTypes::CompatGLint QMacCompatGLint; -typedef QMacGLCompatTypes::CompatGLuint QMacCompatGLuint; -typedef QMacGLCompatTypes::CompatGLenum QMacCompatGLenum; - -#endif - #ifdef QT3_SUPPORT #define QGL_VERSION 460 #define QGL_VERSION_STR "4.6" @@ -132,9 +95,6 @@ class QGLCmap; #endif class QPixmap; -#if defined(Q_WS_X11) && !defined(QT_OPENGL_ES) -class QGLOverlayWidget; -#endif class QGLWidgetPrivate; class QGLContextPrivate; @@ -371,22 +331,6 @@ public: void drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget = GL_TEXTURE_2D); void drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget = GL_TEXTURE_2D); -#ifdef Q_MAC_COMPAT_GL_FUNCTIONS - GLuint bindTexture(const QImage &image, QMacCompatGLenum = GL_TEXTURE_2D, - QMacCompatGLint format = GL_RGBA); - GLuint bindTexture(const QPixmap &pixmap, QMacCompatGLenum = GL_TEXTURE_2D, - QMacCompatGLint format = GL_RGBA); - GLuint bindTexture(const QImage &image, QMacCompatGLenum, QMacCompatGLint format, - BindOptions); - GLuint bindTexture(const QPixmap &pixmap, QMacCompatGLenum, QMacCompatGLint format, - BindOptions); - - void deleteTexture(QMacCompatGLuint tx_id); - - void drawTexture(const QRectF &target, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget = GL_TEXTURE_2D); - void drawTexture(const QPointF &point, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget = GL_TEXTURE_2D); -#endif - static void setTextureCacheLimit(int size); static int textureCacheLimit(); @@ -396,25 +340,12 @@ public: static const QGLContext* currentContext(); -#ifdef Q_WS_QPA static QGLContext *fromGuiGLContext(QGuiGLContext *platformContext); QGuiGLContext *contextHandle() const; -#endif protected: virtual bool chooseContext(const QGLContext* shareContext = 0); -#if defined(Q_WS_WIN) - virtual int choosePixelFormat(void* pfd, HDC pdc); -#endif -#if defined(Q_WS_X11) && defined(QT_NO_EGL) - virtual void* tryVisual(const QGLFormat& f, int bufDepth = 1); - virtual void* chooseVisual(); -#endif -#if defined(Q_WS_MAC) - virtual void* chooseMacVisual(GDHandle); -#endif - bool deviceIsPixmap() const; bool windowCreated() const; void setWindowCreated(bool on); @@ -430,9 +361,7 @@ protected: static QGLContext* currentCtx; private: -#ifdef Q_WS_QPA QGLContext(QGuiGLContext *windowContext); -#endif QScopedPointer d_ptr; @@ -441,12 +370,9 @@ private: friend class QGLWidget; friend class QGLWidgetPrivate; friend class QGLGlyphCache; - friend class QOpenGLPaintEngine; - friend class QOpenGLPaintEnginePrivate; friend class QGL2PaintEngineEx; friend class QGL2PaintEngineExPrivate; friend class QGLEngineShaderManager; - friend class QGLPixmapFilterBase; friend class QGLTextureGlyphCache; friend struct QGLGlyphTexture; friend class QGLContextGroup; @@ -553,22 +479,6 @@ public: void drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget = GL_TEXTURE_2D); void drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget = GL_TEXTURE_2D); -#ifdef Q_MAC_COMPAT_GL_FUNCTIONS - GLuint bindTexture(const QImage &image, QMacCompatGLenum = GL_TEXTURE_2D, - QMacCompatGLint format = GL_RGBA); - GLuint bindTexture(const QPixmap &pixmap, QMacCompatGLenum = GL_TEXTURE_2D, - QMacCompatGLint format = GL_RGBA); - GLuint bindTexture(const QImage &image, QMacCompatGLenum, QMacCompatGLint format, - QGLContext::BindOptions); - GLuint bindTexture(const QPixmap &pixmap, QMacCompatGLenum, QMacCompatGLint format, - QGLContext::BindOptions); - - void deleteTexture(QMacCompatGLuint tx_id); - - void drawTexture(const QRectF &target, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget = GL_TEXTURE_2D); - void drawTexture(const QPointF &point, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget = GL_TEXTURE_2D); -#endif - public Q_SLOTS: virtual void updateGL(); virtual void updateOverlayGL(); @@ -610,7 +520,6 @@ private: friend class QGLContext; friend class QGLContextPrivate; friend class QGLOverlayWidget; - friend class QOpenGLPaintEngine; friend class QGLPaintDevice; friend class QGLWidgetGLPaintDevice; }; -- cgit v1.2.3 From 78056064cc4e99162d1c4d82db36b5102d524f55 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 17 Aug 2011 11:47:25 +0200 Subject: Build fix after setPreferredPaintEngine was removed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I286529e0e1917ee3c808eba7dad0957dd4d8194f Reviewed-on: http://codereview.qt.nokia.com/3083 Reviewed-by: Qt Sanity Bot Reviewed-by: Samuel Rødal --- src/opengl/qgl.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 3446e29029..c25ea16e43 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -101,8 +101,6 @@ class QGLContextPrivate; // Namespace class: namespace QGL { - Q_OPENGL_EXPORT void setPreferredPaintEngine(QPaintEngine::Type engineType); - enum FormatOption { DoubleBuffer = 0x0001, DepthBuffer = 0x0002, -- cgit v1.2.3 From aaa4a26f82f99fa8724841eba91bad029306e0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 16 Aug 2011 09:29:44 +0200 Subject: Move GL resource handling enablers to QtGui. Made resource handling more robust by attempting to free GL resources in the correct thread, and not forcing a context to become current to free resources. Change-Id: Ie81d4005b608972375755571d9b50ce82080709b Reviewed-on: http://codereview.qt.nokia.com/3258 Reviewed-by: Qt Sanity Bot Reviewed-by: Gunnar Sletta --- src/opengl/qgl.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index c25ea16e43..a12cddcca4 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -374,7 +374,6 @@ private: friend class QGLTextureGlyphCache; friend struct QGLGlyphTexture; friend class QGLContextGroup; - friend class QGLSharedResourceGuard; friend class QGLPixmapBlurFilter; friend class QGLExtensions; friend class QGLTexture; -- cgit v1.2.3 From 6e28e8441b698c3397c2c78125c877f2e9867cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 22 Aug 2011 10:49:28 +0200 Subject: Copy core GL functionality to QtGui with QGL -> QOpenGL naming. Change-Id: Ibc989afa4a30dd184d41d1a1cd89f97196e48855 Reviewed-on: http://codereview.qt.nokia.com/3710 Reviewed-by: Gunnar Sletta --- src/opengl/qgl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/opengl/qgl.h') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index a12cddcca4..665dcac412 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -338,8 +338,8 @@ public: static const QGLContext* currentContext(); - static QGLContext *fromGuiGLContext(QGuiGLContext *platformContext); - QGuiGLContext *contextHandle() const; + static QGLContext *fromOpenGLContext(QOpenGLContext *platformContext); + QOpenGLContext *contextHandle() const; protected: virtual bool chooseContext(const QGLContext* shareContext = 0); @@ -359,7 +359,7 @@ protected: static QGLContext* currentCtx; private: - QGLContext(QGuiGLContext *windowContext); + QGLContext(QOpenGLContext *windowContext); QScopedPointer d_ptr; -- cgit v1.2.3