Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fff76ea8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add HardwareBuffer::as_raw for C FFI boundary" into main

parents 8a482fd1 8237ba66
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -220,7 +220,13 @@ impl HardwareBuffer {
        Self(buffer)
        Self(buffer)
    }
    }


    /// Get the internal |AHardwareBuffer| pointer without decrementing the refcount. This can
    /// Get the internal `AHardwareBuffer` pointer that is only valid when this `HardwareBuffer`
    /// exists. This can be used to provide a pointer to the AHB for a C/C++ API over the FFI.
    pub fn as_raw(&self) -> NonNull<AHardwareBuffer> {
        self.0
    }

    /// Get the internal `AHardwareBuffer` pointer without decrementing the refcount. This can
    /// be used to provide a pointer to the AHB for a C/C++ API over the FFI.
    /// be used to provide a pointer to the AHB for a C/C++ API over the FFI.
    pub fn into_raw(self) -> NonNull<AHardwareBuffer> {
    pub fn into_raw(self) -> NonNull<AHardwareBuffer> {
        let buffer = ManuallyDrop::new(self);
        let buffer = ManuallyDrop::new(self);