Fully replace the cairo rendering path with one that uses GTK4's GtkSnapshot. GtkSnapshot is hardware accelerated compared to cairo which uses the CPU.
For environments where a GPU is not available or just infeasible to use smoothly, users can set the env var GSK_RENDERER=cairo beforehand so that GtkSnapshot uses internally. I do not think this should be under a feature flag (and coexist with the old cairo rendering path), since I'm assuming the GTK4 gui is experimental (its not enabled by default), and future changes that affect rendering will just be more complicated for no benefit.
A quick test on my laptop shows a 2% decrease in CPU usage (total of all cores) compared to the cairo rendering path, possibly more considering the GtkSnapshot build was built using debug flags compared to the optimized build cairo GTK4 Vim.
I also plan on this PR resolving #20301 as well
Since GtkSnapshot does not have an equivalent way of blitting to a surface like Cairo, the render nodes that make up the scene graph (which is then rendered) are cached in a custom GtkWidget. the gui_mch_* functions simply just modify/create these render nodes before the snapshot virtual function is called to render everything.
https://github.com/vim/vim/pull/20324
(4 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman pushed 2 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@mattn What is the minimum GTK4 version that Vim supports currently? I want to implement undercurls using GskPath, which is added from version 4.14 onwards. Thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman pushed 2 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()