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

2016-05-31 Thread Pekka Paalanen
On Tue, 31 May 2016 09:13:13 +
"Potrola, MateuszX"  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. 

Hi,

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?


Thanks,
pq


pgpZ3fI7yL0be.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


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

2016-05-31 Thread Potrola, MateuszX
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.
 
> 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.

Regards,
Mateusz
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


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

2016-05-20 Thread Pekka Paalanen
On Wed, 18 May 2016 12:22:06 +0100
mateuszx.potr...@intel.com wrote:

> From: Mateusz Polrola 
> 
> If surface will be set to visible before its source rectangle will
> be defined it will be displayed in its orginal size.

Hi,

how does it happen that you set visibility but not the source rectangle?

Are you hitting the warning added in
bcff632727f9d65e4aa1daa724b8097db8321d1c?

If you are, then how is that not an error in using the ivi-layout API?

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?

> 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 thought they were not optional to set, but the documentation does not
really say if, or what is expected.


> V2 changes:
> Removed blank line
> 
> Signed-off-by: Mateusz Polrola 
> ---
>  ivi-shell/ivi-layout.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
> index 1601787..99d9db8 100644
> --- a/ivi-shell/ivi-layout.c
> +++ b/ivi-shell/ivi-layout.c
> @@ -250,6 +250,8 @@ init_surface_properties(struct 
> ivi_layout_surface_properties *prop)
>*/
>   prop->dest_width = 1;
>   prop->dest_height = 1;
> + prop->source_width = 1;
> + prop->source_height = 1;
>  }
>  
>  /**

Is this a regression, btw?

The patch context is missing this:
static void
init_surface_properties(struct ivi_layout_surface_properties *prop)
{
memset(prop, 0, sizeof *prop);
prop->opacity = wl_fixed_from_double(1.0);
/*
 * FIXME: this shall be finxed by ivi-layout-transition.
 */
prop->dest_width = 1;
prop->dest_height = 1;
}

The comment and assignments were added in
e259a7a7d243ba143ab53a56285c4cef2ba1ed68 which clearly indicates that
initializing to non-zero is just a workaround for a bug elsewhere. I
would not like to add even more duct tape.

Now, if you do initialize source rectangle to 1x1 at 0,0, it won't
actually fix anything. At step 3 in the sequence described above, you
will be showing the top-left pixel of the surface. Then at step 5
(assuming also destination rectangle is set), it will change to the
intended layout. In other words, that is a glitch: you temporarily show
something you did not intend to. It's just that it is much easier to
see a whole window flicker than a single pixel (which might even be
transparent as it is on the edge of a surface).

Is there something I missed here?


Thanks,
pq


pgpkrxIjBNd0s.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


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

2016-05-18 Thread mateuszx . potrola
From: Mateusz Polrola 

If surface will be set to visible before its source rectangle will
be defined it will be displayed in its orginal size.
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

V2 changes:
Removed blank line

Signed-off-by: Mateusz Polrola 
---
 ivi-shell/ivi-layout.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 1601787..99d9db8 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -250,6 +250,8 @@ init_surface_properties(struct 
ivi_layout_surface_properties *prop)
 */
prop->dest_width = 1;
prop->dest_height = 1;
+   prop->source_width = 1;
+   prop->source_height = 1;
 }
 
 /**
-- 
2.1.0

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel