Skip to content

Commit

Permalink
Add Texture from IOSurface
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosky committed Jul 16, 2024
1 parent 864417d commit 1b4cb5d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ block = "0.1.6"
foreign-types = "0.5"
dispatch = { version = "0.2", optional = true }
paste = "1"
io-surface = { git = "https://github.com/servo/core-foundation-rs" }

[dependencies.objc]
version = "0.2.4"
Expand Down
13 changes: 13 additions & 0 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,19 @@ impl DeviceRef {
unsafe { msg_send![self, newTextureWithDescriptor: descriptor] }
}

pub fn new_texture_with_descriptor_and_iosurface(
&self,
descriptor: &TextureDescriptorRef,
iosurface: io_surface::IOSurfaceRef,
plane: NSUInteger,
) -> Texture {
unsafe {
msg_send![self, newTextureWithDescriptor: descriptor
iosurface: iosurface
plane: plane ]
}
}

pub fn new_sampler(&self, descriptor: &SamplerDescriptorRef) -> SamplerState {
unsafe { msg_send![self, newSamplerStateWithDescriptor: descriptor] }
}
Expand Down

0 comments on commit 1b4cb5d

Please sign in to comment.