This is my work in progress GTK4 port of Evince.
I'm really excited when I got my HiFive Unmatched development board, but sadly it has a poor performance quad-core RISC-V SoC. The performance of most gtk3 based GNOME apps on this board is really bad and I can't use this RISC-V PC as my daily drive. For example, Evince renders 0.5 FPS when you scroll a PDF document. That motivate me to port several GNOME apps to GTK4 since GTK4 use OpenGL by default to render its widgets.
Now Evince on GTK4 can render 60 FPS with 4K resolution on HiFive Unmatched after addressing several performance issues. So I think it's time to open a draft merge request to get the opinion from the maintainers. This port is still incomplete and there are several features that I can't figure out how to port to GTK4.
Done
This section is basically a change log of major changes.
-
Migrate EvView and EvViewPresentation to GtkSnapshot based drawing model -
Use box-shadow
property of CSS to implement the border of pages. And this is a major performance boost sinceborder-image
makegtk_snapshot_render_frame
fallbacks to cairo and causes significant frame drop (90 drop to 20 with 2K resolution). -
Migrate a lot of custom widgets to composite template. And implement GtkBuildable interface for containers such as EvSidebar. -
Remove EvToolbar and merge it into EvWindow since AdwTitlebar is a final class now. -
Remove EvLoadingMessage and merge it into EvWindow since we can simply implement it by composite template. -
Remove the original media playback code and switch to GtkVideo -
GPU accelerated transition effect of presentation mode
TODO
-
port accessibility stuff of Evince -
migrate every sidebar page to composite template. That means, we construct them by adding a new <child>
ofEvSidebar
-
make sure dispose method of every widget free the resource. Since most child widget of custom widget is managed by composite template and do not require destroy manually -
style tuning, since there is a lot of use of border attribute of containers -
make sure other document backends working as exptected -
figure out the missing event of button 3 of GtkTreeView -
EvSearchBox need a rewrite since GtkSearchEntry is no longer a GtkEntry -
night mode switch do not queue a redraw for current page -
implement inverted color by GPU rather than cairo -
split text selection related event handler into a separated event controller -
bring back form fields to EvView -
DnD support for EvView -
bring back the key binding handler of EvView -
bring back the caret mode of EvView -
wait for the builtin spell check of GTK4 since the authors of gspell state that they are not going to port gspell to GTK4 gtk#3814 -
GtkStackSwitcher in GTK4 lost its homogeneous property gtk#4152 (closed)