[scene] Add basic support for Wayland Buffer in WindowPixmap
The concept of Buffers do not match WindowPixmap perfectly. With X11 we had a pixmap as long as the size was the sime, then it got discarded. With Wayland we get a new Buffer whenever the window gets damaged. Furthermore the Buffer might get destroyed any time (especially if the client disconnects) or the data becomes invalid (it's a shm section after all). This adds some constraints on how the Buffer can be used. It's suggested that the implementing sub-classes do a deep copy of the Buffer's data when accessing it. For OpenGL that's rather obvious, for QPainter it needs a dedicated QImage::copy. WindowPixmap holds a pointer to the currently used Buffer, but doesn't guarantee that it stays valid. Every time the window gets damaged, the pointer needs to be updated. The QPainter based scene is the first to implement support for Buffers: on creation a deep copy is performed, on damage the changed parts are painted into the deep copy.master
parent
07c972b6d4
commit
19d90e4e0e
Loading…
Reference in New Issue