Skip to content

Commit

Permalink
Merge branch 'emilk:master' into patch22
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored May 15, 2024
2 parents 70e6e70 + c1eb3f8 commit ccbc9bf
Show file tree
Hide file tree
Showing 23 changed files with 74 additions and 92 deletions.
57 changes: 19 additions & 38 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -819,12 +819,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecdffb913a326b6c642290a0d0ec8e8d6597291acdc07cc4c9cb4b3635d44cf9"

[[package]]
name = "color_quant"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"

[[package]]
name = "com"
version = "0.6.0"
Expand Down Expand Up @@ -2072,17 +2066,16 @@ dependencies = [

[[package]]
name = "image"
version = "0.24.7"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711"
checksum = "a9b4f005360d32e9325029b38ba47ebd7a56f3316df09249368939562d518645"
dependencies = [
"bytemuck",
"byteorder",
"color_quant",
"jpeg-decoder",
"num-rational",
"num-traits",
"png",
"zune-core",
"zune-jpeg",
]

[[package]]
Expand Down Expand Up @@ -2188,12 +2181,6 @@ dependencies = [
"libc",
]

[[package]]
name = "jpeg-decoder"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e"

[[package]]
name = "js-sys"
version = "0.3.69"
Expand Down Expand Up @@ -2498,27 +2485,6 @@ dependencies = [
"minimal-lexical",
]

[[package]]
name = "num-integer"
version = "0.1.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
dependencies = [
"autocfg",
"num-traits",
]

[[package]]
name = "num-rational"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
]

[[package]]
name = "num-traits"
version = "0.2.16"
Expand Down Expand Up @@ -4883,6 +4849,21 @@ dependencies = [
"syn 2.0.48",
]

[[package]]
name = "zune-core"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a"

[[package]]
name = "zune-jpeg"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec866b44a2a1fd6133d363f073ca1b179f438f99e7e5bfb1e33f7181facfe448"
dependencies = [
"zune-core",
]

