Skip to content

Commit 52e98ea

Browse files
Desktop: Remove winit fork, fix nix package, and improve rendering (#3307)
* reduce triangle count * switch to winit repo after changes where upstreamed * fix nix pkg
1 parent 3a80560 commit 52e98ea

File tree

4 files changed

+33
-37
lines changed

4 files changed

+33
-37
lines changed

.nix/flake.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
allowBuiltinFetchGit = true;
108108
};
109109

110-
111110
# TODO: Remove the need for this hash by using individual package resolutions and hashes from package-lock.json
112111
npmDeps = pkgs.fetchNpmDeps {
113112
inherit (finalAttrs) pname version;
@@ -131,7 +130,10 @@
131130
buildPhase = ''
132131
export HOME="$TMPDIR"
133132
134-
npm run build-desktop
133+
pushd frontend
134+
npm run build-native
135+
popd
136+
cargo build -r -p graphite-desktop
135137
'';
136138

137139
installPhase = ''
@@ -144,7 +146,7 @@
144146
mkdir -p $out/share/icons/hicolor/scalable/apps
145147
cp $src/desktop/assets/graphite-icon-color.svg $out/share/icons/hicolor/scalable/apps/
146148
'';
147-
149+
148150
doCheck = false;
149151

150152
postFixup = ''

Cargo.lock

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ web-sys = { version = "=0.3.77", features = [
134134
"HtmlImageElement",
135135
"ImageBitmapRenderingContext",
136136
] }
137-
winit = { git = "https://github.com/timon-schelling/winit.git", rev = "37221c7192ef1deec022a2278e54429331c01bad" }
137+
winit = { git = "https://github.com/rust-windowing/winit.git" }
138138
url = "2.5"
139139
tokio = { version = "1.29", features = ["fs", "macros", "io-std", "rt"] }
140140
vello = { git = "https://github.com/linebender/vello.git", rev = "87cc5bee6d3a34d15017dbbb58634ddc7f33ff9b" } # TODO switch back to stable when a release is made

desktop/src/render/composite_shader.wgsl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32) -> VertexOutput {
88
var out: VertexOutput;
99

1010
let pos = array(
11-
// 1st triangle
12-
vec2f( -1.0, -1.0), // center
13-
vec2f( 1.0, -1.0), // right, center
14-
vec2f( -1.0, 1.0), // center, top
15-
16-
// 2nd triangle
17-
vec2f( -1.0, 1.0), // center, top
18-
vec2f( 1.0, -1.0), // right, center
19-
vec2f( 1.0, 1.0), // right, top
11+
vec2f( -1.0, -1.0),
12+
vec2f( 3.0, -1.0),
13+
vec2f( -1.0, 3.0),
2014
);
2115
let xy = pos[vertex_index];
2216
out.clip_position = vec4f(xy , 0.0, 1.0);

0 commit comments

Comments
 (0)