-
Notifications
You must be signed in to change notification settings - Fork 40
Description
I was investigating waydroid/waydroid#1875 and was looking at hwcomposer.
To me the code in hwcomposer.cpp looks like it could get some cleanup
I mean things like:
wp_presentation_feedbackbeing stored instruct bufferwhich is wrong compared to the wayland protocol associatingwp_presentation_feedbackwithwl_surface- Misuse of
wl_surface_damage. The coordinates should be surface-local but buffer-local coordinates are given herewl_surface_damage(pdev->display->cursor_surface, 0, 0, buf->width, buf->height); - Some functions are huge (especially hwc_set) which could be improved by factoring out some functionality to new functions
I currently have much free time and would like to improve code quality.
My questions is: Is a pull request refactoring code reviewed and accepted? I would like to avoid putting in the work just so that it is rejected.
After I finished refactoring I want to implement HWC_DEVICE_API_VERSION_1_5 because of its damage tracking.
Side note on your fix for waydroid/waydroid#1875 (13b570b):
I don't think that the HWC_GEOMETRY_CHANGED flag is really the right thing to check for here.
The underlying issue is that a new buffer might get the same buffer_handle_t as a buffer we saw previously which is technically also possible without HWC_GEOMETRY_CHANGED being set.
I suggest something like this Molytho@3fe3386