Skip to content
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

hwcomposer: refactor hwc_set into smaller functions #40

Open
wants to merge 1 commit into
base: lineage-18.1
Choose a base branch
from

Conversation

DakeuTaepi
Copy link

set() is a HWComposer HAL method which gets called when SurfaceFlinger is ready to present its layers on screen (https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hwcomposer.h#531). Waydroid seems to use it as main place to hijack rendering and map SurfaceFlinger layers (with extra metadata like task ID/app ID added) to Wayland windows.

Unfortunately, because there at least 3 different windowing modes supported (render Android screen in a single window, create a distinct Android screen window per app, and desktop free-form multi-window mode), the hwc_set functions looks pretty convoluted and hard to extend/modify.

I've attempted to slim it down a bit by separating code chunks to make hwc_set() easier to read, but not quite happy with the result yet. Maybe someone else would have a better idea how to split it up after reading the code, so any feedback would be welcome.

@DakeuTaepi DakeuTaepi force-pushed the lineage-18.1-refactor branch 2 times, most recently from 389b9e8 to 47e1b46 Compare October 19, 2022 20:45
@NotKit NotKit marked this pull request as ready for review October 29, 2022 11:19
Copy link
Member

@aleasto aleasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution.

Regressions found on my end (kwin_wayland 5.26.2):

  • Background in multi-windows mode is not transparent anymore
  • The persist.waydroid.cursor_on_subsurface hack for showing the cursor on kwin_wayland in multi-windows mode doesn't work anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants