summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformwindowformat_qpa.h
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-07-23 09:46:23 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2010-07-23 13:28:36 +0200
commit699d74a9fae0b2d03e5c74bfb9590f6f0809ef4e (patch)
treeb5a5b787558e74497b84dbcd73ff614e7642630f /src/gui/kernel/qplatformwindowformat_qpa.h
parentbe08fbc13f7370b6cc0c34660b4d1c16e4fdd3f5 (diff)
Make it possible to have shared contexts to Lighthouse
This adds a getter to QPlatformGLContext for the "default shared context". The setter is protected as it is the plugins responsibillity to create it or not. QPlatformWindowFormat has also gotten a pointer to a QPlatformGLContext for a non default shared context. Only implemented shared contexts in testlite for now.
Diffstat (limited to 'src/gui/kernel/qplatformwindowformat_qpa.h')
-rw-r--r--src/gui/kernel/qplatformwindowformat_qpa.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gui/kernel/qplatformwindowformat_qpa.h b/src/gui/kernel/qplatformwindowformat_qpa.h
index 3c5f9079a4..37e628d247 100644
--- a/src/gui/kernel/qplatformwindowformat_qpa.h
+++ b/src/gui/kernel/qplatformwindowformat_qpa.h
@@ -64,6 +64,7 @@ public:
HasOverlay = 0x0100,
SampleBuffers = 0x0200,
DeprecatedFunctions = 0x0400,
+ UseDefaultSharedContext = 0x0800,
SingleBuffer = DoubleBuffer << 16,
NoDepthBuffer = DepthBuffer << 16,
ColorIndex = Rgba << 16,
@@ -74,7 +75,9 @@ public:
IndirectRendering = DirectRendering << 16,
NoOverlay = HasOverlay << 16,
NoSampleBuffers = SampleBuffers << 16,
- NoDeprecatedFunctions = DeprecatedFunctions << 16
+ NoDeprecatedFunctions = DeprecatedFunctions << 16,
+ NoDefaultSharedContext = UseDefaultSharedContext << 16
+
};
Q_DECLARE_FLAGS(FormatOptions, FormatOption)
@@ -123,6 +126,9 @@ public:
void setWindowApi(QPlatformWindowFormat::WindowApi api);
WindowApi windowApi() const;
+ void setSharedContext(QPlatformGLContext *context);
+ QPlatformGLContext *sharedGLContext() const;
+
bool doubleBuffer() const;
void setDoubleBuffer(bool enable);
bool depth() const;
@@ -139,6 +145,8 @@ public:
void setStereo(bool enable);
bool directRendering() const;
void setDirectRendering(bool enable);
+ bool useDefaultSharedContext() const;
+ void setUseDefaultSharedContext(bool enable);
// bool hasOverlay() const;
// void setOverlay(bool enable);
@@ -148,9 +156,6 @@ public:
static QPlatformWindowFormat defaultFormat();
static void setDefaultFormat(const QPlatformWindowFormat& f);
-// static QPlatformWindowFormat defaultOverlayFormat();
-// static void setDefaultOverlayFormat(const QPlatformWindowFormat& f);
-
private:
QPlatformWindowFormatPrivate *d;
@@ -215,6 +220,10 @@ inline bool QPlatformWindowFormat::sampleBuffers() const
return testOption(QPlatformWindowFormat::SampleBuffers);
}
+inline bool QPlatformWindowFormat::useDefaultSharedContext() const
+{
+ return testOption(QPlatformWindowFormat::UseDefaultSharedContext);
+}
QT_END_NAMESPACE