[RFC] wl_surface scale and crop protocol extension
Jason Ekstrand
jason at jlekstrand.net
Thu May 2 12:43:38 PDT 2013
On Thu, May 2, 2013 at 1:22 PM, Daniel Stone <daniel at fooishbar.org> wrote:
> Hi,
>
> On 2 May 2013 15:42, Jason Ekstrand <jason at jlekstrand.net> wrote:
> > Ok, I see it now. Sorry, but I missed it on my first read-through. Yes,
> it
> > fixes the problem, but in an extremely confusing way. The reason I say
> it
> > is confusing is because it inherently mixes buffer and surface coordinate
> > systems. I really think we need to isolate buffer coordinates from
> surface
> > coordinates more. Perhaps what we need is two requests: set_source_rect
> and
> > set_dest_rect and completely ignore the x and y from attach. This both
> > provides clarity to the coordinate systems and provides a little
> separation
> > between crop and scale.
>
> Ideally, when wl_surface::commit was added, wl_surface::attach
> should've been broken out into wl_surface::attach and
> wl_surface::set_position. Oh well.
>
Exactly. That's what my suggestion was trying to fix (at least in the
transformed surface case).
> That being said, we can't ignore the x and y from attach, because that
> _moves the window_ on screen (think resizing from top left), whereas
> this is all about how we map the contents of a buffer into that window
> - totally unrelated to moving.
>
Yes, I realize that the x and y from attach are used for moving or scaling
from top or left. My suggestion was to replace the x and y in attach with
an x and y in set_dest_rect. We wouldn't be losing functionality, just
moving it in a certain case. This way surface coordinates are kept with
surfaces and buffer coordinates are kept with buffers.
In this case, the defined behavior would be that if you create a scaler for
a surface, the x and y in attach are disabled and set_dest_rect takes
over. This way older clients can just use attach like they used to and
clients that use surface scalers use the destination rectangle. It's not a
perfect fix, but I think it moves in the right direction. And, for what
it's worth, it doesn't make things significantly more complicated because
anything that's going to scale from the top-left will have to mess with
both the surface and the scaler anyway.
--Jason Ekstrand
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130502/3e967e8f/attachment.html>
More information about the wayland-devel
mailing list