[[package]]
name = "zvariant"
version = "3.15.0"
Expand Down
10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,31 @@ egui_demo_lib = { version = "0.27.2", path = "crates/egui_demo_lib", default-fea
egui_glow = { version = "0.27.2", path = "crates/egui_glow", default-features = false }
eframe = { version = "0.27.2", path = "crates/eframe", default-features = false }

#TODO(emilk): make more things workspace dependencies
ahash = { version = "0.8.6", default-features = false, features = [
"no-rng", # we don't need DOS-protection, so we let users opt-in to it instead
"std",
] }
backtrace = "0.3"
bytemuck = "1.7.2"
criterion = { version = "0.5.1", default-features = false }
document-features = " 0.2.8"
glow = "0.13"
glutin = "0.31"
glutin-winit = "0.4"
image = { version = "0.25", default-features = false }
log = { version = "0.4", features = ["std"] }
nohash-hasher = "0.2"
parking_lot = "0.12"
puffin = "0.19"
puffin_http = "0.16"
ron = "0.8"
raw-window-handle = "0.6.0"
serde = { version = "1", features = ["derive"] }
thiserror = "1.0.37"
web-time = "0.2" # Timekeeping for native and web
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = "0.3.58"
wgpu = { version = "0.20.0", default-features = false, features = [
# Make the renderer `Sync` even on wasm32, because it makes the code simpler:
"fragile-send-sync-non-atomic-wasm",
Expand Down
4 changes: 2 additions & 2 deletions crates/ecolor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ default = []
#! ### Optional dependencies

## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast `ecolor` types to `&[u8]`.
bytemuck = { version = "1.7.2", optional = true, features = ["derive"] }
bytemuck = { workspace = true, optional = true, features = ["derive"] }

## [`cint`](https://docs.rs/cint) enables interoperability with other color libraries.
cint = { version = "0.3.1", optional = true }
Expand All @@ -45,4 +45,4 @@ color-hex = { version = "0.2.0", optional = true }
document-features = { workspace = true, optional = true }

## Allow serialization using [`serde`](https://docs.rs/serde).
serde = { version = "1", optional = true, features = ["derive"] }
serde = { workspace = true, optional = true }
20 changes: 9 additions & 11 deletions crates/eframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ glow = { workspace = true, optional = true }
rwh_05 = { package = "raw-window-handle", version = "0.5.2", optional = true, features = [
"std",
] }
ron = { version = "0.8", optional = true, features = ["integer128"] }
serde = { version = "1", optional = true, features = ["derive"] }
ron = { workspace = true, optional = true, features = ["integer128"] }
serde = { workspace = true, optional = true }

# -------------------------------------------
# native:
Expand All @@ -154,9 +154,7 @@ egui-winit = { workspace = true, default-features = false, features = [
"clipboard",
"links",
] }
image = { version = "0.24", default-features = false, features = [
"png",
] } # Needed for app icon
image = { workspace = true, features = ["png"] } # Needed for app icon
winit = { workspace = true, default-features = false, features = ["rwh_06"] }

# optional native:
Expand All @@ -168,8 +166,8 @@ pollster = { version = "0.3", optional = true } # needed for wgpu

# we can expose these to user so that they can select which backends they want to enable to avoid compiling useless deps.
# this can be done at the same time we expose x11/wayland features of winit crate.
glutin = { version = "0.31", optional = true }
glutin-winit = { version = "0.4", optional = true }
glutin = { workspace = true, optional = true }
glutin-winit = { workspace = true, optional = true }
puffin = { workspace = true, optional = true }
wgpu = { workspace = true, optional = true, features = [
# Let's enable some backends so that users can use `eframe` out-of-the-box
Expand Down Expand Up @@ -201,12 +199,12 @@ winapi = { version = "0.3.9", features = ["winuser"] }
# -------------------------------------------
# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
bytemuck = "1.7"
bytemuck.workspace = true
js-sys = "0.3"
percent-encoding = "2.1"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3.58", features = [
wasm-bindgen.workspace = true
wasm-bindgen-futures.workspace = true
web-sys = { workspace = true, features = [
"BinaryType",
"Blob",
"Clipboard",
Expand Down
2 changes: 1 addition & 1 deletion crates/eframe/src/icon_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl IconDataExt for IconData {
image
.write_to(
&mut std::io::Cursor::new(&mut png_bytes),
image::ImageOutputFormat::Png,
image::ImageFormat::Png,
)
.map_err(|err| err.to_string())?;
Ok(png_bytes)
Expand Down
2 changes: 1 addition & 1 deletion crates/eframe/src/native/app_icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn set_app_icon_windows(icon_data: &IconData) -> AppIconStatus {
if image_scaled
.write_to(
&mut std::io::Cursor::new(&mut image_scaled_bytes),
image::ImageOutputFormat::Png,
image::ImageFormat::Png,
)
.is_err()
{
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ x11 = ["winit?/x11"]
egui = { workspace = true, default-features = false }
epaint = { workspace = true, default-features = false, features = ["bytemuck"] }

bytemuck = "1.7"
bytemuck.workspace = true
document-features.workspace = true
log.workspace = true
thiserror.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ accesskit_winit = { version = "0.16.0", optional = true }
document-features = { workspace = true, optional = true }

puffin = { workspace = true, optional = true }
serde = { version = "1.0", optional = true, features = ["derive"] }
serde = { workspace = true, optional = true }
webbrowser = { version = "1.0.0", optional = true }

[target.'cfg(any(target_os="linux", target_os="dragonfly", target_os="freebsd", target_os="netbsd", target_os="openbsd"))'.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions crates/egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ document-features = { workspace = true, optional = true }

log = { workspace = true, optional = true }
puffin = { workspace = true, optional = true }
ron = { version = "0.8", optional = true }
serde = { version = "1", optional = true, features = ["derive", "rc"] }
ron = { workspace = true, optional = true }
serde = { workspace = true, optional = true, features = ["derive", "rc"] }
13 changes: 5 additions & 8 deletions crates/egui_demo_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ log.workspace = true

# Optional dependencies:

bytemuck = { version = "1.7.1", optional = true }
bytemuck = { workspace = true, optional = true }
puffin = { workspace = true, optional = true }
puffin_http = { workspace = true, optional = true }
# Enable both WebGL & WebGPU when targeting the web (these features have no effect when not targeting wasm32)
Expand All @@ -60,14 +60,11 @@ wgpu = { workspace = true, features = ["webgpu", "webgl"], optional = true }

# feature "http":
ehttp = { version = "0.5", optional = true }
image = { version = "0.24", optional = true, default-features = false, features = [
"jpeg",
"png",
] }
image = { workspace = true, optional = true, features = ["jpeg", "png"] }
poll-promise = { version = "0.3", optional = true, default-features = false }

# feature "persistence":
serde = { version = "1", optional = true, features = ["derive"] }
serde = { workspace = true, optional = true }


# native:
Expand All @@ -81,5 +78,5 @@ rfd = { version = "0.13", optional = true }
# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "=0.2.92"
wasm-bindgen-futures = "0.4"
web-sys = "0.3"
wasm-bindgen-futures.workspace = true
web-sys.workspace = true
2 changes: 1 addition & 1 deletion crates/egui_demo_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ unicode_names2 = { version = "0.6.0", default-features = false } # this old vers
chrono = { version = "0.4", optional = true, features = ["js-sys", "wasmbind"] }
## Enable this when generating docs.
document-features = { workspace = true, optional = true }
serde = { version = "1", optional = true, features = ["derive"] }
serde = { workspace = true, optional = true }


[dev-dependencies]
Expand Down
7 changes: 3 additions & 4 deletions crates/egui_extras/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ http = ["dep:ehttp"]
##
## You also need to ALSO opt-in to the image formats you want to support, like so:
## ```toml
## image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for

## image = { version = "0.25", features = ["jpeg", "png"] } # Add the types you want support for
## ```
image = ["dep:image"]

Expand All @@ -67,7 +66,7 @@ egui = { workspace = true, default-features = false, features = ["serde"] }

enum-map = { version = "2", features = ["serde"] }
log.workspace = true
serde = { version = "1", features = ["derive"] }
serde.workspace = true

#! ### Optional dependencies

Expand All @@ -82,7 +81,7 @@ chrono = { version = "0.4", optional = true, default-features = false, features
## Enable this when generating docs.
document-features = { workspace = true, optional = true }

image = { version = "0.24", optional = true, default-features = false }
image = { workspace = true, optional = true }

# file feature
mime_guess2 = { version = "2", optional = true, default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_extras/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ One thing `egui_extras` is commonly used for is to install image loaders for `eg

```toml
egui_extras = { version = "*", features = ["all_loaders"] }
image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for
image = { version = "0.25", features = ["jpeg", "png"] } # Add the types you want support for
```

```rs
Expand Down
4 changes: 2 additions & 2 deletions crates/egui_extras/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl RetainedImage {
/// `image_bytes` should be the raw contents of an image file (`.png`, `.jpg`, …).
///
/// Requires the "image" feature. You must also opt-in to the image formats you need
/// with e.g. `image = { version = "0.24", features = ["jpeg", "png"] }`.
/// with e.g. `image = { version = "0.25", features = ["jpeg", "png"] }`.
///
/// # Errors
/// On invalid image or unsupported image format.
Expand Down Expand Up @@ -195,7 +195,7 @@ use egui::ColorImage;
/// Load a (non-svg) image.
///
/// Requires the "image" feature. You must also opt-in to the image formats you need
/// with e.g. `image = { version = "0.24", features = ["jpeg", "png"] }`.
/// with e.g. `image = { version = "0.25", features = ["jpeg", "png"] }`.
///
/// # Errors
/// On invalid image or unsupported image format.
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_extras/src/loaders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
///
/// ```toml,ignore
/// egui_extras = { version = "*", features = ["all_loaders"] }
/// image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for
/// image = { version = "0.25", features = ["jpeg", "png"] } # Add the types you want support for
/// ```
///
/// ⚠ You have to configure both the supported loaders in `egui_extras` _and_ the supported image formats
Expand Down
10 changes: 5 additions & 5 deletions crates/egui_glow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ x11 = ["winit?/x11"]
egui = { workspace = true, default-features = false, features = ["bytemuck"] }
egui-winit = { workspace = true, optional = true, default-features = false }

bytemuck = "1.7"
bytemuck.workspace = true
glow.workspace = true
log.workspace = true
memoffset = "0.9"
Expand All @@ -74,13 +74,13 @@ winit = { workspace = true, optional = true, default-features = false, features

# Web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
web-sys = { version = "0.3", features = ["console"] }
wasm-bindgen = "0.2"
web-sys = { workspace = true, features = ["console"] }
wasm-bindgen.workspace = true


[dev-dependencies]
glutin = "0.31" # examples/pure_glow
glutin-winit = "0.4.0"
glutin.workspace = true # examples/pure_glow
glutin-winit.workspace = true
# glutin stuck on old version of raw-window-handle:
rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = [
"std",
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_plot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ egui = { workspace = true, default-features = false }
## Enable this when generating docs.
document-features = { workspace = true, optional = true }

serde = { version = "1", optional = true, features = ["derive"] }
serde = { workspace = true, optional = true }
4 changes: 2 additions & 2 deletions crates/emath/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ default = []
#! ### Optional dependencies

## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast `emath` types to `&[u8]`.
bytemuck = { version = "1.7.2", optional = true, features = ["derive"] }
bytemuck = { workspace = true, optional = true, features = ["derive"] }

## Enable this when generating docs.
document-features = { workspace = true, optional = true }
Expand All @@ -39,4 +39,4 @@ document-features = { workspace = true, optional = true }
mint = { version = "0.5.6", optional = true }

## Allow serialization using [`serde`](https://docs.rs/serde).
serde = { version = "1", optional = true, features = ["derive"] }
serde = { workspace = true, optional = true }
Loading

0 comments on commit ccbc9bf

Please sign in to comment.