diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2023-08-15 18:49:55 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-08-26 00:10:25 +0000 |
commit | 71103c2e691fe7beb51dff5d49c5721a96430c7d (patch) | |
tree | 967566b917589ca1436bac119e94d6018a11de19 | |
parent | 8ee3871d81a29fb7b4a8c30a439002373a1e323d (diff) |
Remove undocumented HDR mode getter/setter from QQuickGr.Conf
Added in 6.6 as \internal but concluded that it is too
limited in this form.
Added originally for consistency, so that at least
QSG_RHI_HDR=auto (where said "auto" mode is also
new in 6.6) has a C++ equivalent, as is the custom
with QSG_* and QQuickGraphicsConfiguration, but it
is becoming clear that an "auto" option makes no sense
in practice.
A better and more holistic long-term plan is to handle
this in the Gui layer (e.g. QSurfaceFormat) eventually.
In the meantime, the env.var. (QSG_RHI_HDR) continues to
function like before with explicit format keys ("scrgb",
"hdr10").
Change-Id: Iea667d7e46ffafa33fdff342d4ed749bdb1cfd4b
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 5ec73a8f4af9838ce13e4e72e8fb253d4c7f26aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quick/items/qquickgraphicsconfiguration.cpp | 53 | ||||
-rw-r--r-- | src/quick/items/qquickgraphicsconfiguration.h | 3 | ||||
-rw-r--r-- | src/quick/items/qquickgraphicsconfiguration_p.h | 3 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrhisupport.cpp | 6 |
4 files changed, 1 insertions, 64 deletions
diff --git a/src/quick/items/qquickgraphicsconfiguration.cpp b/src/quick/items/qquickgraphicsconfiguration.cpp index c399b308f0..194ff7932b 100644 --- a/src/quick/items/qquickgraphicsconfiguration.cpp +++ b/src/quick/items/qquickgraphicsconfiguration.cpp @@ -803,55 +803,6 @@ QString QQuickGraphicsConfiguration::pipelineCacheLoadFile() const return d->pipelineCacheLoadFile; } -/*! - \internal - - When enabled, and the platform and the underlying 3D API supports it, the - window will be using high/extended dynamic range rendering. This implies - that the display on which the window is opened has HDR output enabled in - the windowing system. - - If the request cannot be fulfilled, it is gracefully ignored and the window - is created with the normal standard dynamic range. - - By default the value is \c false. - - \note This setting controls the window, swapchain, color buffer, and - related settings. It does not automatically make a Qt Quick scene with SDR - content suitable to be displayed in a HDR-enabled QQuickWindow. - - To determine what color space and color buffer format got enabled, query - the \l{QQuickWindow::swapChain()}{swapchain} from the window once the - \l{QQuickWindow::sceneGraphInitialized()}{scene graph has initialized}, and - inspect its \l{QRhiSwapChain::format()}{format}. - - \sa isHdrEnabled() - */ -void QQuickGraphicsConfiguration::setHdr(bool enable) -{ - if (d->flags.testFlag(QQuickGraphicsConfigurationPrivate::EnableHdr) != enable) { - detach(); - d->flags.setFlag(QQuickGraphicsConfigurationPrivate::EnableHdr, enable); - } -} - -/*! - \internal - - \return true if HDR output was requested. - - By default the value is false. - - \note This says nothing about a HDR output format being actually supported; - a return value of \c true merely indicates the application's request. - - \sa setHdr() - */ -bool QQuickGraphicsConfiguration::isHdrEnabled() const -{ - return d->flags.testFlag(QQuickGraphicsConfigurationPrivate::EnableHdr); -} - QQuickGraphicsConfigurationPrivate::QQuickGraphicsConfigurationPrivate() : ref(1) { @@ -889,10 +840,6 @@ QQuickGraphicsConfigurationPrivate::QQuickGraphicsConfigurationPrivate() static const QString pipelineCacheLoadFileEnv = qEnvironmentVariable("QSG_RHI_PIPELINE_CACHE_LOAD"); pipelineCacheLoadFile = pipelineCacheLoadFileEnv; - - static const QByteArray hdrRequest = qgetenv("QSG_RHI_HDR"); - if (hdrRequest == QByteArrayLiteral("auto")) - flags |= EnableHdr; } QQuickGraphicsConfigurationPrivate::QQuickGraphicsConfigurationPrivate(const QQuickGraphicsConfigurationPrivate *other) diff --git a/src/quick/items/qquickgraphicsconfiguration.h b/src/quick/items/qquickgraphicsconfiguration.h index 00a599f1e6..95777a1c51 100644 --- a/src/quick/items/qquickgraphicsconfiguration.h +++ b/src/quick/items/qquickgraphicsconfiguration.h @@ -49,9 +49,6 @@ public: void setPipelineCacheLoadFile(const QString &filename); QString pipelineCacheLoadFile() const; - void setHdr(bool enable); - bool isHdrEnabled() const; - private: void detach(); QQuickGraphicsConfigurationPrivate *d; diff --git a/src/quick/items/qquickgraphicsconfiguration_p.h b/src/quick/items/qquickgraphicsconfiguration_p.h index 2c75b337f4..4d79202073 100644 --- a/src/quick/items/qquickgraphicsconfiguration_p.h +++ b/src/quick/items/qquickgraphicsconfiguration_p.h @@ -35,8 +35,7 @@ public: EnableDebugMarkers = 0x04, PreferSoftwareDevice = 0x08, AutoPipelineCache = 0x10, - EnableTimestamps = 0x20, - EnableHdr = 0x40 + EnableTimestamps = 0x20 }; Q_DECLARE_FLAGS(Flags, Flag) diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp index 487553ec69..d77de04991 100644 --- a/src/quick/scenegraph/qsgrhisupport.cpp +++ b/src/quick/scenegraph/qsgrhisupport.cpp @@ -1514,12 +1514,6 @@ void QSGRhiSupport::applySwapChainFormat(QRhiSwapChain *scWithWindowSet, QQuickW QRhiSwapChain::Format swapChainFormat = QRhiSwapChain::SDR; - if (window->graphicsConfiguration().isHdrEnabled()) { - const QRhiSwapChain::Format autoFormat = QRhiSwapChain::HDRExtendedSrgbLinear; - if (scWithWindowSet->isFormatSupported(autoFormat)) - swapChainFormat = autoFormat; - } - QByteArray hdrRequest = qgetenv("QSG_RHI_HDR"); if (!hdrRequest.isEmpty()) { hdrRequest = hdrRequest.toLower(); |