-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP Compositor #52
WIP Compositor #52
Conversation
So, this works. It's slow though. Very, very slow. |
Safety of the vi::draw IPC methodWhen calling vi::draw, vi reads from the shared memory. There is no borrow-checking mechanism in place to ensure that the other process does not mutate it while this happens. Maybe we should have some kind of cross-process mutex? How to implement this properly? This comment was generated by todo based on a
|
Vi: Heavy flickering.When drawing the whole screen, we can see some extreme amount of flickering on the screen. We should look into better compositing algorithms, maybe we don't need to redraw the whole screen all the time? And also, look into VSYNC. This comment was generated by todo based on a
|
Closes #40 |
- Implement a compositor, named vi. - The clock uses it. - It's broken.
- VBELogger::new() now takes a WindowSize, allowing multiple patterns for creating windows. - Bugfix: BPP should be 32, not 4.
- Move clock::vbe to libuser::window and libuser::terminal - Remove clock::logger
- Lock framebuffer once at the start of the loop - Copy framebuffer verbatim, don't attempt interpreting pixels - Better TODOs - Remove closed buffers from the global.
- Dropping a ClientSession now sends the Close message - On the server, handle the Close message by removing the associated Object - Implement Drop on vi::IBuffer - Bugfix: use the correct type if we pass a token in new_request/new_response
The old behavior was weird: it would only crop left/top to 0. Now we ensure the returned output is cropped to the given width/height as well.
- VBE's framebuffer is now an array of VBEColor - Asserts that x/y is in framebuffer range - Lock framebuffer once per draw to avoid deadlocks. - Documentation improvements.
- Document various undocumented parts. - Panic in get_px_offset if out of bound - Work around a weird assumption that we have more than 1 line available. - framebuffer is now an array of color.
Draw happens in a backbuffer, which gets memcpy'd into the framebuffer. This fixes the flickering issue.
Use the generic method to get the pixel offset in the framebuffer.
@Orycterope Fixed everything. It's ready for review again. |
vi/src/main.rs
Outdated
let dtop = min(max(self.top, 0) as u32, framebuffer_height); | ||
let dleft = min(max(self.left, 0) as u32, framebuffer_width); | ||
let dwidth = min(framebuffer_height - dtop, self.height); | ||
let dheight = min(framebuffer_width - dleft, self.width); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If window is far to the left:
let self.left = -500;
let self.width = 4;
let dleft = min(max(-500, 0) as u32, framebuffer_width); // = 0, this is fine
let dwidth = min(framebuffer_width - 0, 4); // = 4. Wrong.
The window was completely out of the screen, but this would draw a 4 px window at the left of the screen.
- More pedantic tests. - Also, some oryctalgorithm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally
Fixes #40