Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mps = []

[dependencies]
core-graphics-types = "0.1"
core-graphics = "0.22.3"
bitflags = "1"
log = "0.4"
block = "0.1.6"
Expand Down
2 changes: 2 additions & 0 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ pub enum MTLGPUFamily {
Apple4 = 1004,
Apple5 = 1005,
Apple6 = 1006,
Apple7 = 1007,
Apple8 = 1008,
Mac1 = 2001,
Mac2 = 2002,
MacCatalyst1 = 4001,
Expand Down
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use std::{
os::raw::c_void,
};

use core_graphics::color_space::CGColorSpaceRef;
use core_graphics_types::{base::CGFloat, geometry::CGSize};
use foreign_types::ForeignType;
use objc::runtime::{Object, NO, YES};
Expand Down Expand Up @@ -445,6 +446,14 @@ impl MetalLayerRef {
]
}
}

pub fn colorspace(&self) -> &CGColorSpaceRef {
unsafe { msg_send![self, colorspace] }
}

pub fn set_colorspace(&self, colorspace: &CGColorSpaceRef) {
unsafe { msg_send![self, setColorspace: colorspace] }
}
}

mod argument;
Expand Down