Implement wl_surface::damage_buffer
ClosedPublic

Authored by romangg on Oct 2 2018, 10:12 PM.

Details

Summary

Missing from our surface handling was the damage_buffer call introduced in
version 4 of the wl_compositor interface.

Its only difference to a normal damage call is that the damaged region is
supposed to be defined by the client in buffer coordinates instead of
surface coordinates. This damage must be tracked separately in KWayland
and on commit with the buffer transformation united with the normal damage.

Test Plan

Autotest updated.

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
romangg created this revision.Oct 2 2018, 10:12 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptOct 2 2018, 10:12 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
romangg requested review of this revision.Oct 2 2018, 10:12 PM
zzag added a subscriber: zzag.Oct 2 2018, 10:24 PM
zzag added inline comments.
src/client/surface.cpp
244

for (const QRect &r : region) {

rects() is obsolete. http://doc.qt.io/qt-5/qregion-obsolete.html#rects

davidedmundson requested changes to this revision.Oct 2 2018, 10:35 PM
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.
src/server/surface_interface.cpp
450

scale is also a transform.

Note also that the damage signal is used in kwin assuming it's surface local.

This revision now requires changes to proceed.Oct 2 2018, 10:35 PM
romangg added inline comments.Oct 2 2018, 10:38 PM
src/server/surface_interface.cpp
450

Thanks! After applying the output transform and the scale transform, the damaged buffer region should be in surface local coordinates, right? I.e. the below sent damaged signal should then have the surface local damage.

romangg updated this revision to Diff 42764.Oct 2 2018, 11:32 PM
romangg marked 3 inline comments as done.
  • Remove rects call
  • Respect buffer scale
  • Test damage against scaled surface
src/server/surface_interface.cpp
453

Should this last one be flipped 270?

romangg updated this revision to Diff 48477.Jan 1 2019, 3:06 PM
romangg marked an inline comment as done.
  • Rebase on master
  • Flipped 270 fix
zzag added a comment.Feb 5 2019, 3:02 PM

Is it good now?

davidedmundson accepted this revision.Feb 5 2019, 3:23 PM
This revision is now accepted and ready to land.Feb 5 2019, 3:23 PM

Will be pushed after 5.56 branched off.

This revision was automatically updated to reflect the committed changes.