Commit Graph

644 Commits

Author SHA1 Message Date
Zoxc 2102bec73c
Merge pull request #15 from linebender/update_deps
Run `cargo update`
2022-12-01 11:46:23 +01:00
Raph Levien 0c5ab63b5b Run `cargo upate`
Just bump the Cargo.lock because it seems like CI was failing.
2022-11-30 20:07:00 -08:00
Chad Brokaw fa4d63283d
Merge pull request #12 from linebender/piet-wgsl-render
Move to piet-wgsl for rendering
2022-11-26 17:56:44 -05:00
Chad Brokaw b008364c85 add crates.io patch for naga 2022-11-26 17:18:13 -05:00
Chad Brokaw d72b94fed4 Move to piet-wgsl for rendering
Removes the piet-gpu and piet-gpu-hal dependencies and updates the rendering code to use piet-wgsl.
2022-11-26 16:53:40 -05:00
Raph Levien 44369fb705
Merge pull request #10 from linebender/mut_fragment
Pass mutable scene builder reference to paint
2022-11-26 16:11:19 -05:00
Raph Levien 68f5a6b386 Expose fragment from Pod
Add a public method to retrieve the scene fragment from a Pod.
2022-11-25 08:13:40 -08:00
Raph Levien 2193b87212 Pass mutable scene builder reference to paint
Instead of the `paint` method returning a `Rendered` which was just a
newtype around `SceneFragment`, pass in `&mut SceneBuilder`. Also store
a scene fragment in each `Pod`, which is the storage for these builders.

This change has a number of consequences. Less boilerplate in the paint
method, and also less allocation, as the storage can get reused. More
importantly, though we don't have the logic for this yet, it sets the
stage for retaining scene fragments when widgets don't change.
2022-11-23 21:00:36 -08:00
Chad Brokaw c07f0ab059
Merge pull request #8 from linebender/scaled_render
Apply scale in MainState::render()
2022-11-23 18:04:43 -05:00
Chad Brokaw 7c79664547 apply scale in MainState::render() 2022-11-23 17:47:18 -05:00
Chad Brokaw 9420765a4d
Merge pull request #5 from linebender/piet-scene-sync
Update for piet-scene changes
2022-11-23 17:23:12 -05:00
Chad Brokaw d643686729 cargo update 2022-11-23 17:17:30 -05:00
Chad Brokaw d5dae068bb update for piet-scene changes 2022-11-23 14:08:25 -05:00
Raph Levien ef1d90732b
Merge pull request #1 from linebender/new_infra
Work in progress xilem prototype
2022-11-23 13:24:11 -05:00
Raph Levien 36cd3c5a7d Be more robust to event order
Should fix crashes on Wayland in particular.

Also snap to newer deps, which should fix hang on Vulkan.
2022-11-22 13:32:39 -08:00
Richard Dodd (dodj) 44a70d7bcf
Merge pull request #4 from linebender/jplatte/backend-selection
Allow selecting the glazier backend on Linux
2022-11-22 14:42:58 +00:00
Jonas Platte 4ca16251d0
Allow selecting the glazier backend on Linux 2022-11-22 10:12:37 +01:00
Raph Levien 09038d9539 Button gradient background
This adds the rendering of the gradient to the button widget.

