summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsurfaceformat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qsurfaceformat.cpp')
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index c3048518da..366e68ebe3 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -42,6 +42,7 @@
#include <QtCore/qatomic.h>
#include <QtCore/QDebug>
#include <QOpenGLContext>
+#include <QtGui/qcolorspace.h>
#include <QtGui/qguiapplication.h>
#ifdef major
@@ -73,7 +74,6 @@ public:
, major(2)
, minor(0)
, swapInterval(1) // default to vsync
- , colorSpace(QSurfaceFormat::DefaultColorSpace)
{
}
@@ -112,7 +112,7 @@ public:
int major;
int minor;
int swapInterval;
- QSurfaceFormat::ColorSpace colorSpace;
+ QColorSpace colorSpace;
};
/*!
@@ -732,11 +732,11 @@ int QSurfaceFormat::swapInterval() const
blending to be performed in the given color space instead of using the
standard linear operations.
- \since 5.10
+ \since 6.0
\sa colorSpace()
*/
-void QSurfaceFormat::setColorSpace(ColorSpace colorSpace)
+void QSurfaceFormat::setColorSpace(const QColorSpace &colorSpace)
{
if (d->colorSpace != colorSpace) {
detach();
@@ -745,13 +745,34 @@ void QSurfaceFormat::setColorSpace(ColorSpace colorSpace)
}
/*!
+ \overload
+
+ Sets the colorspace to one of the predefined values.
+
+ \since 5.10
+
+ \sa colorSpace()
+ */
+void QSurfaceFormat::setColorSpace(ColorSpace colorSpace)
+{
+ switch (colorSpace) {
+ case DefaultColorSpace:
+ setColorSpace(QColorSpace());
+ break;
+ case sRGBColorSpace:
+ setColorSpace(QColorSpace::SRgb);
+ break;
+ }
+}
+
+/*!
\return the color space.
\since 5.10
\sa setColorSpace()
*/
-QSurfaceFormat::ColorSpace QSurfaceFormat::colorSpace() const
+const QColorSpace &QSurfaceFormat::colorSpace() const
{
return d->colorSpace;
}