core: Add support for HDR and color management protocols (#8715)
This commit is contained in:
parent
95542e4488
commit
830350a1f7
18 changed files with 3000 additions and 0 deletions
|
|
@ -55,6 +55,8 @@
|
|||
#include "../protocols/core/Subcompositor.hpp"
|
||||
#include "../protocols/core/Output.hpp"
|
||||
#include "../protocols/core/Shm.hpp"
|
||||
#include "../protocols/ColorManagement.hpp"
|
||||
#include "../protocols/FrogColorManagement.hpp"
|
||||
|
||||
#include "../helpers/Monitor.hpp"
|
||||
#include "../render/Renderer.hpp"
|
||||
|
|
@ -77,11 +79,15 @@ void CProtocolManager::onMonitorModeChange(PHLMONITOR pMonitor) {
|
|||
PROTO::outputs.erase(pMonitor->szName);
|
||||
PROTO::outputs.emplace(pMonitor->szName, makeShared<CWLOutputProtocol>(&wl_output_interface, 4, std::format("WLOutput ({})", pMonitor->szName), pMonitor->self.lock()));
|
||||
}
|
||||
|
||||
if (PROTO::colorManagement && g_pCompositor->shouldChangePreferredImageDescription())
|
||||
PROTO::colorManagement->onImagePreferredChanged();
|
||||
}
|
||||
|
||||
CProtocolManager::CProtocolManager() {
|
||||
|
||||
static const auto PENABLEEXPLICIT = CConfigValue<Hyprlang::INT>("render:explicit_sync");
|
||||
static const auto PENABLEXXCM = CConfigValue<Hyprlang::INT>("experimental:xx_color_management_v4");
|
||||
|
||||
// Outputs are a bit dumb, we have to agree.
|
||||
static auto P = g_pHookSystem->hookDynamic("monitorAdded", [this](void* self, SCallbackInfo& info, std::any param) {
|
||||
|
|
@ -162,6 +168,11 @@ CProtocolManager::CProtocolManager() {
|
|||
PROTO::ctm = std::make_unique<CHyprlandCTMControlProtocol>(&hyprland_ctm_control_manager_v1_interface, 1, "CTMControl");
|
||||
PROTO::hyprlandSurface = std::make_unique<CHyprlandSurfaceProtocol>(&hyprland_surface_manager_v1_interface, 1, "HyprlandSurface");
|
||||
|
||||
if (*PENABLEXXCM) {
|
||||
PROTO::colorManagement = std::make_unique<CColorManagementProtocol>(&xx_color_manager_v4_interface, 1, "ColorManagement");
|
||||
PROTO::frogColorManagement = std::make_unique<CFrogColorManagementProtocol>(&frog_color_management_factory_v1_interface, 1, "FrogColorManagement");
|
||||
}
|
||||
|
||||
for (auto const& b : g_pCompositor->m_pAqBackend->getImplementations()) {
|
||||
if (b->type() != Aquamarine::AQ_BACKEND_DRM)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue