diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-08-30 17:41:23 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-09-03 15:10:11 +0000 |
commit | cc1ea2bf47f386befff1a3a419588b5b422f0346 (patch) | |
tree | b4ba1b10a36443e11298a9c207e5d670be2a68f2 /src/gui/painting/qicc.cpp | |
parent | 098d7549c17919683a5ba1600f1fd9b6c3bc420f (diff) |
Simplify QColorSpace named presets
We don't need a getter for the 'preset' of a color-space, as color
spaces can be compared to the presets directly. This allows us to
remove the Undefined and Unknown values from the presets.
Internally we still distinguish known presets from unknown or undefined
presets via the magic 0-value. The validity of a QColorSpace is not
based on this preset, but on its actual values.
Fixes: QTBUG-77963
Change-Id: I1e0a2a4be83021b8c82b3c778019f680fd46455b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/painting/qicc.cpp')
-rw-r--r-- | src/gui/painting/qicc.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/painting/qicc.cpp b/src/gui/painting/qicc.cpp index 6cb7b57493..45b64de960 100644 --- a/src/gui/painting/qicc.cpp +++ b/src/gui/painting/qicc.cpp @@ -765,10 +765,9 @@ bool fromIccProfile(const QByteArray &data, QColorSpace *colorSpace) qCDebug(lcIcc) << "fromIccProfile: Description" << colorspaceDPtr->description; } - if (!colorspaceDPtr->identifyColorSpace()) - colorspaceDPtr->id = QColorSpace::Unknown; - else - qCDebug(lcIcc) << "fromIccProfile: Named colorspace detected: " << colorSpace->colorSpaceId(); + colorspaceDPtr->identifyColorSpace(); + if (colorspaceDPtr->namedColorSpace) + qCDebug(lcIcc) << "fromIccProfile: Named colorspace detected: " << QColorSpace::NamedColorSpace(colorspaceDPtr->namedColorSpace); colorspaceDPtr->iccProfile = data; |