Skip to content

port Evince to gtk4

Qiu Wenbo requested to merge crab2313/evince:gtk4-port-target into evince-next

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 since border-image make gtk_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 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
  • Port EvRecentView to use GtkGridView

TODO

  • port accessibility stuff of Evince
  • 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 (Let's do it in separated MR)
  • GtkTreeView and GtkIconView is deprecated officially in GTK 4.10. Consider port the following widgets to the new API:
    • EvSidebarLinks (Let's do it in separated MR)
    • EvSidebarThumbnails - gtk#4756
    • EvSidebarLayers (Let's do it in separated MR)
    • EvSidebarAnnotations
  • switch to the new dialog API introduced in GTK 4.10
  • rework the search bar and search entry. Maybe write a new custom widget.
  • fix EvSidebarThumbnails (I'm giving up to this, will concentrate on !603 . Fix is welcome.)
  • Annotation support is broken. Basically due to the missing API in GTK4 related to window movement.
  • identify more missing parts and add them to the todo list (We should not try to enlarge this MR)

Fixes: #1072 #1551 (closed) #992 (closed) #1864

Edited by Qiu Wenbo

Merge request reports

Loading