protocol: Modes are specified in HW pixels
authorAlexander Larsson <alexl@redhat.com>
Tue, 28 May 2013 14:20:52 +0000 (16:20 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 28 May 2013 19:40:02 +0000 (15:40 -0400)
commitb6930889044dcd92be5c7499e653c6cb19cddb19
tree7f914ff1c45f1a2e4c87205584cfd5e0950aaa0e
parente782dbecbc3b53684a78c8c5175e0571cfc3e119
protocol: Modes are specified in HW pixels

Modes are mainly meant to be used in coordination with fullscreen in
DRIVER mode, by e.g. games. For such games what they generally want
is to match some hardware mode and resize their window for that. We
don't really need to complicate this with the scaling. So, we
keep the resolutions in HW pixels, and drop the SCALED flag (as it
is now useless).

This lets you just create e.g an 800x600 buffer of scale 1 and
fullscreen that, ignoring the output scaling factor (although you can
of course also respect it and create a 400x300 surface at scale 2).
Conceptually the mode change is treated like a scaling which overrides
the normal output scale.

The only complexity is the FILL mode where it can happen that the user
specifies a buffer of the same size as the screen, but the output has scale
2 and the buffer scale 1. Just scanning out this buffer will work, but
effectively this is a downscaling operation, as the "real" size of the surface
in pels is twice the size of the output. We solve this by allowing FILL to
downscale (but still not upscale).
protocol/wayland.xml