Commit Graph

397 Commits

Author SHA1 Message Date
Mike Welsh 4f6959184b canvas: Remove `BitmapDataStorage` and fix lifetime of bitmap data
* Remove `BitmapDataStorage` as its no longer necessary, and store
   the bitmap canvas/context in `BitmapData` instead.
 * Store the `Bitmap` RBGA buffer in the canvas backend. Previously
   this was thrown away when converted to `ImageData`, but this
   causes the glitchy pixels mentioned in:
   https://github.com/ruffle-rs/ruffle/pull/6975#issuecomment-1127942520
   `ImageData` does not copy the buffer passed to it, so store it
   to keep it alive. See:
   https://github.com/rustwasm/wasm-bindgen/issues/2445
2022-05-22 05:47:46 -07:00
Mike Welsh 32bf7e1412 chore: Appease clippy 2022-05-22 02:34:18 -07:00
dependabot[bot] 5a50f4cec1 build(deps): bump enum-map from 2.1.0 to 2.2.0
Bumps [enum-map](https://gitlab.com/KonradBorowski/enum-map) from 2.1.0 to 2.2.0.
- [Release notes](https://gitlab.com/KonradBorowski/enum-map/tags)
- [Changelog](https://gitlab.com/KonradBorowski/enum-map/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/KonradBorowski/enum-map/commits/master)

---
updated-dependencies:
- dependency-name: enum-map
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-21 23:04:43 -07:00
Mike Welsh ff3407cbe0 canvas: Use `DomMatrix` instead of `SvgMatrix` 2022-05-21 19:34:49 -07:00
Mike Welsh 169e86ceb4 canvas: Reimplement masking
Use `CanvasRenderingContext2d.clip` for masking instead of using
intermediate canvases.
2022-05-21 19:34:49 -07:00
Mike Welsh c503f78e13 canvas: Remove `pixelated_property_value`
This is no longer used with the removal of the SVG paths in #6975.
2022-05-19 16:12:54 -07:00
Mike Welsh a10c2ff9c7 canvas: Remove Firefox hack for additive alpha color transforms
This was added in fecb981 to workaround an issue with additive
alpha color transforms in Firefox. This seems to have been fixed
and is no longer necessary, so Firefox can use the normal code
path.
2022-05-19 16:12:54 -07:00
Mike Welsh 48f7ff5f4d core: Add `Bitmap::to_rgba` 2022-05-19 10:43:54 -07:00
Mike Welsh e710f3fa0e core: Clean up `render::Bitmap`
* Make `BitmapFormat` a fieldless enum and move `data` to its own
   field for ease of use.
 * Make `Bitmap` fields private.
2022-05-19 10:43:54 -07:00
Mike Welsh 6615ed17f9 core: Verify bitmap length after decoding
Guarantee bitmap data after decoding has the expected length for
the given width+height+format. This eases the burden from backends
to worry about this. Pad or truncate the data if it doesn't have
the expected size.
2022-05-19 10:43:54 -07:00
relrelb f3af11db9c canvas: Remove some unused dependencies
They're now unused thanks to #6975.
Also remove the `crate-type` field from `Cargo.toml`. I'm not sure
exactly what it does and why it was introduced, but seems working
without it.
2022-05-17 09:51:13 -07:00
Mike Welsh 2f99d039cc canvas: Remove `BitmapDataStorage::ImageElement`
Remove the `ImageElement` data path for storing bitmaps, as the
asynciness of this is difficult to manage when we need to render
bitmaps immediately. This code path was only being used for JPEG
images that could be decoded by the browser (no alpha).

Instead, always use canvases for bitmap storage. This simplifies
the code and solves some issues with bitmaps not being rendered
properly, although it is likely a little slower toe decode these
JPEGs on the Rust side.
2022-05-16 17:13:48 -07:00
Mike Welsh d0aa7b4df2 canvas: Remove SVG rendering path
Remove `CanvasDrawCommand::DrawImage` and all associated machinery
that generates an SVG.
2022-05-16 17:13:48 -07:00
Mike Welsh ce044409e4 canvas: Use canvas drawing commands for gradients
Most gradients are "simply transformed" and can be rendered
directly using canvas commands. But even for complex transforms,
we can push the gradient's transform to the canvas, then
un-transform the path using the inverse of the gradient transform.
2022-05-16 17:13:48 -07:00
dependabot[bot] 27da91b7a0 build(deps): bump clap from 3.1.17 to 3.1.18
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.17 to 3.1.18.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.17...v3.1.18)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-16 13:54:02 -07:00
TÖRÖK Attila c40c0d7ef9 webgl: Use clamp(x, 0.0, 1.0) instead of saturate(x)
The latter seems to not exist
2022-05-13 09:31:21 -07:00
Mike Welsh edad1569fb webgl: Clamp alpha in shaders (fix #6954) 2022-05-12 14:50:25 -07:00
Mike Welsh 121c2577b4 wgpu: Clamp alpha in shaders (fix #6954) 2022-05-12 14:50:25 -07:00
relrelb cab49ae6e1 swf: Introduce `Color::WHITE`
And use it where possible, to improve code readablity.
2022-05-12 12:12:06 -07:00
dependabot[bot] 7352aca3bc build(deps): bump jpeg-decoder from 0.2.5 to 0.2.6
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.2.5 to 0.2.6.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/compare/v0.2.5...v0.2.6)

---
updated-dependencies:
- dependency-name: jpeg-decoder
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 13:46:12 -07:00
dependabot[bot] a853b897ca build(deps): bump clap from 3.1.15 to 3.1.17
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.15 to 3.1.17.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.15...v3.1.17)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 13:45:19 -07:00
relrelb f6153ff7c1 chore: Appease clippy 2022-05-06 10:36:38 -07:00
dependabot[bot] fcc199b0e5 build(deps): bump jpeg-decoder from 0.2.4 to 0.2.5
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.2.4 to 0.2.5.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/compare/v0.2.4...v0.2.5)

---
updated-dependencies:
- dependency-name: jpeg-decoder
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 14:48:42 -07:00
dependabot[bot] c1bcc98668 build(deps): bump image from 0.24.1 to 0.24.2
Bumps [image](https://github.com/image-rs/image) from 0.24.1 to 0.24.2.
- [Release notes](https://github.com/image-rs/image/releases)
- [Changelog](https://github.com/image-rs/image/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image/commits/v0.24.2)

---
updated-dependencies:
- dependency-name: image
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 14:48:00 -07:00
dependabot[bot] 7ab8c340fa build(deps): bump clap from 3.1.12 to 3.1.15
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.12 to 3.1.15.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.12...v3.1.15)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 14:47:37 -07:00
dependabot[bot] 1aafd5c62b build(deps): bump clap from 3.1.9 to 3.1.12
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.9 to 3.1.12.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.9...v3.1.12)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 13:41:09 -07:00
dependabot[bot] e6576df298 build(deps): bump clap from 3.1.8 to 3.1.9
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.8...v3.1.9)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-18 14:59:23 -07:00
Mike Welsh 3305ac69c4 web: Support wmode parameter 2022-04-17 08:33:51 -07:00
Mike Welsh 4a38d36cd7 wgpu: Output premultiplied alpha 2022-04-17 08:33:51 -07:00
Mike Welsh 70b7222d20 webgl: Output premultiplied alpha 2022-04-17 08:33:51 -07:00
Mike Welsh 2d43ace225 wgpu: Don't create intermediate render targets when unnecessary 2022-04-15 14:52:33 -07:00
Mike Welsh f4d72dcc2d wgpu: Disable depth writes 2022-04-15 14:52:33 -07:00
Mike Welsh 9c11870a08 wgpu: Use linear color render target
Always use a non-sRGB texture as the render target so that color
and alpha blending are in sRGB space, matching Flash behavior.

If the surface format requires sRGB, render to an intermediate
linear buffer and copy to the surface as a final render step.
2022-04-15 14:52:33 -07:00
Mike Welsh 00419c6959 wgpu: Use BlendState::ALPHA_BLENDING const 2022-04-15 14:52:33 -07:00
Mike Welsh e1fbcc70f8 canvas: Handle gradient/bitmap strokes 2022-04-11 22:50:40 -07:00
Mike Welsh e5a7dc94ba wgpu/webgl: Handle gradient/bitmap strokes 2022-04-11 22:50:40 -07:00
Mike Welsh 146b8adc68 swf: Clean up LineStyle
* Remove LineStyle::color, instead using fill_style with
   FillStyle::Color to indicate solid color.
 * Store `flags` in the struct instead of separate bools/values.
 * Add getters/setters for ease of use.
 * Add builder-style methods for setting LineStyle properties.
 * Fix misnamed ALLOW_CLOSE flag to NO_CLOSE.
2022-04-11 22:50:40 -07:00
relrelb eeb5eb18f6 web: Bump wasm-bindgen to 0.2.80
As usual, also bump its helper crates (`js-sys`, `web-sys` and
`wasm-bindgen-futures`) to the latest versions.
2022-04-08 09:56:23 -07:00
dependabot[bot] e456fb3ed6 build(deps): bump jpeg-decoder from 0.2.3 to 0.2.4
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.2.3 to 0.2.4.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/compare/v0.2.3...v0.2.4)

