Could you say something about the impetus for this change? Is it paving the way for shared surfaces?
Sort of, I think it could make things a bit more like how it ought to be, although I still haven't a clear idea how to do that yet.
The main reason right now is that it fixes some ownership issue with the window surfaces:
1) The UI doesn't have a ref on either the surface or its data. It still keeps a reference on the image, which uses but doesn't own the surface data, while it's being referenced by the UI layer.
2) The window surface might get re-created at any point, especially during resize, and the UI surface pointer is swapped then but the layer isn't necessarily redrawn immediately and still has a reference through its image on the now invalid previous surface data.
That issue doesn't seem to cause any problem so far for some unclear reason, but I think it still needs to be fixed.
Then, I'm also refactoring the surface code to make it simpler and move more logic into win32u. Specifically I would like to re-implement the window shapes using 1bpp shape bitmap, in common code. That would make color keying and shape logic simpler, and less driver dependent. This change will be easier to implement with this MR.