Commit Graph
77 Commits
Author SHA1 Message Date
Nathan Sobo 24cdfd2471 Identify Worktree entries by their inode
This will allow us to re-parent elements when re-scanning when the file system changes.
2021-04-13 20:09:41 -06:00
Nathan Sobo 3c0bbe5eb5 Store root entry id 2021-04-13 20:07:42 -06:00
Nathan Sobo cdfd61369e Switch worktree entries to HashMap 2021-04-13 20:07:42 -06:00
Nathan Sobo 3803eb85a5 Inline clone 2021-04-13 20:07:42 -06:00
Nathan Sobo b9b511148b Make gpui::platform module private 2021-04-10 00:22:45 -06:00
Nathan Sobo 619e2b7e01 Remove platform::mac::runner 2021-04-10 00:19:25 -06:00
Nathan Sobo 4638391412 Remove MutableAppContext::downgrade 2021-04-10 00:14:26 -06:00
Nathan Sobo 620eedb727 Allow effects to be flushed before TestAppContext::update callback completes 2021-04-10 00:11:13 -06:00
Nathan Sobo 97a8a8ed43 Remove unsafe code from App::test_async
I don't actually think it was correct to allow the future to borrow a mutable app reference. I went back to passing a wrapper around the refcell to async tests. They'll be a bit more annoying to write but also totally safe.
2021-04-10 00:05:09 -06:00
Nathan Sobo 448dace281 Pass the on_finish_launching callback to Platform::run 2021-04-09 21:33:17 -06:00
Nathan SoboandMax Brunsfeld 4ecc17b1bb WIP: Make App the only entry point from main
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-09 13:38:09 -06:00
Nathan SoboandMax Brunsfeld 301163bab7 Add lifecycle methods to Platform trait
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-09 13:03:26 -06:00
Nathan Sobo b1536cca58 Add README tip 2021-04-07 21:56:45 -06:00
Nathan Sobo 9f6f27f305 Order debug JSON and allow elements to be named; copy to clipboard 2021-04-07 21:54:14 -06:00
Nathan Sobo cbb23a93a6 Log prettified element debug JSON to on cmd-alt-i 2021-04-07 21:54:14 -06:00
Nathan Sobo 0664321125 Add ability to debug element trees as JSON 2021-04-07 21:54:14 -06:00
Nathan Sobo 05125f76bd Fix tests 2021-04-06 20:59:55 -06:00
Nathan Sobo 3f9d224e0f persisted_version -> saved_version 2021-04-06 20:59:44 -06:00
Nathan Sobo 13ee86e334 Remove unused method 2021-04-06 20:47:09 -06:00
Nathan SoboandMax Brunsfeld 2619bc4602 Update modified status by emitting event whenever buffer is dirtied or saved
I used the word "dirty" because it felt more expressive than "modified" to me, but not married to it. Tagging Max because we did a lot of this thinking together.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-06 20:46:35 -06:00
Nathan Sobo 2a9e71d725 Vertically center glyphs in Line::paint based on ascender/descender for line 2021-04-06 09:15:21 -06:00
Nathan Sobo fc4135d55b Render example text in example via Line::paint 2021-04-06 09:15:21 -06:00
Nathan Sobo 765c3f9c18 Open platform window before first invalidation
This ensures we have an invalidation handler present so we render the first frame in all cases.
2021-04-06 09:15:21 -06:00
Nathan Sobo a5b39220a4 WIP: Add example app to test text rendering 2021-04-06 09:15:21 -06:00
Nathan Sobo 2970e934da Use handles to obtain entities in future callbacks
This guarantees that the spawning entity will be present and simplifies
the logic for obtaining the entity. Now we can forward the results of spawned futures and streams in the same way regardless of whether what spawned them was a model or a view.
2021-04-05 20:04:04 -06:00
Nathan SoboandMax Brunsfeld c43d7cfb39 Use a condvar instead of a channel to implement finish_pending_tasks
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-02 13:53:06 -06:00
Nathan SoboandMax Brunsfeld 526a55d0d7 Complete finish_pending_tasks future when tasks are cancelled
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-02 12:42:23 -06:00
Nathan SoboandMax Brunsfeld fd1f75333f Initialize logger in gpui tests
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-02 12:42:01 -06:00
Nathan SoboandMax Brunsfeld 2d79193fb6 Remove future/stream handlers when task is dropped
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-02 12:03:35 -06:00
Nathan SoboandMax Brunsfeld 914cf37f37 Remove executor::ForegroundTask wrapper
Now that smol returns the same Task as async_task, we can simply re-export the async_task::Task struct from our executor module.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-02 11:02:09 -06:00
Nathan SoboandMax Brunsfeld d68a747754 Fix hanging finish_pending_tasks test
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-02 10:48:03 -06:00
Nathan Sobo 995acefce5 Inset container contents to account for container border 2021-04-01 10:31:00 -06:00
Nathan Sobo 0b44cb04ee Fix links 2021-03-31 22:21:42 -06:00
Nathan Sobo 3831700ff4 Link to tracking issues 2021-03-31 21:59:55 -06:00
Nathan Sobo f3fd670104 Add a README with a high-level roadmap 2021-03-31 21:53:33 -06:00
Nathan Sobo c525d7c712 💄 naming 2021-03-31 20:43:15 -06:00
Nathan Sobo 5c444b2bfa Call did_modify_range on only once per render 2021-03-30 23:07:14 -06:00
Nathan SoboandMax Brunsfeld dbf9a5a466 Restore blink_cursors
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-03-30 18:12:45 -06:00
Nathan SoboandMax Brunsfeld 6ba08b510f Avoid generic parameter
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-03-30 18:05:13 -06:00
Nathan SoboandMax Brunsfeld 77b6a29f5f Optimize grouping of path sprites by layer/atlas
Avoid filtering sprites redundantly on every layer and allocating intermediate vectors to group by atlas.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-03-30 18:03:00 -06:00
Nathan SoboandMax Brunsfeld 4cdce070c4 Reduce selection corner radius
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-03-30 16:57:21 -06:00
Nathan SoboandMax Brunsfeld 3103d28285 Clear the path atlases on every frame and fix spelling
@as-cii you were right about the plural of "atlas" after all.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-03-30 16:56:11 -06:00
Nathan SoboandMax Brunsfeld 8dabb15248 Decrease max windings to avoid problems with anti-aliasing
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-03-30 16:34:01 -06:00
Nathan SoboandMax Brunsfeld 02ace16176 Handle selection corners that are smaller than the corner radius
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-03-30 16:21:24 -06:00
Nathan Sobo c4f23e411a Fix double-borrow when synthesizing drag events 2021-03-30 14:25:47 -06:00
Nathan Sobo 5c4b08f05f Use correct texture size when drawing paths into atlas 2021-03-30 14:03:29 -06:00
Nathan Sobo 4773f5034b Bump max path windings to 128
This eliminates artifacts while still seeming to work with anti-aliasing.
2021-03-30 14:02:59 -06:00
Nathan SoboandMax Brunsfeld b538f5cfb7 WIP
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-03-29 22:56:47 -06:00
Nathan SoboandMax Brunsfeld 64af4c694a WIP: Render paths into stencil buffers
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-03-29 22:46:26 -06:00
Nathan Sobo 7523df05cf Space out sprites in atlas
This prevents us from accidentally sampling a neighboring sprite.
2021-03-23 19:02:03 -06:00
Nathan Sobo e5d586a942 Get glyphs sort of rendering 2021-03-23 18:54:09 -06:00
Nathan Sobo 28b84c081d Fix noise in atlas texture 2021-03-23 17:27:28 -06:00
Nathan Sobo 247afa1666 WIP 2021-03-23 09:13:35 -06:00
Nathan Sobo 66dcb73263 Respect margins when painting Container 2021-03-22 21:11:08 -06:00
Nathan Sobo d13510bfe3 💄 2021-03-22 21:00:07 -06:00
Nathan Sobo 548b542766 Get the file finder rendering with a drop shadow 2021-03-22 20:54:52 -06:00
Nathan Sobo 119aa452b6 Overhaul the entire element system
Now the Element trait is designed to be wrapped in a Lifecycle enum that gets placed inside an ElementBox. This allows the framework to store data on behalf of the Element implementation, such as sizes, bounds, and also implementation-specific LayoutState and PaintState types. This makes it easier to reason about which data is available in each Element method.
2021-03-21 20:54:23 -06:00
Nathan SoboandAntonio Scandurra 046fe3fff9 Dispatch keystrokes and fix rerendering when window invalidated
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-03-21 11:38:23 -06:00
Nathan SoboandAntonio Scandurra f5df3681f8 Add file_finder module
Still need to wire up key bindings to make it toggle.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-03-21 10:50:07 -06:00
Nathan SoboandAntonio Scandurra 0c59937a65 Wire up events and fix synthetic dragging
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-03-21 09:44:14 -06:00
Nathan SoboandAntonio Scandurra 04665800c0 Scale quads by scale factor before writing to Metal buffer
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-03-21 09:19:12 -06:00
Nathan SoboandAntonio Scandurra 31fb707eea Fix translation to device coords in shader
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-03-21 09:01:50 -06:00
Nathan SoboandAntonio Scandurra 1f647ef24c Clean up
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-03-21 09:00:47 -06:00
Nathan Sobo e5ffe43bb6 Get basic graphics rendering via Metal
Also, handle window resize.
2021-03-20 22:19:26 -06:00
Nathan Sobo 292b41ad57 Start on metal rendering infrastructure 2021-03-20 09:38:36 -06:00
Nathan Sobo d14c943150 Start on Scene 2021-03-19 13:31:25 -06:00
Nathan Sobo cfe3aae2de WIP: Get everything compiling again and keep window open 2021-03-19 12:12:10 -06:00
Nathan Sobo 605bdd62dd WIP: Start on rendering scenes via presenter 2021-03-18 21:33:16 -06:00
Nathan Sobo e809d6119a Return tasks from spawn and spawn_stream
Also, eliminate the background spawning methods. We can spawn futures
on the executor and then spawn those on the app if we need to wait for
the result of running one.
2021-03-18 20:10:32 -06:00
Nathan Sobo f849857309 Handle command line arguments and populate worktree 2021-03-18 17:54:35 -06:00
Nathan Sobo 9bab29c72f Get workspace module in and compiling 2021-03-18 15:52:46 -06:00
Nathan Sobo 171dd0c243 WIP 2021-03-18 13:17:25 -06:00
Nathan Sobo 23308e17a9 WIP on rebuilding with extracted UI framework 2021-03-18 13:13:31 -06:00
Nathan Sobo 356bc41752 WIP 2021-03-09 21:00:51 -07:00
Nathan Sobo a015c61337 Add context predicate parser 2021-03-09 19:33:19 -07:00
Nathan Sobo 222f9d373d WIP 2021-02-20 16:05:36 -07:00
Nathan Sobo b400449a58 Start rebuilding with a cleanly-separated UI framework 2021-02-20 10:02:34 -07:00