diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-07 17:25:22 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-10 09:24:56 +0200 |
commit | 4a189c188ccd2fb5f8d1d5ddadf06cbd6bc0916f (patch) | |
tree | 99bff9f015e869b5521836ea5667590939b22a53 /src/widgets | |
parent | 4d10e64f2a78e32418a98e1c80c6579ae0779dfc (diff) |
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.
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qwidget.h | 1 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget_qpa.cpp | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index 47007726a8..2be5e5f52d 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -58,7 +58,6 @@ #ifdef Q_WS_QPA //should this go somewhere else? #include <QtGui/qwindow.h> -#include <QtGui/qwindowformat_qpa.h> #endif #ifdef QT_INCLUDE_COMPAT diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 66a1a4ce35..3363ad7454 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -48,6 +48,7 @@ #include "private/qapplication_p.h" #include "QtWidgets/qdesktopwidget.h" #include "QtGui/qplatformwindow_qpa.h" +#include "QtGui/qguiglformat_qpa.h" #include "QtGui/qplatformglcontext_qpa.h" #include "QtGui/private/qwindow_p.h" @@ -107,9 +108,9 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO win->setGeometry(q->geometry()); if (q->testAttribute(Qt::WA_TranslucentBackground)) { - QWindowFormat format = win->requestedWindowFormat(); + QGuiGLFormat format; format.setAlphaBufferSize(8); - win->setWindowFormat(format); + win->setGLFormat(format); } if (QWidget *nativeParent = q->nativeParentWidget()) { |