Skip to content

Merge most impl Device blocks#371

Closed
mrobinson wants to merge 1 commit into
servo:mainfrom
mrobinson:merge-all-device-blocks
Closed

Merge most impl Device blocks#371
mrobinson wants to merge 1 commit into
servo:mainfrom
mrobinson:merge-all-device-blocks

Conversation

@mrobinson

@mrobinson mrobinson commented Jun 9, 2026

Copy link
Copy Markdown
Member

This change just moves code and adjust imports. It was previously
difficult to know where any particular Device method was implemented.
This will also make it easier to eliminate macros.rs, necessary to
implement the new version of the API. The downside is that now much of
the implementation is gathered into the device.rs files, but these
usually do not go beyond 1500 lines. Further changes to the API will
eliminate many lines of code and spread the logic more equally between
files.

For the moment, the code in the hardware_buffers Surface is mostly
untouched. This needs more careful surgery.

@mrobinson mrobinson force-pushed the merge-all-device-blocks branch 2 times, most recently from 21569bd to 8f9d891 Compare June 9, 2026 10:05
@mrobinson

Copy link
Copy Markdown
Member Author

I realized this is likely very difficult to review so I've split this up into 6 separate PRs in order to make this a bit easier:

Just a word on my motivation as I know this looks like a lot of useless code removal. In order to make any progress at all on making surfman easier to work on, we need to remove the giant macro in macros.rs which interferes with making API changes as well as using rust-analyzer to work on things. In order to do that all of the impl Device code needs to be in the same place in order to implement a trait properly. In addition, it was very difficult to know before where to look for the implementation of any Device method as they were scattered throughout many files

@mrobinson mrobinson closed this Jun 9, 2026
This change just moves code and adjust imports.  It was very previously
difficult to know where any particular `Device` method was implemented.
This will also make it easier to eliminate `macros.rs, necessary to
implement the new version of the API. The downside is that now much of
the implementation is gathered into the `device.rs` files, but these
usually do not go beyond 1500 lines. Further changes to the API will
eliminate many lines of code and spread the logic more equally between
files.

Signed-off-by: Martin Robinson <mrobinson@abandonedwig.info>
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.

1 participant