refactor: Use new hyprutils casts (#11377)
This commit is contained in:
parent
aa6a78f0a4
commit
beee22a95e
116 changed files with 715 additions and 696 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "color-management-v1.hpp"
|
||||
#include <hyprgraphics/color/Color.hpp>
|
||||
#include "../../helpers/memory/Memory.hpp"
|
||||
|
||||
#define SDR_MIN_LUMINANCE 0.2
|
||||
#define SDR_MAX_LUMINANCE 80.0
|
||||
|
|
@ -42,16 +43,16 @@ namespace NColorManagement {
|
|||
// NOTE should be ok this way. unsupported primaries/tfs must be rejected earlier. supported enum values should be in sync with proto.
|
||||
// might need a proper switch-case and additional INVALID enum value.
|
||||
inline wpColorManagerV1Primaries convertPrimaries(ePrimaries primaries) {
|
||||
return (wpColorManagerV1Primaries)primaries;
|
||||
return sc<wpColorManagerV1Primaries>(primaries);
|
||||
}
|
||||
inline ePrimaries convertPrimaries(wpColorManagerV1Primaries primaries) {
|
||||
return (ePrimaries)primaries;
|
||||
return sc<ePrimaries>(primaries);
|
||||
}
|
||||
inline wpColorManagerV1TransferFunction convertTransferFunction(eTransferFunction tf) {
|
||||
return (wpColorManagerV1TransferFunction)tf;
|
||||
return sc<wpColorManagerV1TransferFunction>(tf);
|
||||
}
|
||||
inline eTransferFunction convertTransferFunction(wpColorManagerV1TransferFunction tf) {
|
||||
return (eTransferFunction)tf;
|
||||
return sc<eTransferFunction>(tf);
|
||||
}
|
||||
|
||||
using SPCPRimaries = Hyprgraphics::SPCPRimaries;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ wl_resource* CWLBufferResource::getResource() {
|
|||
}
|
||||
|
||||
SP<CWLBufferResource> CWLBufferResource::fromResource(wl_resource* res) {
|
||||
auto data = (CWLBufferResource*)(((CWlBuffer*)wl_resource_get_user_data(res))->data());
|
||||
auto data = sc<CWLBufferResource*>(sc<CWlBuffer*>(wl_resource_get_user_data(res))->data());
|
||||
return data ? data->m_self.lock() : nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue