summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-10-18 11:46:13 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-18 15:47:49 +0200
commit08e24858607d1b1483fb1faa54effa957501cfbb (patch)
tree826652c9f5730601503ee0b715499f78b0486671 /src/gui/kernel
parent36eb5fb732b8c5327fe5e072f42a9e61e7bf2ab2 (diff)
QSurfaceFormat: Use version in comparison and debug, fix setter.
Change-Id: Id123ca9366b97a172e08a4608ccdffafb7caaf09 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index 1919e2d282..6326033ff2 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -391,7 +391,10 @@ QSurfaceFormat::OpenGLContextProfile QSurfaceFormat::profile() const
*/
void QSurfaceFormat::setMajorVersion(int major)
{
- d->major = major;
+ if (d->major != major) {
+ detach();
+ d->major = major;
+ }
}
/*!
@@ -407,7 +410,10 @@ int QSurfaceFormat::majorVersion() const
*/
void QSurfaceFormat::setMinorVersion(int minor)
{
- d->minor = minor;
+ if (d->minor != minor) {
+ detach();
+ d->minor = minor;
+ }
}
/*!
@@ -429,10 +435,11 @@ bool operator==(const QSurfaceFormat& a, const QSurfaceFormat& b)
&& a.d->depthSize == b.d->depthSize
&& a.d->numSamples == b.d->numSamples
&& a.d->swapBehavior == b.d->swapBehavior
- && a.d->profile == b.d->profile);
+ && a.d->profile == b.d->profile
+ && a.d->major == b.d->major
+ && a.d->minor == b.d->minor);
}
-
/*!
Returns false if all the options of the two QSurfaceFormat objects
\a a and \a b are equal; otherwise returns true.
@@ -451,7 +458,8 @@ QDebug operator<<(QDebug dbg, const QSurfaceFormat &f)
const QSurfaceFormatPrivate * const d = f.d;
dbg.nospace() << "QSurfaceFormat("
- << "options " << d->opts
+ << "version " << d->major << '.' << d->minor
+ << ", options " << d->opts
<< ", depthBufferSize " << d->depthSize
<< ", redBufferSize " << d->redBufferSize
<< ", greenBufferSize " << d->greenBufferSize