renderer: Fix CM for DS and SDR passthrough (#11503)

This commit is contained in:
UjinT34 2025-08-29 14:31:07 +03:00 committed by GitHub
parent 790e544689
commit 05a1c0aa73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 186 additions and 83 deletions

View file

@ -423,6 +423,10 @@ SP<CWLSurfaceResource> CWLSurfaceResource::findFirstPreorder(std::function<bool(
return findFirstPreorderHelper(m_self.lock(), fn);
}
SP<CWLSurfaceResource> CWLSurfaceResource::findWithCM() {
return findFirstPreorder([this](SP<CWLSurfaceResource> surf) { return surf->m_colorManagement.valid() && surf->extends() == extends(); });
}
std::pair<SP<CWLSurfaceResource>, Vector2D> CWLSurfaceResource::at(const Vector2D& localCoords, bool allowsInput) {
std::vector<std::pair<SP<CWLSurfaceResource>, Vector2D>> surfs;
breadthfirst([&surfs](SP<CWLSurfaceResource> surf, const Vector2D& offset, void* data) { surfs.emplace_back(std::make_pair<>(surf, offset)); }, &surfs);