1
0
Fork 0
forked from wry/wry

color-management: use more consistent naming

This commit is contained in:
Julian Orth 2025-09-05 13:45:09 +02:00
parent 32db933242
commit 83e79b68e6
65 changed files with 439 additions and 510 deletions

View file

@ -2,8 +2,7 @@ use {
crate::{
allocator::BufferObject,
backend::{
BackendColorSpace, BackendConnectorState, BackendTransferFunction, Connector,
ConnectorEvent,
BackendColorSpace, BackendConnectorState, BackendEotfs, Connector, ConnectorEvent,
transaction::{
BackendAppliedConnectorTransaction, BackendConnectorTransaction,
BackendConnectorTransactionError, BackendPreparedConnectorTransaction,
@ -669,16 +668,14 @@ impl MetalDeviceTransaction {
}
}
}
match state.transfer_function {
BackendTransferFunction::Default => {}
BackendTransferFunction::Pq => {
match state.eotf {
BackendEotfs::Default => {}
BackendEotfs::Pq => {
if !dd.supports_pq {
return Err(
BackendConnectorTransactionError::TransferFunctionNotSupported(
connector.obj.kernel_id(),
state.transfer_function,
),
);
return Err(BackendConnectorTransactionError::EotfNotSupported(
connector.obj.kernel_id(),
state.eotf,
));
}
}
}
@ -686,12 +683,10 @@ impl MetalDeviceTransaction {
*cs = state.color_space.to_drm();
}
if dd.hdr_metadata.is_some() {
let new = if state.transfer_function == BackendTransferFunction::Default {
let new = if state.eotf == BackendEotfs::Default {
None
} else {
Some(hdr_output_metadata::from_eotf(
state.transfer_function.to_drm(),
))
Some(hdr_output_metadata::from_eotf(state.eotf.to_drm()))
};
if connector.new.hdr_metadata != new {
if let Some(new) = &new {