[PATCH weston] compositor-drm: Don't drop viewported surfaces into the cursor plane

Derek Foreman derekf at osg.samsung.com
Fri Sep 30 19:57:00 UTC 2016


On 30/09/16 02:39 PM, Daniel Stone wrote:
> Hi Derek,
>
> On Friday, 30 September 2016, Derek Foreman <derekf at osg.samsung.com
> <mailto:derekf at osg.samsung.com>> wrote:
>
>     +static bool
>     +viewport_is_cursor_compatible(struct weston_buffer_viewport *viewport)
>     +{
>     +       /* While we could technically relax soem of these constraints
>     +        * if we implemented cropping in cursor_bo_update, it doesn't
>     +        * seem worth the effort.
>     +        * It is also possible to more thoroughly test if src and dst
>     +        * sizes match when widths aren't -1, but again, likely not
>     +        * worth the complexity.
>     +        */
>     +       if (viewport->surface.width != -1)
>     +               return false;
>     +       if (wl_fixed_to_int(viewport->buffer.src_x) != 0)
>     +               return false;
>     +       if (wl_fixed_to_int(viewport->buffer.src_y) != 0)
>     +               return false;
>     +       if (wl_fixed_to_int(viewport->buffer.src_width) != -1)
>     +               return false;
>     +       if (viewport->surface.width != -1)
>     +               return false;
>
>
> Presumably one of these should be height, and are we not missing a
> src_height check too? Also, might as well merge the buffer_scale check
> in here too.

Oops, one just shouldn't be there.

Height is actually left as 0 in init, so I can't assume it being != -1 
means anything useful - but I think width != -1 will always be true for 
any manner of scale or crop.

I left the buffer_scale check out because it's not technically a part of 
viewport protocol despite being stored in the viewport structure just 
for fun.  So I'd not only have to pass an entire extra parameter, but 
I'd have to think of a better function name. :)

In fact, on re-reading the protocol it seems that -1 for src_width is 
good enough to test if any manner of crop is in play, so maybe I'll just 
add the two width checks to the caller and skip the new function entirely.

Thanks,
Derek

> Cheers,
> Daniel
>
>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
>



More information about the wayland-devel mailing list