[RFC wayland] protocol: Add wl_surface.buffer_damage

Pekka Paalanen ppaalanen at gmail.com
Mon Nov 9 06:29:14 PST 2015


On Sat, 7 Nov 2015 09:49:21 -0800
"Jasper St. Pierre" <jstpierre at mecheye.net> wrote:

> So we fix the bug by adding wl_surface.buffer_damage, since it's
> impossible for Mesa to know about buffer transformations... and then
> what?

Be happy.

> The only way we can properly interpret the wl_surface.damage event is
> it being correct under no buffer transformations. Which is fine to me.
> And in any other case, we effectively have to treat it as a
> full-surface damage, since the coordinates are junk.

No, in any case we will just do what the spec says. Problems
client-side should be fixed or worked around client-side, and I
understand that has already happened for the plain eglSwapBuffers long
time ago.

> And technically, it doesn't matter which of the two you pick -- it's
> an optimization for the compositor to redraw less. At that point, I
> think it makes more sense to say that we should just treat every
> wl_surface.damage event as redrawing the full surface.

Keep in mind, that EGL and shm buffers are very different. If you
explode the damage with EGL buffers, the hit will probably not be much.
If you explode it with shm buffers, suddenly you start sucking on
glTexSubImage2D which is a *copy from CPU to GPU domain*.

> Given how surprising and unintuitive the rectangles behavior is (and
> given how it only says it in passing in the spec), I personally don't
> believe many 2D clients went through the trouble to make sure their
> rectangles were correct in all cases. Given that the error case is
> "app gets tearing and then when you click on it and switches away from
> the backdrop theme, it works fine", I think many people probably just
> blamed cairo and got on with it. Especially when it remained wrong in
> Weston's own clients for a few years as well until somebody spotted
> it.
> 
> Yes, this is what happens wheny ou introduce a broken protocol and let
> it stay there in the name of stability -- you get nonsense results and
> have to throw it out.

The only thing that is really broken with the protocol is that we do
not have automated tests covering it. "What is not tested is broken"
applies here too well. This was exacerbated by the fact that we didn't
even have manual tests for it.

Stability *is* important.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20151109/a94f3e97/attachment.sig>


More information about the wayland-devel mailing list