<div dir="ltr">On Tue, May 14, 2013 at 3:19 PM, Alexander Larsson <span dir="ltr"><<a href="mailto:alexl@redhat.com" target="_blank">alexl@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On tis, 2013-05-14 at 13:19 +0200, John Kåre Alsaker wrote:<br>
> On Tue, May 14, 2013 at 11:25 AM, Alexander Larsson<br>
> <<a href="mailto:alexl@redhat.com">alexl@redhat.com</a>><br>
><br>
</div><div class="im">> I don't think it should really be allowed to not apply the<br>
> scaling.<br>
> Users may want to disable scaling as it's not very good looking. I<br>
> don't think we should enforce a policy about that.<br>
<br>
</div>What do you mean? Scaling is done by the compositor. The user is who<br>
tells the compositor to use scaling (by setting a scale on the<br>
wl_outputs), just like he sets the resolution.<br></blockquote><div>I might have been unclear. Users may want to disable resizing of buffer pixels in the compositor. However clients which able to draw at the correct scaling factor should still do so and appear pixel perfect.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
> Right now buffer sizes define surface sizes, and that makes<br>
> surface<br>
> sizes not really well defined.<br>
> They're defined as the same as buffer sizes (ignoring the trivial<br>
> transformations). They should still be the same if the scaling factor<br>
> is not 1.0. Clients should scale both buffers and surfaces. The only<br>
> thing that should decouple these sizes more are the scaling extension.<br>
<br>
</div>Obviously they are defined as such right now, since there is no scaling.<br> But, the patch I proposed changes this,</blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
because otherwise we can't<br>
cleanly handle backwards compatibility (and also it makes sense).<br></blockquote><div>Backwards compatibility with what?</div><div><br></div><div>How would you handle subsurfaces with different scaling factors? What coordinates would the subsurface's position be in?</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In the canonical example of 2x scaling you have some lcd panel at say<br>
2000x2000, and we want naive apps to be automatically upscaled as if it<br>
was a 1000x1000 monitor. If a window in the naive app is maximized this<br>
means it must get a configure reply from maximize that says 1000x1000,<br>
which cause it to attach a buffer of 1000x1000 (with scale factor 1) to<br>
it. This is how existing wayland clients work.<br></blockquote><div>In my proposal the compositor will scale down configure arguments by the same amount it resizes the window up.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Now, a non-naive client will get the same maximize reply of 1000x1000,<br>
but in this case we want it to create a buffer of 2000x2000 (with scale<br>
2) since it knows the window is on a high-dpi monitor. So, there is a<br>
natural separation of the surface size (1000x1000) and the buffer size<br>
(2000x2000).<br>
<br>
We can't have the configure event say 2000x2000, because then old<br>
clients will not be auto-upscaled as we want.<br></blockquote><div>In this case our proposals differs. The compositor knows it's not resizing the window so it simply passes 2000x2000 along to the configure arguments.</div>
<div><br></div><div>It's also worth considering the edge cases when pixels doesn't scale down so easily. Say we have a workspace of 2000x1901 and we have a scaling factor of 2 and we want to maximize the client.</div>
<div>With a scale factor unaware legacy client we'd have to send 1000x950.5 which would have to be rounded to 1000x951. We could compensate by cropping or stretching to fill the workspace.</div><div>With a client using a scaling factor of 2 I'd send 2000x1901 which the client might be able to fill exactly or it might just pretend it's 2000x1902 and crop the result. In your proposal this would still have to be rounded to 1000x951 and clients able to fill 2000x1901 exactly would render at 2000x1902 instead.</div>
<br></div>