From 6d3b17ee832411f627d8bed6b74e09b4fa55e2fb Mon Sep 17 00:00:00 2001 From: UjinT34 <41110182+UjinT34@users.noreply.github.com> Date: Sat, 27 Dec 2025 20:01:46 +0300 Subject: render/cm: various updates, remove old protocols (#12693) * fix named primaries * default to gamma22 * mark mastering primaries as supported * remove xx-cm and frog support * immutable primaries and image descriptions * clang-format --- src/protocols/XXColorManagement.hpp | 188 ------------------------------------ 1 file changed, 188 deletions(-) delete mode 100644 src/protocols/XXColorManagement.hpp (limited to 'src/protocols/XXColorManagement.hpp') diff --git a/src/protocols/XXColorManagement.hpp b/src/protocols/XXColorManagement.hpp deleted file mode 100644 index 0407730a..00000000 --- a/src/protocols/XXColorManagement.hpp +++ /dev/null @@ -1,188 +0,0 @@ -#pragma once - -#include -#include -#include -#include "WaylandProtocol.hpp" -#include "core/Compositor.hpp" -#include "xx-color-management-v4.hpp" -#include "types/ColorManagement.hpp" - -class CXXColorManager; -class CXXColorManagementOutput; -class CXXColorManagementImageDescription; -class CXXColorManagementProtocol; - -class CXXColorManager { - public: - CXXColorManager(SP resource_); - - bool good(); - - private: - SP m_resource; -}; - -class CXXColorManagementOutput { - public: - CXXColorManagementOutput(SP resource_); - - bool good(); - wl_client* client(); - - WP m_self; - WP m_imageDescription; - - private: - SP m_resource; - wl_client* m_client = nullptr; - - friend class CXXColorManagementProtocol; - friend class CXXColorManagementImageDescription; -}; - -class CXXColorManagementSurface { - public: - CXXColorManagementSurface(SP surface_); // temporary interface for frog CM - CXXColorManagementSurface(SP resource_, SP surface_); - - bool good(); - wl_client* client(); - - WP m_self; - WP m_surface; - - const NColorManagement::SImageDescription& imageDescription(); - bool hasImageDescription(); - void setHasImageDescription(bool has); - const hdr_output_metadata& hdrMetadata(); - void setHDRMetadata(const hdr_output_metadata& metadata); - bool needsHdrMetadataUpdate(); - - private: - SP m_resource; - wl_client* m_client = nullptr; - NColorManagement::SImageDescription m_imageDescription; - bool m_hasImageDescription = false; - bool m_needsNewMetadata = false; - hdr_output_metadata m_hdrMetadata; - - friend class CFrogColorManagementSurface; -}; - -class CXXColorManagementFeedbackSurface { - public: - CXXColorManagementFeedbackSurface(SP resource_, SP surface_); - - bool good(); - wl_client* client(); - - WP m_self; - WP m_surface; - - private: - SP m_resource; - wl_client* m_client = nullptr; - - WP m_currentPreferred; - - friend class CXXColorManagementProtocol; -}; - -class CXXColorManagementParametricCreator { - public: - CXXColorManagementParametricCreator(SP resource_); - - bool good(); - wl_client* client(); - - WP m_self; - - NColorManagement::SImageDescription m_settings; - - private: - enum eValuesSet : uint32_t { // NOLINT - PC_TF = (1 << 0), - PC_TF_POWER = (1 << 1), - PC_PRIMARIES = (1 << 2), - PC_LUMINANCES = (1 << 3), - PC_MASTERING_PRIMARIES = (1 << 4), - PC_MASTERING_LUMINANCES = (1 << 5), - PC_CLL = (1 << 6), - PC_FALL = (1 << 7), - }; - - SP m_resource; - wl_client* m_client = nullptr; - uint32_t m_valuesSet = 0; // enum eValuesSet -}; - -class CXXColorManagementImageDescription { - public: - CXXColorManagementImageDescription(SP resource_, bool allowGetInformation); - - bool good(); - wl_client* client(); - SP resource(); - - WP m_self; - - NColorManagement::SImageDescription m_settings; - - private: - SP m_resource; - wl_client* m_client = nullptr; - bool m_allowGetInformation = false; - - friend class CXXColorManagementOutput; -}; - -class CXXColorManagementImageDescriptionInfo { - public: - CXXColorManagementImageDescriptionInfo(SP resource_, const NColorManagement::SImageDescription& settings_); - - bool good(); - wl_client* client(); - - private: - SP m_resource; - wl_client* m_client = nullptr; - NColorManagement::SImageDescription m_settings; -}; - -class CXXColorManagementProtocol : public IWaylandProtocol { - public: - CXXColorManagementProtocol(const wl_interface* iface, const int& ver, const std::string& name); - - virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id); - - void onImagePreferredChanged(); - - private: - void destroyResource(CXXColorManager* resource); - void destroyResource(CXXColorManagementOutput* resource); - void destroyResource(CXXColorManagementSurface* resource); - void destroyResource(CXXColorManagementFeedbackSurface* resource); - void destroyResource(CXXColorManagementParametricCreator* resource); - void destroyResource(CXXColorManagementImageDescription* resource); - - std::vector> m_managers; - std::vector> m_outputs; - std::vector> m_surfaces; - std::vector> m_feedbackSurfaces; - std::vector> m_parametricCreators; - std::vector> m_imageDescriptions; - - friend class CXXColorManager; - friend class CXXColorManagementOutput; - friend class CXXColorManagementSurface; - friend class CXXColorManagementFeedbackSurface; - friend class CXXColorManagementParametricCreator; - friend class CXXColorManagementImageDescription; - - friend class CFrogColorManagementSurface; -}; - -namespace PROTO { - inline UP xxColorManagement; -}; -- cgit v1.2.3