Sub-surface protocol

Bill Spitzak spitzak at gmail.com
Thu Dec 20 13:50:05 PST 2012


Kai-Uwe Behrmann wrote:

>>> However, we had seen quite some objections around subwindows at that 
>>> time.
>>> Did something substancial change on that matter?
>> I don't see anything there that applies to Wayland. The link to the
>> original proposal is also dead.
> 
> the old thread starter from Tomas for reference: 
> http://www.spinics.net/lists/xorg/msg35268.html

I think the objection is that under X11 a subwindow allocates an entire 
new drawing buffer. This is a pain for toolkits and applications that 
now have to manage these multiple buffers and "switch drawing contexts" 
(which loses things like the current clip and transform) to draw this 
portion of their display. It also wastes memory for the unused part of 
the main window image buffer.

However it sounds like Wayland will allow a client to define a 
subsurface that reuses the same image buffer as the main surface, by 
indicating that a subrectangle of that image buffer is the subsurface 
contents. This means the client can just draw this area mixed in any way 
it wants with the drawing of everything else in the main window.

The only problem with this idea is that there cannot be any partial 
transparency in the area with a different color correction, since the 
result is that it will be composited atop the same image drawn with the 
normal color correction. Since the main reason for this is to show 
images and videos which are opaque I would think this is not a big 
problem. It may also be possible to indicate that a subsurface "holes" 
the parent surface, the compositor would then not draw that area of the 
parent (which the current compositor is already doing when an 
overlapping surface is known to be opaque).

I like the idea of reusing existing wayland data structures and for this 
reason I think using subsurfaces for this will work very well.



More information about the wayland-devel mailing list