Files
zed/crates/gpui_apple/Cargo.toml
T
Finn Evers 26fb9817c4 gpui: Improve PlatformAtlas::get_or_insert_with (#64331)
Stumbled across this during a recent review:

At all of the call sites in prod code, we would clone, then into, then
pass by ref, and then immediately clone again in `get_or_insert_with`
when the texture was not found.

Instead, changed the API to now take an owned `AtlasKey` to make better
use of the cloning.

As a second step, went ahead and added a generic `AtlasState`, as I
noticed all atlases shared some similar logic around keeping track of
the tiles. With this restructing, we reuse some code across different
backends, but more importantly, get rid of an additional hashmap lookup
by instead using the `Entry` API.

Release Notes:

- N/A
- [GPUI] N/A
2026-09-17 08:24:25 +00:00

44 lines
941 B
TOML

[package]
name = "gpui_apple"
version = "0.1.0"
edition.workspace = true
publish.workspace = true
license = "Apache-2.0"
[lints]
workspace = true
[lib]
path = "src/gpui_apple.rs"
[features]
default = []
bench-support = ["gpui/bench-support"]
test-support = ["gpui/test-support"]
runtime_shaders = []
[dependencies]
gpui.workspace = true
[target.'cfg(target_os = "macos")'.dependencies]
anyhow.workspace = true
block.workspace = true
cocoa.workspace = true
core-foundation.workspace = true
core-video.workspace = true
derive_more.workspace = true
etagere.workspace = true
foreign-types.workspace = true
image.workspace = true
log.workspace = true
metal.workspace = true
objc.workspace = true
objc2.workspace = true
parking_lot.workspace = true
[target.'cfg(target_os = "macos")'.build-dependencies]
cbindgen.workspace = true
[target.'cfg(target_os = "macos")'.dev-dependencies]
gpui = { workspace = true, features = ["test-support"] }