[PATCH] protocol: Add buffer_scale to wl_surface and wl_output

Alexander Larsson alexl at redhat.com
Tue May 14 23:44:15 PDT 2013


On tis, 2013-05-14 at 13:43 -0700, Bill Spitzak wrote:
> alexl at redhat.com wrote:
> 
> > +      </description>
> > +      <arg name="scale" type="fixed"/>
> > +    </request>
> >     </interface>
> 
> Fixed is not a good idea for scaling factors. You cannot accurately 
> represent values like 2/3 or 1/fixed. For an actual problem with 
> scaling, if the accurate scaling is an odd fixed number, the client 
> cannot specify that their scale is exactly 1/2 that, thus losing the 
> ability to get a 2x scale done by the compositor.
> 
> I would specify the scale as two integers defining a rational fraction.
> 
> This would also allow completely lossless multiplication with the 
> rational numbers used by the scaler proposal.
> 
> You may also want to allow different horizontal and vertical scales, 
> mostly because all plausable implementations can do this with no loss of 
> speed, and the scaler api allows this. You will need to define if this 
> is before or after the buffer transform...

In fact, working on this in weston a bit it seems that in general, scale
is seldom used by itself but rather its used to calculate the buffer and
screen size which are then used, and we want both of these to be
integers. So, it seems to me that we should specify scaling by giving
the width/heigh of the surface, which in combination with the buffer
size gives the exact scaling ratios, plus it guarantees that the scaling
maps integers to integers.




More information about the wayland-devel mailing list