---
updated-dependencies:
- dependency-name: jpeg-decoder
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 14:42:32 -07:00
dependabot[bot] 359e687ec9 build(deps): bump clap from 3.1.6 to 3.1.8
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.6 to 3.1.8.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.6...v3.1.8)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 14:25:14 -07:00
dependabot[bot] 1960fc57c3 build(deps): bump bytemuck from 1.9.0 to 1.9.1
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/Lokathor/bytemuck/releases)
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.9.0...v1.9.1)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 13:36:47 -07:00
dependabot[bot] 93d2a410a3 build(deps): bump bytemuck from 1.8.0 to 1.9.0
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/Lokathor/bytemuck/releases)
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-30 11:53:10 -07:00
dependabot[bot] e5a3365957 build(deps): bump image from 0.23.14 to 0.24.1
Bumps [image](https://github.com/image-rs/image) from 0.23.14 to 0.24.1.
- [Release notes](https://github.com/image-rs/image/releases)
- [Changelog](https://github.com/image-rs/image/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image/commits)

---
updated-dependencies:
- dependency-name: image
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-30 08:55:55 +03:00
relrelb 8bc3e9abd2 wgpu: Switch `Bgra` over to `Rgba`
The `image` crate removed `Bgra` in version 0.24.0:
https://github.com/image-rs/image/blob/master/CHANGES.md#version-0240
So stop using it, and start using `Rgba` instead when capturing
images.
2022-03-29 17:18:29 -07:00
relrelb e27240e434 canvas: Remove `clamped_u8_color` function
Since Rust 1.45, the `as` keyword performs a saturating cast when
casting from float to int. Therefore the `clamped_u8_color` function
is useless, and `as` can be simply used instead.
2022-03-28 14:33:32 -07:00
dependabot[bot] bf57d2c15a build(deps): bump jpeg-decoder from 0.2.2 to 0.2.3
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.2.2 to 0.2.3.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/compare/v0.2.2...v0.2.3)

---
updated-dependencies:
- dependency-name: jpeg-decoder
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-29 00:09:01 +03:00
Mike Welsh ac765bd187 chore: Update copyright
I (Michael R. Welsh) assign to Ruffle LLC all rights, title, and
interest to copyrights of my personal contributions to Ruffle,
effective March 26, 2022.
2022-03-26 18:13:14 -07:00
dependabot[bot] 755d5f05ad build(deps): bump enum-map from 2.0.3 to 2.1.0
Bumps [enum-map](https://gitlab.com/KonradBorowski/enum-map) from 2.0.3 to 2.1.0.
- [Release notes](https://gitlab.com/KonradBorowski/enum-map/tags)
- [Changelog](https://gitlab.com/KonradBorowski/enum-map/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/KonradBorowski/enum-map/commits/master)

---
updated-dependencies:
- dependency-name: enum-map
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-26 11:07:23 -07:00
relrelb 7e3c85b0c1 web: Cleanup `web-sys` features
Remove unused ones, sort them alphabetically and wrap to 120 columns
per line.
2022-03-18 03:57:20 +02:00
relrelb e45810f585 webgl: Avoid clamp assertion
If `gl.drawingBufferWidth` returns `0`, then a `clamp` in
`WebGlRenderBackend::set_viewport_dimensions` hits an assertion that
`1 <= self.gl.drawing_buffer_width()` is `false`. I was able to
reproduce this on Chrome by creating many dummy WebGL contexts until
Ruffle's one is lost, and then resize the Ruffle player, but this may
happen in other cases as well.

Fix this by allowing `renderbuffer_width` and `renderbuffer_height`
to be `0`. From basic testing, this seems harmless.
2022-03-16 13:53:34 +02:00
relrelb 3e51b7d95b webgl: Remove parameters of `build_msaa_buffers`
Use `self.renderbuffer_{width,height}` instead.
2022-03-14 22:17:43 +02:00
relrelb 02812c7878 webgl: Inline `build_matrices` into `set_viewport_dimensions`
And remove the `view_{width,height}` fields, because they're now
used as locals.
2022-03-14 22:17:43 +02:00
relrelb d2bf6302fc webgl: De-duplicate code in `register_bitmap` 2022-03-14 22:17:43 +02:00
relrelb f8f2764ac7 chore: Stop using traits available in prelude
This commit does the same as 36353df7f7,
cleaning up any leftovers and new code added since.
2022-03-14 01:16:00 +02:00
dependabot[bot] 697ad92db5 build(deps): bump bytemuck from 1.7.3 to 1.8.0
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.7.3 to 1.8.0.
- [Release notes](https://github.com/Lokathor/bytemuck/releases)
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.7.3...v1.8.0)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 23:59:40 +02:00
dependabot[bot] 71758be08b build(deps): bump png from 0.17.4 to 0.17.5
Bumps [png](https://github.com/image-rs/image-png) from 0.17.4 to 0.17.5.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/compare/v0.17.4...v0.17.5)

---
updated-dependencies:
- dependency-name: png
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 23:59:02 +02:00
dependabot[bot] 56ef543f16 build(deps): bump clap from 3.1.3 to 3.1.6
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.3 to 3.1.6.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.3...v3.1.6)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 23:58:51 +02:00
dependabot[bot] 8e6ed37ba4 build(deps): bump enum-map from 2.0.2 to 2.0.3
Bumps [enum-map](https://gitlab.com/KonradBorowski/enum-map) from 2.0.2 to 2.0.3.
- [Release notes](https://gitlab.com/KonradBorowski/enum-map/tags)
- [Changelog](https://gitlab.com/KonradBorowski/enum-map/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/KonradBorowski/enum-map/commits/master)

---
updated-dependencies:
- dependency-name: enum-map
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 23:20:04 +02:00
dependabot[bot] 9657bde02c build(deps): bump clap from 3.1.2 to 3.1.3
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.2...v3.1.3)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 22:31:25 +02:00
dependabot[bot] b5f65463b6 build(deps): bump png from 0.17.3 to 0.17.4
Bumps [png](https://github.com/image-rs/image-png) from 0.17.3 to 0.17.4.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/commits)

---
updated-dependencies:
- dependency-name: png
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 22:31:11 +02:00
dependabot[bot] ff3aadd134 build(deps): bump clap from 3.0.14 to 3.1.1
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.14 to 3.1.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.0.14...v3.1.1)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 23:36:57 +02:00
dependabot[bot] 8597b35b6c build(deps): bump enum-map from 2.0.1 to 2.0.2
Bumps [enum-map](https://gitlab.com/KonradBorowski/enum-map) from 2.0.1 to 2.0.2.
- [Release notes](https://gitlab.com/KonradBorowski/enum-map/tags)
- [Changelog](https://gitlab.com/KonradBorowski/enum-map/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/KonradBorowski/enum-map/commits/master)

---
updated-dependencies:
- dependency-name: enum-map
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 22:55:54 +02:00
dependabot[bot] 4e2f7b02fc build(deps): bump futures from 0.3.19 to 0.3.21
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.19 to 0.3.21.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.19...0.3.21)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 19:44:57 +02:00
dependabot[bot] db888ad739 build(deps): bump png from 0.17.2 to 0.17.3
Bumps [png](https://github.com/image-rs/image-png) from 0.17.2 to 0.17.3.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/commits)

---
updated-dependencies:
- dependency-name: png
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 18:43:46 +02:00
dependabot[bot] c154b24393 build(deps): bump clap from 3.0.6 to 3.0.14
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.6 to 3.0.14.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v3.0.6...v3.0.14)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 18:10:29 +02:00
dependabot[bot] 036218ed01 build(deps): bump jpeg-decoder from 0.2.1 to 0.2.2
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/compare/v0.2.1...v0.2.2)

---
updated-dependencies:
- dependency-name: jpeg-decoder
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 16:47:13 +02:00
dependabot[bot] 0ba9ed99c2 build(deps): bump enum-map from 2.0.0 to 2.0.1
Bumps [enum-map](https://gitlab.com/KonradBorowski/enum-map) from 2.0.0 to 2.0.1.
- [Release notes](https://gitlab.com/KonradBorowski/enum-map/tags)
- [Changelog](https://gitlab.com/KonradBorowski/enum-map/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/KonradBorowski/enum-map/commits/master)

---
updated-dependencies:
- dependency-name: enum-map
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 16:13:10 +02:00
Mike Welsh bfe0ee2563 wgpu: Fix gradient shader on vulkan backend
A regression in naga caused a mistranslation of the gradient shader
on the vulkan backend. This caused radial gradients to be rendered
as linear gradients on the vulkan backend. dx12 seems unaffected.

This seems to be cased by a switch statement starting with a default
case Re-order the case statements to avoid this. Looks like it's been
fixed in naga master.
2022-01-22 20:54:18 -08:00
Mike Welsh 1e28e1da11 chore: Bump to wgpu 0.12 2022-01-19 13:20:27 -08:00
dependabot[bot] 50d6b48946 build(deps): bump clap from 3.0.1 to 3.0.6
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.1 to 3.0.6.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v3.0.1...v3.0.6)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-11 00:32:55 -08:00
dependabot[bot] 3eea49ef47 build(deps): bump enum-map from 1.1.1 to 2.0.0
Bumps [enum-map](https://gitlab.com/KonradBorowski/enum-map) from 1.1.1 to 2.0.0.
- [Release notes](https://gitlab.com/KonradBorowski/enum-map/tags)
- [Changelog](https://gitlab.com/KonradBorowski/enum-map/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/KonradBorowski/enum-map/commits/master)

---
updated-dependencies:
- dependency-name: enum-map
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-11 00:05:23 -08:00
dependabot[bot] 426bb56fb9 build(deps): bump clap from 3.0.1 to 3.0.5
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.1 to 3.0.5.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v3.0.1...v3.0.5)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 22:05:12 -08:00
dependabot[bot] 86d2e1ddba build(deps): bump clap from 3.0.0-rc.8 to 3.0.1
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.0-rc.8 to 3.0.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_generate-v3.0.0-rc.8...clap_complete-v3.0.1)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-03 22:50:45 +02:00
dependabot[bot] dc8ba4ee59 build(deps): bump clap from 3.0.0-rc.7 to 3.0.0-rc.8
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.0-rc.7 to 3.0.0-rc.8.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_generate-v3.0.0-rc.7...clap_generate-v3.0.0-rc.8)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-27 22:32:31 +02:00
dependabot[bot] a99b23dcf5 build(deps): bump futures from 0.3.18 to 0.3.19
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.18 to 0.3.19.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.18...0.3.19)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-21 08:36:06 +02:00
dependabot[bot] c104b24cea build(deps): bump bytemuck from 1.7.2 to 1.7.3
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/Lokathor/bytemuck/releases)
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.7.2...v1.7.3)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-21 08:35:41 +02:00
dependabot[bot] e369ca7a42 build(deps): bump clap from 3.0.0-rc.5 to 3.0.0-rc.7
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.0-rc.5 to 3.0.0-rc.7.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_generate-v3.0.0-rc.5...clap_generate-v3.0.0-rc.7)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-21 08:35:30 +02:00
relrelb b405870005 canvas: Clamp alpha values
Values outside the range of 0 and 1 are ignored in canvas, unlike
Flash that clamps them.
2021-12-21 08:34:47 +02:00
dependabot[bot] 678d4375bf build(deps): bump clap from 3.0.0-beta.5 to 3.0.0-rc.4
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.0-beta.5 to 3.0.0-rc.4.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.0.0-beta.5...clap_generate-v3.0.0-rc.4)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-15 13:42:50 -08:00
dependabot[bot] b8ff8bb185 build(deps): bump jpeg-decoder from 0.2.0 to 0.2.1
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.2.0 to 0.2.1.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/compare/v0.2.0...v0.2.1)

---
updated-dependencies:
- dependency-name: jpeg-decoder
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-13 23:23:01 +02:00
TÖRÖK Attila 4057332e6b web/canvas: Carry bitmap smoothing flag along with the pattern 2021-12-12 20:43:21 +01:00
TÖRÖK Attila bf470f8a78 web/canvas: Add some TODO and NOTE comments 2021-12-12 20:43:21 +01:00
TÖRÖK Attila 7389b2b9ce web/canvas: Convert CanvasPattern transformation matrix from Twips to regular numbers
The reason this did not cause problems so far was that it was far more
common to fall back to the SVG backend right before this piece of code.
2021-12-12 20:43:21 +01:00
TÖRÖK Attila 57838f882d web/canvas: Respect the smoothing flag when rendering bitmaps 2021-12-12 20:43:21 +01:00
TÖRÖK Attila d5df37afb3 web/canvas: Use a canvas element to store bitmaps from raw RGBA sources
To avoid PNG-encoding every frame of every video for example.

If it needs to be converted to a base64 "data:" URL anyway,
compute it lazily and cache it behind a RefCell.

Raw pixel manipulation can be done through temporary ImageData objects.
The potential to use an image element is retained, so the native JPEG
decoder of the browser can still be utilized.
2021-12-12 20:43:21 +01:00
dependabot[bot] 8007f21ffe build(deps): bump jpeg-decoder from 0.1.22 to 0.2.0
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.1.22 to 0.2.0.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/compare/v0.1.22...v0.2.0)

---
updated-dependencies:
- dependency-name: jpeg-decoder
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-10 00:28:45 +02:00
relrelb 00accf3e2a render: Rename `register_bitmap_jpeg_3` to `register_bitmap_jpeg_3_or_4`
It's actually used by both DefineBitsJpeg3 and DefineBitsJpeg4 tags.
2021-12-04 21:32:16 +02:00
dependabot[bot] ea254b53b7 build(deps): bump futures from 0.3.17 to 0.3.18
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.17 to 0.3.18.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.17...0.3.18)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-29 22:35:40 +02:00
relrelb e2b821e92f chore: Replace `min` + `max` with `clamp`
`clamp` is a bit more efficient, in both runtime and size terms.
2021-11-26 20:54:48 +02:00
relrelb ff2ef47159 canvas: Fill using the even-odd rule
Flash always uses the even-odd fill rule, whereas canvas defaults to
nonzero.
Specify the fill rule explicitly in both `swf_shape_to_canvas_commands`
and `swf_shape_to_svg`.
2021-11-20 22:48:37 +02:00
Mike Welsh 26e0432ccc wgpu: Fix some invalid WGSL
naga is currently lenient about some things which are invalid by
the WGSL spec. The Tint WGSL compiler disagreed, so these shaders
failed to compile in Chrome.
2021-10-25 21:59:09 -07:00
Mike Welsh bbb788ced3 desktop: Improve error message for GL
wgpu only supports OpenGL on Linux, so provide a better message if
a user tries to use the GL backend on Windows/macOS.
2021-10-24 17:20:19 -07:00
Mike Welsh 2b57c0947a wgpu: Disallow DX11 backend
This backend has not yet been reimplemented in wgpu 0.10+, so
disallow it for now.
2021-10-24 17:20:19 -07:00
Mike Welsh e10d0fcbe7 wgpu: Switch shaders to WGSL 2021-10-24 17:20:19 -07:00
Mike Welsh 4141909bcb web: Support wgpu on web
Add wgpu feature to web build (disabled by default currently).
2021-10-24 17:20:19 -07:00
Mike Welsh 4c44e27a00 wgpu: Remove unnecessary dependencies 2021-10-24 17:20:19 -07:00
Mike Welsh df270c55af wgpu: Make WgpuRenderBackend::build_descriptors async
This will be necessary for using wgpu on web, where the whole
renderer creation will need to be async.
2021-10-24 17:20:19 -07:00
Mike Welsh 9067dd3668 wgpu: Allow GL as a graphics backend option 2021-10-24 17:20:19 -07:00
Mike Welsh decc38a45c wgpu: Use uniforms instead of push constants 2021-10-24 17:20:19 -07:00
Mike Welsh 0cbdad1ff2 wgpu: Bump to wgpu 0.11 2021-10-24 17:20:19 -07:00