-
Notifications
You must be signed in to change notification settings - Fork 43
feat(backend): update WebGl2Backend integration #108
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
Conversation
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.
Pretty good!
Gave this a quick read... will look into it in detail later
I wonder how the hyperlink/mouse stuff works so it'd be nice to update one of the examples to showcase it
src/backend/webgl2.rs
Outdated
| | (m << 5) & (1 << 13) // strikethrough | ||
| } | ||
|
|
||
| impl std::fmt::Debug for WebGl2Backend { |
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.
Why manual Debug implementations for WebGl2Backend and WebGl2BackendOptions? (i.e. which member of the struct is not Debug?)
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.
take your pick inside Option<Rc<RefCell<dyn FnMut(&str)>>>
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.
i could put it in a wrapper w debug?
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.
it's now wrapped inside HyperlinkCallback, so we're back to deriving Debug
it'll be once #109 is merged, as it allows updating the existing examples with per-backend options (that's how i tested it locally). |
|
todo: update examples with appropriate configs (as #109 is merged) |
|
bugs:
|
copied from demo2: |
|
i need to push a new beamterm version before removing the draft status |
|
How is this looking? |
the above mentioned bugs/panics are fixed on dev, but i haven't released yet because i noticed the font selection for non-normal font variants is off. (you can see it in exabind by toggling the modifier keys: i'll release it once font generation is working as expected; which is sometime during the coming week (guesstimate). |
|
i released beamterm 0.6.0, so no more panics in non-release modes + fixed some font rendering issues, so no more blockers |
920ca24 to
93d68d5
Compare
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.
This looks pretty good!
Co-authored-by: Orhun Parmaksız <[email protected]>
Co-authored-by: Orhun Parmaksız <[email protected]>
|
ship it :) |
Updates to beamterm
0.5.00.7.0, which brings a simplified and extended API + some perf improvements.new in 0.7.0: doubled glyph count to 1024 glyphs per font style. the default font now contains the full braille set/
The updates removes the internal cell buffer, as we can retrieve and manage any cell data from beamterm directly, without relying on our own cell buffer for internal bookkeeping. With the buffer gone, resize() etc was also removed + simplified cursor position handling.
The performance impact from updating to
0.5.00.6.00.7.0 and removing the buffer is in the ballpark of 1/3 to 1/4 less time spent by the backend each frame.There's also a slight change in cursor shape behavior: the cursor shape style modifier now toggles instead of setting its associated style attribute. this is done so that at least something is shown if the cell is already underlined or reversed (though i think the reverse case was probably working fine before, i.e., applying REVERSE twice).
new options
WebGl2BackendOptions::fallback_glyph: when a symbol is missing during renderingWebGl2BackendOptions::font_atlas: for custom font atlases (glyph set, font, weights etc)WebGl2BackendOptions::canvas_padding_color: any space not covered by the terminal gridWebGl2BackendOptions::enable_console_debug_api: wires a simple browser console-based debug API underwindow.__beamterm_debugWebGl2BackendOptions::enable_mouse_selection: beamterm's default mouse selection handlerWebGl2BackendOptions::cursor_shape: moved fromWebGl2BackendWebGl2BackendOptions::enable_hyperlinks: registers a default link HyperLink widget handlerWebGl2BackendOptions::on_hyperlink_click: sets a custom hyperlink callback handlerExample options:
hyperlinks change the mouse cursor shape on hover
Browser Console Debugging API
As mentioned above, enabled with
enable_console_debug_api(). it's pretty bare-bones, but supplants previously present console logging.todo