Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump the wasm-bindgen group with 3 updates #18338

Merged
merged 1 commit into from
Oct 21, 2024
Merged
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
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ enum-map = "2.7.3"
flate2 = "1.0.34"
futures = "0.3.31"
image = { version = "0.25.4", default-features = false }
js-sys = "0.3.70"
web-sys = "0.3.70"
js-sys = "0.3.72"
web-sys = "0.3.72"
log = "0.4"
num-derive = "0.4.2"
num-traits = "0.2.19"
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ tracy-client = { version = "0.17.1", optional = true, default-features = false }
workspace = true

[target.'cfg(target_family = "wasm")'.dependencies.wasm-bindgen-futures]
version = "0.4.43"
version = "0.4.45"

[features]
default = []
Expand Down
51 changes: 24 additions & 27 deletions render/canvas/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,13 @@ impl WebCanvasRenderBackend {
self.context.set_line_cap("butt");
self.context.set_line_width(1.0);
self.context.set_line_join("miter");
self.context.set_stroke_style(
&format!(
"rgba({},{},{},{})",
color.r,
color.g,
color.b,
f32::from(color.a) / 255.0,
)
.into(),
);
self.context.set_stroke_style_str(&format!(
"rgba({},{},{},{})",
color.r,
color.g,
color.b,
f32::from(color.a) / 255.0,
));
}

fn apply_blend_mode(&mut self, blend: RenderBlendMode) {
Expand Down Expand Up @@ -429,7 +426,7 @@ impl WebCanvasRenderBackend {

if clear.a > 0 {
let color = format!("rgba({}, {}, {}, {})", clear.r, clear.g, clear.b, clear.a);
self.context.set_fill_style(&color.into());
self.context.set_fill_style_str(&color);
let _ = self.context.set_global_composite_operation("copy");
self.context
.fill_rect(0.0, 0.0, width.into(), height.into());
Expand Down Expand Up @@ -651,15 +648,16 @@ impl CommandHandler for WebCanvasRenderBackend {
match fill_style {
CanvasFillStyle::Color(color) => {
let color = color.color_transform(&transform.color_transform);
self.context.set_fill_style(&color.1.into());
self.context.set_fill_style_str(&color.1);
self.context.fill_with_path_2d_and_winding(
path,
CanvasWindingRule::Evenodd,
);
}
CanvasFillStyle::Gradient(gradient) => {
self.set_color_filter(&transform);
self.context.set_fill_style(&gradient.gradient);
self.context
.set_fill_style_canvas_gradient(&gradient.gradient);

if let Some(gradient_transform) = &gradient.transform {
// Canvas has no easy way to draw gradients with an arbitrary transform,
Expand Down Expand Up @@ -693,7 +691,7 @@ impl CommandHandler for WebCanvasRenderBackend {
CanvasFillStyle::Bitmap(bitmap) => {
self.set_color_filter(&transform);
self.context.set_image_smoothing_enabled(bitmap.smoothed);
self.context.set_fill_style(&bitmap.pattern);
self.context.set_fill_style_canvas_pattern(&bitmap.pattern);
self.context.fill_with_path_2d_and_winding(
path,
CanvasWindingRule::Evenodd,
Expand Down Expand Up @@ -731,7 +729,7 @@ impl CommandHandler for WebCanvasRenderBackend {
match stroke_style {
CanvasStrokeStyle::Color(color) => {
let color = color.color_transform(&transform.color_transform);
self.context.set_stroke_style(&color.1.into());
self.context.set_stroke_style_str(&color.1);
self.context.stroke_with_path(&transformed_path);
}
CanvasStrokeStyle::Gradient(gradient, focal_point) => {
Expand Down Expand Up @@ -759,7 +757,8 @@ impl CommandHandler for WebCanvasRenderBackend {
};
if let Ok(gradient) = gradient {
self.set_color_filter(&transform);
self.context.set_stroke_style(&gradient.gradient);
self.context
.set_stroke_style_canvas_gradient(&gradient.gradient);
self.context.stroke_with_path(&transformed_path);
self.clear_color_filter();
}
Expand All @@ -774,7 +773,8 @@ impl CommandHandler for WebCanvasRenderBackend {
);
self.set_color_filter(&transform);
self.context.set_image_smoothing_enabled(bitmap.smoothed);
self.context.set_stroke_style(&bitmap.pattern);
self.context
.set_stroke_style_canvas_pattern(&bitmap.pattern);
self.context.stroke_with_path(&transformed_path);
self.clear_color_filter();
}
Expand Down Expand Up @@ -807,16 +807,13 @@ impl CommandHandler for WebCanvasRenderBackend {
MaskState::DrawContent => {
self.set_transform(&matrix);
self.clear_color_filter();
self.context.set_fill_style(
&format!(
"rgba({},{},{},{})",
color.r,
color.g,
color.b,
f32::from(color.a) / 255.0
)
.into(),
);
self.context.set_fill_style_str(&format!(
"rgba({},{},{},{})",
color.r,
color.g,
color.b,
f32::from(color.a) / 255.0
));
self.context.fill_rect(0.0, 0.0, 1.0, 1.0);
}
MaskState::DrawMask(mask_path) => {
Expand Down
2 changes: 1 addition & 1 deletion web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ruffle_render_wgpu = { path = "../render/wgpu", optional = true }
ruffle_video_software = { path = "../video/software" }
url = { workspace = true }
wasm-bindgen = { workspace = true }
wasm-bindgen-futures = "0.4.43"
wasm-bindgen-futures = "0.4.45"
serde-wasm-bindgen = "0.6.5"
chrono = { workspace = true, features = ["wasmbind", "clock"] }
getrandom = { version = "0.2", features = ["js"] }
Expand Down