From d52ccd889713b528d3665b7b0041b6b43dab5fd1 Mon Sep 17 00:00:00 2001 From: David Craven Date: Sat, 12 Feb 2022 17:15:59 +0100 Subject: [PATCH] New release. --- .github/workflows/release.yml | 56 +- Cargo.lock | 1305 ++++++--------------------------- Cargo.toml | 32 +- src/lib.rs | 97 +++ src/main.rs | 72 +- src/shapes.rs | 129 ++++ 6 files changed, 517 insertions(+), 1174 deletions(-) create mode 100644 src/lib.rs create mode 100644 src/shapes.rs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14ddf531..e29b9856 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,24 +6,50 @@ on: name: release xcross jobs: - xcross: + # android requires at least d8 and adb to be useful and since it's widely available we + # don't have to repackage it + #android: + # runs-on: macos-11 + # steps: + # - run: mkdir -p xcross/android + # - run: ls /Users/runner/Library/Android/sdk/ndk + # - run: cp -R /Users/runner/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot xcross/android + # - run: cp -R /Users/runner/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/12.0.8 xcross/android/clang + # - run: echo "INPUT(-lunwind)" > xcross/android/clang/lib/linux/aarch64/libgcc.a + + macos: runs-on: macos-11 steps: - #- run: brew install coreutils - - run: mkdir -p xcross/android - - run: ls /Users/runner/Library/Android/sdk/ndk - - run: cp -R /Users/runner/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot xcross/android - - run: cp -R /Users/runner/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/12.0.8 xcross/android/clang - - run: echo "INPUT(-lunwind)" > xcross/android/clang/lib/linux/aarch64/libgcc.a - run: ls /Applications/Xcode* - - run: cp -R /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk xcross/macos - - run: cp -R /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk xcross/ios - #- name: Install rust toolchain - # uses: hecrj/setup-rust-action@v1 - #- run: cargo install xwin - #- run: xwin --accept-license yes splat --output xcross/windows --disable-symlinks - - run: gtar --zstd -cf xcross.tar.zst xcross - - run: gh release upload $TAG xcross.tar.zst -R cloudpeers/xcross + - run: gtar --zstd -cf MacOSX.sdk.tar.zst $SDK_PATH + env: + SDK_PATH: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk + - run: gh release upload $TAG MacOSX.sdk.tar.zst -R cloudpeers/xcross + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ github.event.release.tag_name }} + + ios: + runs-on: macos-11 + steps: + - run: ls /Applications/Xcode* + - run: gtar --zstd -cf iPhoneOS.sdk.tar.zst $SDK_PATH + env: + SDK_PATH: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk + - run: gh release upload $TAG iPhoneOS.sdk.tar.zst -R cloudpeers/xcross + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ github.event.release.tag_name }} + + windows: + runs-on: ubuntu-latest + steps: + - name: Install rust toolchain + uses: hecrj/setup-rust-action@v1 + - run: cargo install xwin + - run: xwin --accept-license yes splat --output Windows.sdk + - run: tar --zstd -cf Windows.sdk.tar.zst Windows.sdk + - run: gh release upload $TAG Windows.sdk.tar.zst -R cloudpeers/xcross env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG: ${{ github.event.release.tag_name }} diff --git a/Cargo.lock b/Cargo.lock index d25915b5..f0f79665 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,22 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ab_glyph" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20b228f2c198f98d4337ceb560333fb12cbb2f4948a953bf8c57d09deb219603" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser", -] - -[[package]] -name = "ab_glyph_rasterizer" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" - [[package]] name = "ahash" version = "0.7.6" @@ -30,14 +14,38 @@ dependencies = [ ] [[package]] -name = "approx" -version = "0.5.0" +name = "aho-corasick" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "072df7202e63b127ab55acfe16ce97013d5b97bf160489336d3f1840fd78e99e" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ - "num-traits", + "memchr", ] +[[package]] +name = "android_log-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" + +[[package]] +name = "android_logger" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ed09b18365ed295d722d0b5ed59c01b79a826ff2d2a8f73d5ecca8e6fb2f66" +dependencies = [ + "android_log-sys", + "env_logger 0.8.4", + "lazy_static", + "log", +] + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + [[package]] name = "arrayvec" version = "0.7.2" @@ -46,24 +54,29 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "ash" -version = "0.33.3+1.2.191" +version = "0.34.0+1.2.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4f1d82f164f838ae413296d1131aa6fa79b917d25bebaa7033d25620c09219" +checksum = "b0f780da53d0063880d45554306489f09dd8d1bda47688b4a57bc579119356df" dependencies = [ "libloading", ] [[package]] -name = "autocfg" -version = "1.0.1" +name = "atty" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] [[package]] -name = "base64" -version = "0.13.0" +name = "autocfg" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "bit-set" @@ -82,9 +95,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block" @@ -92,12 +105,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" -[[package]] -name = "bumpalo" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad807f2fc2bf185eeb98ff3a901bd46dc5ad58163d0fa4577ba0d25674d71708" - [[package]] name = "bumpalo" version = "3.8.0" @@ -109,20 +116,6 @@ name = "bytemuck" version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] [[package]] name = "byteorder" @@ -132,19 +125,17 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "calloop" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42dcfbd723aa6eff9f024cfd5ad08b11144d79b2d8d37b4a31a006ceab255c77" +checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" dependencies = [ "log", - "nix 0.22.2", + "nix", ] [[package]] name = "cc" version = "1.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" [[package]] name = "cfg-if" @@ -164,56 +155,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" -[[package]] -name = "clipboard-win" -version = "4.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8340083d28acb43451166543b98c838299b7e0863621be53a338adceea0ed" -dependencies = [ - "error-code", - "str-buf", - "winapi", -] - -[[package]] -name = "clipboard_macos" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145a7f9e9b89453bc0a5e32d166456405d389cea5b578f57f1274b1397588a95" -dependencies = [ - "objc", - "objc-foundation", - "objc_id", -] - -[[package]] -name = "clipboard_wayland" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f6364a9f7a66f2ac1a1a098aa1c7f6b686f2496c6ac5e5c0d773445df912747" -dependencies = [ - "smithay-clipboard", -] - -[[package]] -name = "clipboard_x11" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64240d63f1883d87e5637bfcaf9d77e5c8bd24e30fd440ea2dff5c48c0bf0b7a" -dependencies = [ - "thiserror", - "x11rb", -] - -[[package]] -name = "cmake" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b858541263efe664aead4a5209a4ae5c5d2811167d4ed4ee0944503f8d2089" -dependencies = [ - "cc", -] - [[package]] name = "cocoa" version = "0.24.0" @@ -330,18 +271,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-text" -version = "19.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" -dependencies = [ - "core-foundation 0.9.2", - "core-graphics 0.22.3", - "foreign-types", - "libc", -] - [[package]] name = "core-video-sys" version = "0.1.4" @@ -355,50 +284,6 @@ dependencies = [ "objc", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" -dependencies = [ - "cfg-if 1.0.0", - "lazy_static", -] - [[package]] name = "cty" version = "0.2.2" @@ -418,9 +303,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.10.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" dependencies = [ "darling_core", "darling_macro", @@ -428,9 +313,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.10.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" dependencies = [ "fnv", "ident_case", @@ -442,47 +327,15 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.10.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" dependencies = [ "darling_core", "quote", "syn", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dispatch" version = "0.2.0" @@ -498,22 +351,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "dodrio" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7593dfc68e57dc1d058ada0f151ba07f4b05183c4da4c4df8ff651a81ef0fab" -dependencies = [ - "bumpalo 2.6.0", - "cfg-if 0.1.10", - "fxhash", - "js-sys", - "longest-increasing-subsequence", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "downcast-rs" version = "1.2.0" @@ -521,31 +358,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] -name = "dwrote" -version = "0.11.0" +name = "env_logger" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" dependencies = [ - "lazy_static", - "libc", - "winapi", - "wio", + "log", + "regex", ] [[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "error-code" -version = "2.3.0" +name = "env_logger" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5115567ac25674e0043e472be13d14e537f37ea8aa4bdc4aef0c89add1db1ff" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" dependencies = [ - "libc", - "str-buf", + "atty", + "humantime", + "log", + "regex", + "termcolor", ] [[package]] @@ -557,53 +389,12 @@ dependencies = [ "num-traits", ] -[[package]] -name = "expat-sys" -version = "2.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa" -dependencies = [ - "cmake", - "pkg-config", -] - -[[package]] -name = "float-ord" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "font-kit" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c9a156ec38864999bc9c4156e5f3b50224d4a5578028a64e5a3875caa9ee28" -dependencies = [ - "bitflags", - "byteorder", - "core-foundation 0.9.2", - "core-graphics 0.22.3", - "core-text", - "dirs-next", - "dwrote", - "float-ord", - "freetype", - "lazy_static", - "libc", - "log", - "pathfinder_geometry", - "pathfinder_simd", - "servo-fontconfig", - "walkdir", - "winapi", -] - [[package]] name = "foreign-types" version = "0.3.2" @@ -619,127 +410,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -[[package]] -name = "form_urlencoded" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" -dependencies = [ - "matches", - "percent-encoding", -] - -[[package]] -name = "freetype" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee38378a9e3db1cc693b4f88d166ae375338a0ff75cb8263e1c601d51f35dc6" -dependencies = [ - "freetype-sys", - "libc", -] - -[[package]] -name = "freetype-sys" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" -dependencies = [ - "cmake", - "libc", - "pkg-config", -] - -[[package]] -name = "futures" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" - -[[package]] -name = "futures-executor" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", -] - -[[package]] -name = "futures-io" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" - -[[package]] -name = "futures-macro" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" - -[[package]] -name = "futures-task" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72" - -[[package]] -name = "futures-util" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - [[package]] name = "fxhash" version = "0.2.1" @@ -749,16 +419,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "gethostname" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e692e296bfac1d2533ef168d0b60ff5897b8b70a4009276834014dd8924cc028" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "getrandom" version = "0.2.3" @@ -770,20 +430,11 @@ dependencies = [ "wasi", ] -[[package]] -name = "glam" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579160312273c954cc51bd440f059dde741029ac8daf8c84fece76cb77f62c15" -dependencies = [ - "version_check", -] - [[package]] name = "glow" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c07210904884e8e2e6a2d7f36f39040a9cefe3b379b721969b5275e9f5b464a" +checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" dependencies = [ "js-sys", "slotmap", @@ -791,45 +442,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "glyph_brush" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21932fbf719272848eec4583740d978203c6e7da4c4e203358f5b95946c97409" -dependencies = [ - "glyph_brush_draw_cache", - "glyph_brush_layout", - "log", - "ordered-float", - "rustc-hash", - "twox-hash", -] - -[[package]] -name = "glyph_brush_draw_cache" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6010675390f6889e09a21e2c8b575b3ee25667ea8237a8d59423f73cb8c28610" -dependencies = [ - "ab_glyph", - "crossbeam-channel", - "crossbeam-deque", - "linked-hash-map", - "rayon", - "rustc-hash", -] - -[[package]] -name = "glyph_brush_layout" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc32c2334f00ca5ac3695c5009ae35da21da8c62d255b5b96d56e2597a637a38" -dependencies = [ - "ab_glyph", - "approx", - "xi-unicode", -] - [[package]] name = "gpu-alloc" version = "0.5.2" @@ -869,16 +481,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "guillotiere" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782" -dependencies = [ - "euclid", - "svg_fmt", -] - [[package]] name = "hashbrown" version = "0.11.2" @@ -904,121 +506,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" [[package]] -name = "iced" -version = "0.3.0" -source = "git+https://github.com/hecrj/iced#d19858bce8f4e425837d55c9bda44c258b2dd176" -dependencies = [ - "iced_core", - "iced_futures", - "iced_web", - "iced_wgpu", - "iced_winit", - "thiserror", -] - -[[package]] -name = "iced_core" -version = "0.4.0" -source = "git+https://github.com/hecrj/iced#d19858bce8f4e425837d55c9bda44c258b2dd176" -dependencies = [ - "bitflags", -] - -[[package]] -name = "iced_futures" -version = "0.3.0" -source = "git+https://github.com/hecrj/iced#d19858bce8f4e425837d55c9bda44c258b2dd176" -dependencies = [ - "futures", - "log", - "wasm-bindgen-futures", -] - -[[package]] -name = "iced_graphics" -version = "0.2.0" -source = "git+https://github.com/hecrj/iced#d19858bce8f4e425837d55c9bda44c258b2dd176" -dependencies = [ - "bytemuck", - "font-kit", - "glam", - "iced_native", - "iced_style", - "raw-window-handle 0.3.4", - "thiserror", -] - -[[package]] -name = "iced_native" -version = "0.4.0" -source = "git+https://github.com/hecrj/iced#d19858bce8f4e425837d55c9bda44c258b2dd176" -dependencies = [ - "iced_core", - "iced_futures", - "iced_style", - "num-traits", - "twox-hash", - "unicode-segmentation", -] - -[[package]] -name = "iced_style" -version = "0.3.0" -source = "git+https://github.com/hecrj/iced#d19858bce8f4e425837d55c9bda44c258b2dd176" -dependencies = [ - "iced_core", -] - -[[package]] -name = "iced_web" -version = "0.4.0" -source = "git+https://github.com/hecrj/iced#d19858bce8f4e425837d55c9bda44c258b2dd176" -dependencies = [ - "base64", - "dodrio", - "iced_core", - "iced_futures", - "iced_style", - "num-traits", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "iced_wgpu" -version = "0.4.0" -source = "git+https://github.com/hecrj/iced#d19858bce8f4e425837d55c9bda44c258b2dd176" -dependencies = [ - "bitflags", - "bytemuck", - "futures", - "glyph_brush", - "guillotiere", - "iced_graphics", - "iced_native", - "kamadak-exif", - "log", - "raw-window-handle 0.3.4", - "wgpu", - "wgpu_glyph", -] - -[[package]] -name = "iced_winit" -version = "0.3.0" -source = "git+https://github.com/hecrj/iced#d19858bce8f4e425837d55c9bda44c258b2dd176" -dependencies = [ - "iced_futures", - "iced_graphics", - "iced_native", - "log", - "thiserror", - "winapi", - "window_clipboard", - "winit", -] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "ident_case" @@ -1026,17 +517,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "indexmap" version = "1.7.0" @@ -1080,15 +560,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kamadak-exif" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70494964492bf8e491eb3951c5d70c9627eb7100ede6cc56d748b9a3f302cfb6" -dependencies = [ - "mutate_once", -] - [[package]] name = "khronos-egl" version = "4.1.0" @@ -1121,12 +592,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "linked-hash-map" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" - [[package]] name = "lock_api" version = "0.4.5" @@ -1146,10 +611,15 @@ dependencies = [ ] [[package]] -name = "longest-increasing-subsequence" -version = "0.1.0" +name = "lyon_geom" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86" +checksum = "6ce4e12203c428a58200b8cf1c0a3aad1cda907008ea11310bb3729593e5f933" +dependencies = [ + "arrayvec 0.5.2", + "euclid", + "num-traits", +] [[package]] name = "malloc_buf" @@ -1160,12 +630,6 @@ dependencies = [ "libc", ] -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "memchr" version = "2.4.1" @@ -1212,9 +676,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "mio" -version = "0.7.14" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" dependencies = [ "libc", "log", @@ -1232,36 +696,31 @@ dependencies = [ "winapi", ] -[[package]] -name = "mutate_once" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" - [[package]] name = "naga" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806f448a7ce662ca79ef5484ef8f451a9b7c51b8166c95f5a667228b3825a6ca" +checksum = "a4419062f8aa39fb25938169486341945758679e260ddbc1f94bfd1f33924dc2" dependencies = [ "bit-set", "bitflags", "codespan-reporting", - "fxhash", "hexf-parse", "indexmap", "log", "num-traits", + "rustc-hash", "spirv", "thiserror", ] [[package]] name = "ndk" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" +checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" dependencies = [ + "bitflags", "jni-sys", "ndk-sys", "num_enum", @@ -1270,10 +729,11 @@ dependencies = [ [[package]] name = "ndk-glue" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" +checksum = "fc291b8de2095cba8dab7cf381bf582ff4c17a09acf854c32e46545b08085d28" dependencies = [ + "android_logger", "lazy_static", "libc", "log", @@ -1284,41 +744,28 @@ dependencies = [ [[package]] name = "ndk-macro" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ "darling", - "proc-macro-crate 0.1.5", + "proc-macro-crate", "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "ndk-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" - -[[package]] -name = "nix" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e06129fb611568ef4e868c14b326274959aa70ff7776e9d55323531c374945" -dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", - "memoffset", + "syn", ] +[[package]] +name = "ndk-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" + [[package]] name = "nix" -version = "0.22.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3bb9a13fa32bc5aeb64150cd3f32d6cf4c748f8f8a417cce5d2eb976a8370ba" +checksum = "cf1e25ee6b412c2a1e3fcb6a4499a5c1bfe7f43e014bdce9a6b6666e5aa2d187" dependencies = [ "bitflags", "cc", @@ -1356,33 +803,22 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "num_enum" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "085fe377a4b2805c0fbc09484415ec261174614b7f080b0e0d520456ac421a67" +checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad" dependencies = [ - "derivative", "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5249369707a1e07b39f78d98c8f34e00aca7dcb053812fdbb5ad7be82c1bba38" +checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1398,17 +834,6 @@ dependencies = [ "objc_exception", ] -[[package]] -name = "objc-foundation" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" -dependencies = [ - "block", - "objc", - "objc_id", -] - [[package]] name = "objc_exception" version = "0.1.2" @@ -1418,39 +843,12 @@ dependencies = [ "cc", ] -[[package]] -name = "objc_id" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" -dependencies = [ - "objc", -] - [[package]] name = "once_cell" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" -[[package]] -name = "ordered-float" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97c9d06878b3a851e8026ef94bf7fef9ba93062cd412601da4d9cf369b1cc62d" -dependencies = [ - "num-traits", -] - -[[package]] -name = "owned_ttf_parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ee3f72636e6f164cc41c9f9057f4e58c4e13507699ea7f5e5242b64b8198ee" -dependencies = [ - "ttf-parser", -] - [[package]] name = "parking_lot" version = "0.11.2" @@ -1476,25 +874,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "pathfinder_geometry" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3" -dependencies = [ - "log", - "pathfinder_simd", -] - -[[package]] -name = "pathfinder_simd" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39fe46acc5503595e5949c17b818714d26fdf9b4920eacf3b2947f0199f4a6ff" -dependencies = [ - "rustc_version", -] - [[package]] name = "percent-encoding" version = "2.1.0" @@ -1502,26 +881,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] -name = "pest" -version = "2.1.3" +name = "pixels" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +checksum = "a3be4951b24b374c72b0aaaeb59e51e1acb38b8e680b11f43c1d0049b8550891" dependencies = [ - "ucd-trie", + "bytemuck", + "pollster", + "raw-window-handle", + "thiserror", + "ultraviolet", + "wgpu", ] -[[package]] -name = "pin-project-lite" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "pkg-config" version = "0.3.24" @@ -1529,19 +901,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" [[package]] -name = "ppv-lite86" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" - -[[package]] -name = "proc-macro-crate" -version = "0.1.5" +name = "pollster" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] +checksum = "bb20dcc30536a1508e75d47dd0e399bb2fe7354dcf35cda9127f2bf1ed92e30e" [[package]] name = "proc-macro-crate" @@ -1555,9 +918,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.34" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f84e92c0f7c9d58328b85a78557813e4bd845130db68d7184635344399423b1" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] @@ -1570,53 +933,13 @@ checksum = "9926767b8b8244d7b6b64546585121d193c3d0b4856ccd656b7bfa9deb91ab6a" [[package]] name = "quote" -version = "1.0.10" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core", -] - [[package]] name = "range-alloc" version = "0.1.2" @@ -1624,13 +947,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6" [[package]] -name = "raw-window-handle" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" +name = "raqote" +version = "0.8.1-alpha.0" +source = "git+https://github.com/jrmuizel/raqote.git?rev=dea376474966fe91f0fa3c5115171e0df86bac22#dea376474966fe91f0fa3c5115171e0df86bac22" dependencies = [ - "libc", - "raw-window-handle 0.4.2", + "euclid", + "lyon_geom", + "sw-composite", + "typed-arena", ] [[package]] @@ -1642,31 +966,6 @@ dependencies = [ "cty", ] -[[package]] -name = "rayon" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" -dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", -] - [[package]] name = "redox_syscall" version = "0.2.10" @@ -1677,15 +976,22 @@ dependencies = [ ] [[package]] -name = "redox_users" -version = "0.4.0" +name = "regex" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ - "getrandom", - "redox_syscall", + "aho-corasick", + "memchr", + "regex-syntax", ] +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + [[package]] name = "renderdoc-sys" version = "0.7.1" @@ -1699,21 +1005,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] -name = "rustc_version" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" -dependencies = [ - "semver", -] - -[[package]] -name = "same-file" -version = "1.0.6" +name = "safe_arch" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" dependencies = [ - "winapi-util", + "bytemuck", ] [[package]] @@ -1728,57 +1025,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - [[package]] name = "serde" version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9875c23cf305cd1fd7eb77234cbb705f21ea6a72c637a5c6db5fe4b8e7f008" -[[package]] -name = "servo-fontconfig" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c" -dependencies = [ - "libc", - "servo-fontconfig-sys", -] - -[[package]] -name = "servo-fontconfig-sys" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" -dependencies = [ - "expat-sys", - "freetype-sys", - "pkg-config", -] - -[[package]] -name = "slab" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" - [[package]] name = "slotmap" version = "1.0.6" @@ -1796,9 +1048,9 @@ checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" [[package]] name = "smithay-client-toolkit" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210cf40de565aaaa085face1d860b17f6aee9f76f9d2816307ea2cc45eeb64f3" +checksum = "1325f292209cee78d5035530932422a30aa4c8fda1a16593ac083c1de211e68a" dependencies = [ "bitflags", "calloop", @@ -1806,23 +1058,13 @@ dependencies = [ "lazy_static", "log", "memmap2", - "nix 0.22.2", + "nix", "pkg-config", "wayland-client", "wayland-cursor", "wayland-protocols", ] -[[package]] -name = "smithay-clipboard" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "610b551bd25378bfd2b8e7a0fcbd83d427e8f2f6a40c47ae0f70688e9949dd55" -dependencies = [ - "smithay-client-toolkit", - "wayland-client", -] - [[package]] name = "spirv" version = "0.2.0+1.5.4" @@ -1833,35 +1075,23 @@ dependencies = [ "num-traits", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "str-buf" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d44a3643b4ff9caf57abcee9c2c621d6c03d9135e0d8b589bd9afb5992cb176a" - [[package]] name = "strsim" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] -name = "svg_fmt" -version = "0.4.1" +name = "sw-composite" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2" +checksum = "e39674047b1748e8bf4865142772a6637bd32d8b4b27e3c2248dd122f637808b" [[package]] name = "syn" -version = "1.0.83" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a1dfb999630e338648c83e91c59a4e9fb7620f520c3194b6b89e276f2f1959" +checksum = "ecb2e6da8ee5eb9a61068762a32fa9619cc591ceb055b3687f4cd4051ec2e06b" dependencies = [ "proc-macro2", "quote", @@ -1897,21 +1127,6 @@ dependencies = [ "syn", ] -[[package]] -name = "tinyvec" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - [[package]] name = "toml" version = "0.5.8" @@ -1922,49 +1137,20 @@ dependencies = [ ] [[package]] -name = "ttf-parser" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76dacc724328b3d5e2ed67f9e30cdb56893a34ab239032502cc8f19f8dae4bbc" - -[[package]] -name = "twox-hash" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f559b464de2e2bdabcac6a210d12e9b5a5973c251e102c44c585c71d51bd78e" -dependencies = [ - "cfg-if 1.0.0", - "rand", - "static_assertions", -] - -[[package]] -name = "ucd-trie" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" - -[[package]] -name = "unicode-bidi" -version = "0.3.7" +name = "typed-arena" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" [[package]] -name = "unicode-normalization" -version = "0.1.19" +name = "ultraviolet" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "16b9e3507eba17043af05c8a72fce3ec2c24b58945f45732e71dbc6646d904a7" dependencies = [ - "tinyvec", + "wide", ] -[[package]] -name = "unicode-segmentation" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" - [[package]] name = "unicode-width" version = "0.1.9" @@ -1977,34 +1163,11 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" -[[package]] -name = "url" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" -dependencies = [ - "form_urlencoded", - "idna", - "matches", - "percent-encoding", -] - [[package]] name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "walkdir" -version = "2.3.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" @@ -2028,7 +1191,7 @@ version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ - "bumpalo 3.8.0", + "bumpalo", "lazy_static", "log", "proc-macro2", @@ -2080,14 +1243,14 @@ checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "wayland-client" -version = "0.29.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9108ec1c37f4774d0c2937ba1a6c23d1786b2152c4a13bd9fdb20e42d16e8841" +checksum = "1bc00a64219e9569842bf4e1239be219e08987e306385ac0c2166c6342e5bf77" dependencies = [ "bitflags", "downcast-rs", "libc", - "nix 0.22.2", + "nix", "scoped-tls", "wayland-commons", "wayland-scanner", @@ -2096,11 +1259,11 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.29.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265ef51b3b3e5c9ef098f10425c39624663f459c3821dcaacc4748be975f1beb" +checksum = "6ea80a5b96e283f980f23ea7a53c71f14c05a9332ec5f59c784618743f98fddf" dependencies = [ - "nix 0.22.2", + "nix", "once_cell", "smallvec", "wayland-sys", @@ -2108,20 +1271,20 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.29.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c19bb6628daf4097e58b7911481e8371e13318d5a60894779901bd3267407a7" +checksum = "13bf37fd845bf29a5a9e57ad9c14baedb64f926f071e27afb8654d3ca348efd3" dependencies = [ - "nix 0.22.2", + "nix", "wayland-client", "xcursor", ] [[package]] name = "wayland-protocols" -version = "0.29.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b3b6f1dc0193072ef4eadcb144da30d58c1f2895516c063804d213310703c8e" +checksum = "95eec5f6e43e4ad07088aa7003feb5df261684ffa69224ef57501110ead88af4" dependencies = [ "bitflags", "wayland-client", @@ -2131,9 +1294,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.29.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaaf2bc85e7b9143159af96bd23d954a5abe391c4376db712320643280fdc6f4" +checksum = "b9051905a7ef9512485430e8fd27cdf3802aabf14323bb30377334b2fb4685ac" dependencies = [ "proc-macro2", "quote", @@ -2142,9 +1305,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.29.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba9e06acb775b3007f8d3094438306979e572d1d3b844d7a71557a84b055d959" +checksum = "8c13db39542caaaed85c6dda14edefbb2104e695aec4b838313d8eacaa8862ab" dependencies = [ "dlib", "lazy_static", @@ -2163,15 +1326,16 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7181fe6ba5f4b632a9079cc9e922a64555156c87def72c063f94b180c7d68" +checksum = "b97cd781ff044d6d697b632a2e212032c2e957d1afaa21dbf58069cbb8f78567" dependencies = [ - "arrayvec", + "arrayvec 0.7.2", "js-sys", "log", + "naga", "parking_lot", - "raw-window-handle 0.3.4", + "raw-window-handle", "smallvec", "wasm-bindgen", "wasm-bindgen-futures", @@ -2183,20 +1347,21 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35600627b6c718ad0e23ed75fb6140bfe32cdf21c8f539ce3c9ab8180e2cb38e" +checksum = "cfe9cb9c9d728c0f7ea0c309f1b3d5e9d5c7d379890d0a4e3df3103323ff7a84" dependencies = [ - "arrayvec", + "arrayvec 0.7.2", "bitflags", "cfg_aliases", + "codespan-reporting", "copyless", "fxhash", "log", "naga", "parking_lot", "profiling", - "raw-window-handle 0.3.4", + "raw-window-handle", "smallvec", "thiserror", "wgpu-hal", @@ -2205,11 +1370,11 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.11.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af28b29ef0b44cd22dd9895d4349b9d5a687df42f58da234871198637eabe328" +checksum = "742ec904d0577e1a88b82dba6cf0347c12197cd664b859b05f868bceb8cfff4d" dependencies = [ - "arrayvec", + "arrayvec 0.7.2", "ash", "bit-set", "bitflags", @@ -2232,7 +1397,7 @@ dependencies = [ "parking_lot", "profiling", "range-alloc", - "raw-window-handle 0.3.4", + "raw-window-handle", "renderdoc-sys", "thiserror", "wasm-bindgen", @@ -2243,23 +1408,21 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e15e44ba88ec415466e18e91881319e7c9e96cb905dc623305168aea65b85ccc" +checksum = "549533d9e1cdd4b4cda7718d33ff500fc4c34b5467b71d76b547ae0324f3b2a2" dependencies = [ "bitflags", ] [[package]] -name = "wgpu_glyph" -version = "0.15.2" +name = "wide" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f5774759a6288a2bf29dd56d04ef79e73c1bc2b1c289fdf25e502a2a7dc3eda" +checksum = "46bbe7c604a27ca0b05c5503221e76da628225b568e6f1280b42dbad3b72d89b" dependencies = [ "bytemuck", - "glyph_brush", - "log", - "wgpu", + "safe_arch", ] [[package]] @@ -2287,38 +1450,17 @@ dependencies = [ "winapi", ] -[[package]] -name = "winapi-wsapoll" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "window_clipboard" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a4518b538a45ad39d138a8c3bea8f6b4452174aeb38143d1dd643a3a838ccc" -dependencies = [ - "clipboard-win", - "clipboard_macos", - "clipboard_wayland", - "clipboard_x11", - "raw-window-handle 0.3.4", -] - [[package]] name = "winit" -version = "0.25.0" -source = "git+https://github.com/iced-rs/winit?rev=1e6623c4d06d110e5408dcbdf1edebd07e6a200e#1e6623c4d06d110e5408dcbdf1edebd07e6a200e" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70466a5f4825cc88c92963591b06dbc255420bffe19d847bfcda475e82d079c0" dependencies = [ "bitflags", "block", @@ -2338,7 +1480,7 @@ dependencies = [ "objc", "parking_lot", "percent-encoding", - "raw-window-handle 0.3.4", + "raw-window-handle", "smithay-client-toolkit", "wasm-bindgen", "wayland-client", @@ -2349,12 +1491,12 @@ dependencies = [ ] [[package]] -name = "wio" -version = "0.2.2" +name = "winit_input_helper" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +checksum = "72c8618b5c5e3f44a9d0a2ace15ad580cb7402d585507f4f9c74d07af7603909" dependencies = [ - "winapi", + "winit", ] [[package]] @@ -2369,22 +1511,17 @@ dependencies = [ ] [[package]] -name = "x11rb" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffb080b3f2f616242a4eb8e7d325035312127901025b0052bc3154a282d0f19" -dependencies = [ - "gethostname", - "nix 0.20.2", - "winapi", - "winapi-wsapoll", -] - -[[package]] -name = "xcross" +name = "xcross-example" version = "0.1.0" dependencies = [ - "iced", + "env_logger 0.9.0", + "euclid", + "log", + "ndk-glue", + "pixels", + "raqote", + "winit", + "winit_input_helper", ] [[package]] @@ -2396,12 +1533,6 @@ dependencies = [ "nom", ] -[[package]] -name = "xi-unicode" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" - [[package]] name = "xml-rs" version = "0.8.4" diff --git a/Cargo.toml b/Cargo.toml index 61740060..d6c819c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,35 @@ [package] -name = "xcross" +name = "xcross-example" version = "0.1.0" +authors = ["Jay Oster "] edition = "2021" +publish = false +description = "an example app" + +[lib] +crate-type = ["cdylib"] + +[features] +optimize = ["log/release_max_level_warn"] +default = ["optimize"] [dependencies] -iced = { git = "https://github.com/hecrj/iced" } +env_logger = "0.9" +euclid = "0.22" +log = "0.4" +pixels = "0.9.0" +winit = "0.26" +winit_input_helper = "0.11" + +[dependencies.raqote] +git = "https://github.com/jrmuizel/raqote.git" +rev = "dea376474966fe91f0fa3c5115171e0df86bac22" +default-features = false + +[target.'cfg(target_os = "android")'.dependencies] +ndk-glue = { version = "0.5.0", features = ["logger"] } + +[patch.crates-io] +cc = { path = "../cc-rs" } + +[package.metadata.bundle] diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000..7cadc259 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,97 @@ +#![deny(clippy::all)] +#![forbid(unsafe_code)] + +use crate::shapes::Shapes; +use log::error; +use pixels::{Error, Pixels, SurfaceTexture}; +use std::time::Instant; +use winit::dpi::LogicalSize; +use winit::event::{Event, VirtualKeyCode}; +use winit::event_loop::{ControlFlow, EventLoop}; +use winit::window::WindowBuilder; +use winit_input_helper::WinitInputHelper; + +mod shapes; + +const WIDTH: u32 = 400; +const HEIGHT: u32 = 400; + +#[cfg_attr( + target_os = "android", + ndk_glue::main(backtrace = "on", logger(level = "debug", tag = "xcross-example")) +)] +pub fn main() { + run().unwrap(); +} + +pub fn run() -> Result<(), Error> { + env_logger::init(); + let event_loop = EventLoop::new(); + let mut input = WinitInputHelper::new(); + let window = { + let size = LogicalSize::new(WIDTH as f64, HEIGHT as f64); + WindowBuilder::new() + .with_title("Hello Raqote") + .with_inner_size(size) + .with_min_inner_size(size) + .build(&event_loop) + .unwrap() + }; + + let (mut pixels, mut shapes) = { + let window_size = window.inner_size(); + let surface_texture = SurfaceTexture::new(window_size.width, window_size.height, &window); + + let pixels = Pixels::new(WIDTH, HEIGHT, surface_texture)?; + let shapes = Shapes::new(WIDTH, HEIGHT); + + (pixels, shapes) + }; + + let mut now = Instant::now(); + + event_loop.run(move |event, _, control_flow| { + // Draw the current frame + if let Event::RedrawRequested(_) = event { + for (dst, &src) in pixels + .get_frame() + .chunks_exact_mut(4) + .zip(shapes.get_frame().iter()) + { + dst[0] = (src >> 16) as u8; + dst[1] = (src >> 8) as u8; + dst[2] = src as u8; + dst[3] = (src >> 24) as u8; + } + + if pixels + .render() + .map_err(|e| error!("pixels.render() failed: {}", e)) + .is_err() + { + *control_flow = ControlFlow::Exit; + return; + } + } + + // Handle input events + if input.update(&event) { + // Close events + if input.key_pressed(VirtualKeyCode::Escape) || input.quit() { + *control_flow = ControlFlow::Exit; + return; + } + + // Resize the window + if let Some(size) = input.window_resized() { + pixels.resize_surface(size.width, size.height); + } + + // Update internal state and request a redraw + shapes.draw(now.elapsed().as_secs_f32()); + window.request_redraw(); + + now = Instant::now(); + } + }); +} diff --git a/src/main.rs b/src/main.rs index a736f68e..0a3909a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,71 +1,3 @@ -use iced::{ - button, executor, Application, Button, Column, Command, Element, Settings, Text, -}; - -#[derive(Default)] -struct Counter { - // The counter value - value: i32, - - // The local state of the two buttons - increment_button: button::State, - decrement_button: button::State, -} - -#[derive(Debug, Clone, Copy)] -pub enum Message { - IncrementPressed, - DecrementPressed, -} - -impl Application for Counter { - type Executor = executor::Default; - type Message = Message; - type Flags = (); - - fn new(_flags: ()) -> (Self, Command) { - (Counter::default(), Command::none()) - } - - fn title(&self) -> String { - "counter".into() - } - - fn view(&mut self) -> Element { - // We use a column: a simple vertical layout - Column::new() - .push( - // The increment button. We tell it to produce an - // `IncrementPressed` message when pressed - Button::new(&mut self.increment_button, Text::new("+")) - .on_press(Message::IncrementPressed), - ) - .push( - // We show the value of the counter here - Text::new(self.value.to_string()).size(50), - ) - .push( - // The decrement button. We tell it to produce a - // `DecrementPressed` message when pressed - Button::new(&mut self.decrement_button, Text::new("-")) - .on_press(Message::DecrementPressed), - ) - .into() - } - - fn update(&mut self, message: Message) -> Command { - match message { - Message::IncrementPressed => { - self.value += 1; - } - Message::DecrementPressed => { - self.value -= 1; - } - } - Command::none() - } -} - -pub fn main() -> iced::Result { - Counter::run(Settings::default()) +fn main() -> Result<(), pixels::Error> { + xcross_example::run() } diff --git a/src/shapes.rs b/src/shapes.rs new file mode 100644 index 00000000..eb56a831 --- /dev/null +++ b/src/shapes.rs @@ -0,0 +1,129 @@ +use euclid::{Angle, Vector2D}; +use raqote::*; + +/// A context that can draw vector shapes +pub struct Shapes { + // The main draw target + dt: DrawTarget, + + // Center + cx: f32, + cy: f32, + + // Background color + r: f32, + g: f32, + b: f32, + + // Two paths rotate in opposite directions + t1: Transform, + t2: Transform, +} + +impl Shapes { + /// Create a new Shapes + pub fn new(width: u32, height: u32) -> Self { + Self { + dt: DrawTarget::new(width as i32, height as i32), + cx: (width / 2) as f32, + cy: (width / 2) as f32, + r: 0.0, + g: 0.34, + b: 0.88, + t1: Transform::identity(), + t2: Transform::identity(), + } + } + + /// Gain access to the underlying pixels + pub fn get_frame(&self) -> &[u32] { + self.dt.get_data() + } + + /// Draw all of the shapes + pub fn draw(&mut self, delta: f32) { + // This is not a good way to blend colors. + // But it's fine for a demo. + self.r += delta; + self.g += delta * 0.71; + self.b += delta * 1.33; + + self.dt.clear(SolidSource { + g: ((self.g.sin() + 1.0) * 127.5).round() as u8, + r: ((self.r.sin() + 1.0) * 127.5).round() as u8, + b: ((self.b.sin() + 1.0) * 127.5).round() as u8, + a: 0xff, + }); + + let translate = Vector2D::new(-self.cx, -self.cy).to_transform(); + let inv_translate = translate + .inverse() + .unwrap_or_else(|| Vector2D::new(self.cx, self.cy).to_transform()); + + self.t1 = self.t1.then(&translate); + self.t1 = self.t1.then_rotate(Angle::radians(delta)); + self.t1 = self.t1.then(&inv_translate); + self.dt.set_transform(&self.t1); + + let mut pb = PathBuilder::new(); + pb.move_to(100., 10.); + pb.cubic_to(150., 40., 175., 0., 200., 10.); + pb.quad_to(120., 100., 80., 200.); + pb.quad_to(150., 180., 300., 300.); + pb.close(); + let path = pb.finish(); + + let gradient = Source::new_radial_gradient( + Gradient { + stops: vec![ + GradientStop { + position: 0.2, + color: Color::new(0xff, 0, 0xff, 0), + }, + GradientStop { + position: 0.8, + color: Color::new(0xff, 0xff, 0xff, 0xff), + }, + GradientStop { + position: 1., + color: Color::new(0xff, 0xff, 0, 0xff), + }, + ], + }, + Point::new(150., 150.), + 128., + Spread::Pad, + ); + self.dt.fill(&path, &gradient, &DrawOptions::new()); + + self.t2 = self.t2.then(&translate); + self.t2 = self.t2.then_rotate(Angle::radians(-delta)); + self.t2 = self.t2.then(&inv_translate); + self.dt.set_transform(&self.t2); + + let mut pb = PathBuilder::new(); + pb.move_to(100., 100.); + pb.line_to(300., 300.); + pb.line_to(200., 300.); + let path = pb.finish(); + + self.dt.stroke( + &path, + &Source::Solid(SolidSource { + r: 0x0, + g: 0x0, + b: 0x80, + a: 0x80, + }), + &StrokeStyle { + cap: LineCap::Round, + join: LineJoin::Round, + width: 10., + miter_limit: 2., + dash_array: vec![10., 18.], + dash_offset: 16., + }, + &DrawOptions::new(), + ); + } +}