summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-04-13 06:49:52 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-04-13 07:45:00 (GMT)
commit3ba6c3b7a4261147addc1d7fb06060dae7522691 (patch)
treecded7ec5f02e5f6ea082110185c6da2e03d514e9 /src/gui/kernel
parent0108e888480e47e65d82d94e10a7c7c910e42d79 (diff)
downloadQt-3ba6c3b7a4261147addc1d7fb06060dae7522691.zip
Qt-3ba6c3b7a4261147addc1d7fb06060dae7522691.tar.gz
Qt-3ba6c3b7a4261147addc1d7fb06060dae7522691.tar.bz2
Remove DefaultSharedContext from Lighthouse API.
QPlatformWindowFormat::setUseDefaultSharedContext was meant as a convenience, but it adds complexity in the platform plugin implementation, and can be implemented by the above layers using QPlatformWindowFormat::setSharedContext. Reviewed-by: Jørgen Lind
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qplatformglcontext_qpa.cpp18
-rw-r--r--src/gui/kernel/qplatformglcontext_qpa.h5
-rw-r--r--src/gui/kernel/qplatformwindowformat_qpa.cpp13
-rw-r--r--src/gui/kernel/qplatformwindowformat_qpa.h11
4 files changed, 3 insertions, 44 deletions
diff --git a/src/gui/kernel/qplatformglcontext_qpa.cpp b/src/gui/kernel/qplatformglcontext_qpa.cpp
index 86740e8..1810532 100644
--- a/src/gui/kernel/qplatformglcontext_qpa.cpp
+++ b/src/gui/kernel/qplatformglcontext_qpa.cpp
@@ -125,24 +125,6 @@ QPlatformGLContext::~QPlatformGLContext()
}
-
-/*!
- Makes it possible to set the context which can be the default for making new contexts.
-*/
-void QPlatformGLContext::setDefaultSharedContext(QPlatformGLContext *sharedContext)
-{
- QPlatformGLContextPrivate::staticSharedContext = sharedContext;
-}
-
-/*!
- Default shared context is intended to be a globally awailable pointer to a context which can
- be used for sharing resources when creating new contexts. Its default value is 0;
-*/
-QPlatformGLContext *QPlatformGLContext::defaultSharedContext()
-{
- return QPlatformGLContextPrivate::staticSharedContext;
-}
-
/*!
Reimplement in subclass to do makeCurrent on native GL context
*/
diff --git a/src/gui/kernel/qplatformglcontext_qpa.h b/src/gui/kernel/qplatformglcontext_qpa.h
index a680c85..28923a9 100644
--- a/src/gui/kernel/qplatformglcontext_qpa.h
+++ b/src/gui/kernel/qplatformglcontext_qpa.h
@@ -69,13 +69,10 @@ public:
virtual QPlatformWindowFormat platformWindowFormat() const = 0;
const static QPlatformGLContext *currentContext();
- static QPlatformGLContext *defaultSharedContext();
protected:
-
- static void setDefaultSharedContext(QPlatformGLContext *sharedContext);
-
QScopedPointer<QPlatformGLContextPrivate> d_ptr;
+
private:
//hack to make it work with QGLContext::CurrentContext
friend class QGLContext;
diff --git a/src/gui/kernel/qplatformwindowformat_qpa.cpp b/src/gui/kernel/qplatformwindowformat_qpa.cpp
index ddc6239..c165c85 100644
--- a/src/gui/kernel/qplatformwindowformat_qpa.cpp
+++ b/src/gui/kernel/qplatformwindowformat_qpa.cpp
@@ -53,7 +53,7 @@ public:
, opts(QPlatformWindowFormat::DoubleBuffer | QPlatformWindowFormat::DepthBuffer
| QPlatformWindowFormat::Rgba | QPlatformWindowFormat::DirectRendering
| QPlatformWindowFormat::StencilBuffer | QPlatformWindowFormat::DeprecatedFunctions
- | QPlatformWindowFormat::UseDefaultSharedContext | QPlatformWindowFormat::HasWindowSurface)
+ | QPlatformWindowFormat::HasWindowSurface)
, depthSize(-1)
, accumSize(-1)
, stencilSize(-1)
@@ -525,16 +525,6 @@ void QPlatformWindowFormat::setSampleBuffers(bool enable)
setOption(enable ? QPlatformWindowFormat::SampleBuffers : QPlatformWindowFormat::NoSampleBuffers);
}
-void QPlatformWindowFormat::setUseDefaultSharedContext(bool enable)
-{
- if (enable) {
- setOption(QPlatformWindowFormat::UseDefaultSharedContext);
- d->sharedContext = 0;
- } else {
- setOption(QPlatformWindowFormat::NoDefaultSharedContext);
- }
-}
-
/*!
Returns the number of samples per pixel when multisampling is
enabled. By default, the highest number of samples that is
@@ -613,7 +603,6 @@ QPlatformWindowFormat::WindowApi QPlatformWindowFormat::windowApi() const
void QPlatformWindowFormat::setSharedContext(QPlatformGLContext *context)
{
- setUseDefaultSharedContext(false);
d->sharedContext = context;
}
diff --git a/src/gui/kernel/qplatformwindowformat_qpa.h b/src/gui/kernel/qplatformwindowformat_qpa.h
index fa01a8a..ba21ba4 100644
--- a/src/gui/kernel/qplatformwindowformat_qpa.h
+++ b/src/gui/kernel/qplatformwindowformat_qpa.h
@@ -66,8 +66,7 @@ public:
HasOverlay = 0x0100,
SampleBuffers = 0x0200,
DeprecatedFunctions = 0x0400,
- UseDefaultSharedContext = 0x0800,
- HasWindowSurface = 0x1000,
+ HasWindowSurface = 0x0800,
SingleBuffer = DoubleBuffer << 16,
NoDepthBuffer = DepthBuffer << 16,
ColorIndex = Rgba << 16,
@@ -79,7 +78,6 @@ public:
NoOverlay = HasOverlay << 16,
NoSampleBuffers = SampleBuffers << 16,
NoDeprecatedFunctions = DeprecatedFunctions << 16,
- NoDefaultSharedContext = UseDefaultSharedContext << 16,
NoWindowSurface = HasWindowSurface << 16
};
@@ -149,8 +147,6 @@ public:
void setStereo(bool enable);
bool directRendering() const;
void setDirectRendering(bool enable);
- bool useDefaultSharedContext() const;
- void setUseDefaultSharedContext(bool enable);
bool hasWindowSurface() const;
void setWindowSurface(bool enable);
@@ -231,11 +227,6 @@ inline bool QPlatformWindowFormat::sampleBuffers() const
return testOption(QPlatformWindowFormat::SampleBuffers);
}
-inline bool QPlatformWindowFormat::useDefaultSharedContext() const
-{
- return testOption(QPlatformWindowFormat::UseDefaultSharedContext);
-}
-
QT_END_NAMESPACE
QT_END_HEADER