[PATCH weston v2] ivi-layout: Initialize surface source rectange to 1x1

Pekka Paalanen ppaalanen at gmail.com
Tue May 31 12:36:58 UTC 2016

On Tue, 31 May 2016 09:13:13 +0000
"Potrola, MateuszX" <mateuszx.potrola at intel.com> wrote:

> Hi,
> > Even more so, because as far as I can see, to actually see the badly sized surface
> > you have to do this in ivi-layout API:
> > 1. add the surface to a layer
> > 2. set visibility true
> > 3. commit_changes
> > 4. set source rectangle
> > 5. commit_changes
> > 
> > At step 3, the surface will be shown. It looks to me that you are very specifically
> > asking the surface to be shown with an unset source rectangle. Is there any
> > other way it can happen?  
> That is correct, we are specifically asking surface to be shown
> before setting source rectangle - we are just testing different test
> case of how ivi shell can be used, that is one of them.
> > > This is because initial setting of destination rectangle to 1x1
> > > is not causing surface resize and because source rectangle is 0x0
> > > appropiate transformation matrix is not calculated  
> > 
> > Ok, but why is that wrong?
> > 
> > If you do not set source and destination rectangles, what do you
> > expect to get?  
> I expect to not see anything, but in that case I can see that surface
> is being displayed in original size. 


is there some layer manager specification somewhere or something you
could refer to, that we would want to mirror?

I agree it is surprising, but one might also say it is intentional to
catch unexpected use of the API.

I think defaulting to show the whole window scaled down to 1x1 is the
worst choice of a default behaviour. The destination 1x1 is a hack
anyway, waiting to be removed when other code gets fixed to handle
destination 0x0 properly.

Maybe fixing the other code and dropping the 1x1 hack would actually
get you what you want, as the destination size would default to 0x0.
I'd still argue that source size should default to the whole surface,
rather than point-sampling the color from some pixel and painting
destination rectangle with that.

In no case would the default source of 1x1 be correct. The same can be
said about destination.

> > I thought they were not optional to set, but the documentation does
> > not really say if, or what is expected.  
> If that is wrong use case then it will be nice to get some info in
> documentation about what steps are mandatory to do before eg. setting
> visibility to true.

The problem is, we at Weston upstream do not know how it should behave.
All we have is the current implementation.

In any case, whatever we find is the correct behaviour, it should be
implemented properly. Are you sure your patch does not cause a
transparent window to show up and possibly get input?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160531/ce80d9ca/attachment.sig>

More information about the wayland-devel mailing list