The "piet_scene_helpers" module is a bit hacky, we'll need to have some discussions about how to handle kurbo shape types more easily. But it should work for now.
2022-11-21 10:05:29 -08:00
Raph Levien 209fd9d7ca Merge branch 'main' into new_infra 2022-11-21 09:20:17 -08:00
Raph Levien c0c450c0e7 Clickable button
This is a mostly working button implementation, but the background (a gradient) isn't rendering yet. When it is, I'll likely merge the PR.
2022-11-20 22:03:59 -08:00
Daniel McNab 7fce02fd41
Create initial CI (#2)
We don't deny warnings in CI because we currently have warnings.

Once #1 lands, we can enforce cleanliness from warnings

See also d0b9e1905c
as we only use windows at the moment
2022-11-17 09:30:42 +00:00
Raph Levien 2280e9efd7 Work in progress xilem prototype
This is a snapshot of the current state of the xilem prototype built on new infrastructure: glazier for window creation, piet-gpu for drawing, and parley for text.

As of this snapshot, only the text widget has been ported, and there are a number of rough edges. It should be considered a proof of concept. That said, it should be possible to build more from here.
2022-11-16 17:06:45 -05:00
Daniel McNab d62cfc4e66 Create gitignore and use valid dependency 2022-11-16 21:59:20 +00:00
longmathemagician a61c2eb451 Add Apache 2.0 license 2022-11-16 08:38:24 -08:00
Raph Levien cce75d6955 Tweak logic for speculative list load
Do in reverse order to prioritize what's likely to become visible. Expand range by 10. A more sophisticated approach is probably wanted eventually, but this simple tweak helps quite a bit.
2022-09-15 09:52:26 -07:00
Raph Levien 9c5bd2f074 Simplify timeout mechanism
Use timeout_at future rather than spawning a separate task to send a timeout message. This should also improve performance, as it's less likely that the task is starved.
2022-05-27 19:51:00 -07:00
Raph Levien c610207bad Delay rendering for pending async
When there are pending async futures, wait for futures to complete or a timeout, whichever is first.
2022-05-27 18:38:18 -07:00
Raph Levien 9bf48d22f0 Make async wake the app task
Instead of waking the UI thread, send wakes to the app task (which in turn will wake the UI thread when needed).

WIP, there's more to do here.
2022-05-27 17:08:31 -07:00
Raph Levien b1dedfe8f8 Run app task separate from UI thread
This runs the app logic and event dispatch in a separate task.

There is some hackery in than the App abstraction spins up a tokio runtime and enters it during the UI runloop. Likely it would be better to let the client do this. But it seems to work, at least for this example.
2022-05-27 15:04:35 -07:00
Raph Levien 424f667a1d Add app task
Add a task that will run the app logic separate from the UI thread.

WIP
2022-05-27 13:22:09 -07:00
Raph Levien d9ee53724c Make the View trait Send
Enforce Send for the View trait. Originally I wanted to move Widget across thread boundaries but that isn't going to work with current Piet.

Also makes the associated state Send.

But also note, this does *not* put a Send bound on T. Running the app logic and doing event propagation will be done on the view task. But we'll see what we bump into.
2022-05-27 11:05:03 -07:00
Raph Levien 06f6e08874 Tweak when future polling happens
Poll the future a bit earlier in the game, generally in event rather than queuing it for polling in the rebuild method.
2022-05-26 15:03:15 -07:00
Raph Levien 6058189104 Re-establish tokio
"unconstrained" seems to be the answer to the previous problem, but performance is not great here.
2022-05-25 13:10:26 -07:00
Raph Levien e937723fcb Cancel in-flight async results
Otherwise these build up and cause performance problems.
2022-05-25 12:59:04 -07:00
Raph Levien 963af1a598 Switch to smol
We were running into tokio's cooperative scheduling, see this bug:

https://github.com/tokio-rs/tokio/issues/2418

I'm sure there's some way to make that work, but in the meantime just switching to smol lets us make progress.

This is the demo I showed at the SF Rust meetup 2022-05-24.
2022-05-25 11:01:12 -07:00
Raph Levien cb0d1fb840 Add async_list
Add an experimental async list view.
2022-05-24 17:09:15 -07:00
Raph Levien b1e57b02d2 Async experimentation
This commit imports some of the infrastructure from the idiopath_async branch. It should still be considered experimental.
2022-05-24 16:12:01 -07:00
Raph Levien c0f725d972 Virtualized scrolling list experiment
This is a prototype of a virtualized (or sparse or lazy) list that materializes children on demand.

As of this version, synchronously creates views.
2022-05-24 15:50:30 -07:00
Raph Levien b9ca167c19 Rename "prelayout" to "measure"
Thanks Florian Plattner for the suggestion.
2022-05-24 10:42:10 -07:00
Raph Levien 24142bcd96 Add simple scroll view
Add a scroll view with the bare minimum of functionality (wheel only, no visible scroll bars, crude layout, vertical only).
2022-05-20 21:28:56 -07:00
Raph Levien 400e27c3f3 Basic button functionality
This commit implements the core functionality of button, including hot/active states, drawing of appearance, and reasonable layout.

There are other changes in widget infrastructure to support this functionality.
2022-05-20 10:55:09 -07:00
Raph Levien 8c7b48cf2f Add lifecycle method
Add the lifecycle method to the Widget trait, matching existing Druid. I'm not at all convinced it's necessary - in original Druid, one of the main differences is that it doesn't have mutable access to app state, but that concern isn't really relevant. In any case, this minimizes divergence, and can possibly be cleaned up later.
2022-05-19 19:23:56 -07:00
Raph Levien 79329b8b0f Start building event propagation
Import some of the event dispatching logic from Druid. Still fairly minimal, not yet doing real hot/active logic on buttons yet (doing it the same way as Druid would depend on adding lifecycle to the Widget trait).
2022-05-19 09:03:30 -07:00
Raph Levien 26432cebf8 Rename to xilem
I've decided on the name "xilem" rather than "idiopath," and this also matches the blog post (now linked from the README, though that is a bit stale).
2022-05-19 09:01:39 -07:00