[PATCH 2/2] protocol: Add buffer_scale to wl_surface and wl_output

Bill Spitzak spitzak at gmail.com
Wed May 8 12:07:57 PDT 2013


Output scaling should be merged with the existing "buffer_transform" 
(the 8-value enumeration describing 90 degree rotations/reflections).

I think in the end Wayland is going to have to have arbitrary affine 
transforms in the api, and it might make sense to decide a standard for 
these now, so that they are not split up amoung several apis like what 
is happening now. Apparently there is worry about using floating point 
in the api, but I think the following proposal that only uses integers 
or fixed point works:

Translation are given as 2 24.8 fixed-point numbers.

Scale is 4 unsigned numbers: w,h,W,H. You can think of these as the size 
of the source and destination, or w/W and h/H are the scaling factors.

Rotation and skew are 4 integers: x0,y0,x1,y1. The X and Y axis are 
rotated to point at these positions. To avoid skew use x1==-y0 and 
y1==x0. Flipping the signs can be used to make reflections.

This setup allows some useful numbers with somewhat intuitive results, 
and avoids trying to specify irrational numbers using integers.


More information about the wayland-devel mailing list