update more deps

This commit is contained in:
griffi-gh 2024-12-11 20:32:31 +01:00
parent 3358465be9
commit 1fea554560
9 changed files with 27 additions and 19 deletions

View file

@ -11,7 +11,7 @@ hui-painter = { path = "../hui-painter" }
hui-glium = { path = "../hui-glium" } hui-glium = { path = "../hui-glium" }
hui-winit = { path = "../hui-winit" } hui-winit = { path = "../hui-winit" }
kubi-logging = { git = "https://github.com/griffi-gh/kubi", rev = "be1e24ba0c9e6d24128e7d0e74bebd8b90c23be7" } kubi-logging = { git = "https://github.com/griffi-gh/kubi", rev = "be1e24ba0c9e6d24128e7d0e74bebd8b90c23be7" }
glium = "0.35" glium = "0.36"
winit = "0.30" winit = "0.30"
glam = "0.29" glam = "0.29"
log = "0.4" log = "0.4"

View file

@ -19,6 +19,6 @@ hui-shared = { version = "0.1.0-alpha.5", path = "../hui-shared" }
glam = "0.29" glam = "0.29"
log = "0.4" log = "0.4"
rect_packer = "0.2" # TODO: use sth else like `crunch` instead? rect_packer = "0.2" # TODO: use sth else like `crunch` instead?
hashbrown = "0.14" hashbrown = "0.15"
nohash-hasher = "0.2" nohash-hasher = "0.2"
fontdue = "0.9" fontdue = "0.9"

View file

@ -29,7 +29,7 @@ impl FontHandleManager {
/// - If the font data is invalid. /// - If the font data is invalid.
pub fn add_font(&mut self, data: &[u8]) -> FontHandle { pub fn add_font(&mut self, data: &[u8]) -> FontHandle {
let font = fontdue::Font::from_bytes(data, fontdue::FontSettings::default()).unwrap(); let font = fontdue::Font::from_bytes(data, fontdue::FontSettings::default()).unwrap();
self.fonts.insert_unique_unchecked(self.idc, FontRepr { font }); unsafe { self.fonts.insert_unique_unchecked(self.idc, FontRepr { font }); }
self.idc += 1; self.idc += 1;
FontHandle(self.idc - 1) FontHandle(self.idc - 1)
} }

View file

@ -46,7 +46,7 @@ impl FontTextureManager {
/// - If the partition for the font already exists. /// - If the partition for the font already exists.
pub(crate) fn init_font(&mut self, font: FontHandle) { pub(crate) fn init_font(&mut self, font: FontHandle) {
assert!(!self.partition.contains_key(&font.0), "Font handle already initialized"); assert!(!self.partition.contains_key(&font.0), "Font handle already initialized");
self.partition.insert_unique_unchecked(font.0, HashMap::default()); unsafe { self.partition.insert_unique_unchecked(font.0, HashMap::default()) };
} }
/// Render a glyph and cache it in the texture atlas. /// Render a glyph and cache it in the texture atlas.
@ -81,7 +81,7 @@ impl FontTextureManager {
// Create a texture item struct and insert it into the partition // Create a texture item struct and insert it into the partition
let itm = RasterizedGlyphInternal { handle, metrics }; let itm = RasterizedGlyphInternal { handle, metrics };
partition.insert_unique_unchecked(config, itm); unsafe { partition.insert_unique_unchecked(config, itm); }
return handle; return handle;
} }

View file

@ -204,12 +204,14 @@ impl TextureAtlas {
if allocation.max_size.x >= size.x && allocation.max_size.y >= size.y { if allocation.max_size.x >= size.x && allocation.max_size.y >= size.y {
let allocation = self.reuse_allocations.remove(idx); let allocation = self.reuse_allocations.remove(idx);
let handle = self.next_handle(size); let handle = self.next_handle(size);
unsafe {
self.allocations.insert_unique_unchecked(handle.id, TextureAllocation { self.allocations.insert_unique_unchecked(handle.id, TextureAllocation {
handle, handle,
offset: allocation.offset, offset: allocation.offset,
size, size,
max_size: allocation.max_size, max_size: allocation.max_size,
}); });
}
return handle; return handle;
} }
} }
@ -228,7 +230,9 @@ impl TextureAtlas {
// Allocate the texture // Allocate the texture
let handle = self.next_handle(size); let handle = self.next_handle(size);
let allocation = TextureAllocation::new(handle, offset, size); let allocation = TextureAllocation::new(handle, offset, size);
unsafe {
self.allocations.insert_unique_unchecked(handle.id, allocation); self.allocations.insert_unique_unchecked(handle.id, allocation);
}
handle handle
} }

View file

@ -19,16 +19,16 @@ include = [
hui-derive = { version = "0.1.0-alpha.5", path = "../hui-derive", optional = true } hui-derive = { version = "0.1.0-alpha.5", path = "../hui-derive", optional = true }
hui-shared = { version = "0.1.0-alpha.5", path = "../hui-shared" } hui-shared = { version = "0.1.0-alpha.5", path = "../hui-shared" }
# hui-painter = { version = "0.1.0-alpha.5", path = "../hui-painter" } # hui-painter = { version = "0.1.0-alpha.5", path = "../hui-painter" }
hashbrown = "0.14" hashbrown = "0.15"
nohash-hasher = "0.2" nohash-hasher = "0.2"
glam = "0.29"" glam = "0.29"
fontdue = "0.9" fontdue = "0.9"
rect_packer = "0.2" rect_packer = "0.2"
log = "0.4" log = "0.4"
document-features = "0.2" document-features = "0.2"
derive_setters = "0.1" derive_setters = "0.1"
derive_more = "0.99" derive_more = { version = "1.0", features = [ "full" ] }
tinyset = "0.4" tinyset = "0.5"
image = { version = "0.25", default-features = false, optional = true } image = { version = "0.25", default-features = false, optional = true }
rustc-hash = "2.0" rustc-hash = "2.0"

View file

@ -163,7 +163,9 @@ impl TextureAtlasManager {
//If the size does not match the requested size, the texture was rotated //If the size does not match the requested size, the texture was rotated
rotated: ALLOW_ROTATION && (result.width != size.x as i32), rotated: ALLOW_ROTATION && (result.width != size.x as i32),
}; };
unsafe {
self.allocations.insert_unique_unchecked(index, allocation); self.allocations.insert_unique_unchecked(index, allocation);
}
Some(ImageHandle { index }) Some(ImageHandle { index })
} }

View file

@ -7,7 +7,7 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![deny(unsafe_code)] // #![deny(unsafe_code)]
#![forbid(unsafe_op_in_unsafe_fn)] #![forbid(unsafe_op_in_unsafe_fn)]
#![allow(unused_parens)] #![allow(unused_parens)]

View file

@ -53,7 +53,9 @@ impl FontTextureManager {
metrics, metrics,
texture texture
}); });
unsafe {
self.glyph_cache.insert_unique_unchecked(key, Arc::clone(&entry)); self.glyph_cache.insert_unique_unchecked(key, Arc::clone(&entry));
}
entry entry
} }