[waffle] [PATCH 1/2] gl_basic_test: Add test that config with alpha works

Chad Versace chad.versace at linux.intel.com
Fri May 25 10:35:34 PDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/24/2012 07:33 AM, Pauli Nieminen wrote:
> With X11 backend waffle fails to create window for egl config with
> alpha. The problem is 32 bit X visual (id 0x66) that is special
> composite translucent visual. As mesa only support alpha bit with
> translucent window waffle choose config with the problematic visual.
> 
> Signed-off-by: Pauli Nieminen <pauli.nieminen at linux.intel.com>
> ---
>  tests/functional/gl_basic_test.c |   31 ++++++++++++++++++++-----------
>  1 files changed, 20 insertions(+), 11 deletions(-)
> 
> diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c
> index 515f122..a0d2574 100644
> --- a/tests/functional/gl_basic_test.c
> +++ b/tests/functional/gl_basic_test.c
> @@ -147,7 +147,7 @@ gl_basic_init(int32_t waffle_platform)
>  }
>  
>  static void
> -gl_basic_draw(int32_t waffle_context_api)
> +gl_basic_draw(int32_t waffle_context_api, int32_t alpha)
>  {
>      int32_t libgl;
>  
> @@ -159,7 +159,7 @@ gl_basic_draw(int32_t waffle_context_api)
>          WAFFLE_RED_SIZE,        8,
>          WAFFLE_GREEN_SIZE,      8,
>          WAFFLE_BLUE_SIZE,       8,
> -        WAFFLE_ALPHA_SIZE,      0,
> +        WAFFLE_ALPHA_SIZE,      alpha,
>          0,
>      };
>  
> @@ -248,17 +248,20 @@ TEST(gl_basic, glx_init)
>  
>  TEST(gl_basic, glx_gl)
>  {
> -    gl_basic_draw(WAFFLE_CONTEXT_OPENGL);
> +    gl_basic_draw(WAFFLE_CONTEXT_OPENGL, 0);
> +    gl_basic_draw(WAFFLE_CONTEXT_OPENGL, 1);
>  }


Waffle needs the new alpha tests, but having gl_basic.glx_gl call
gl_basic_draw() twice is too much action for what is attempting to be
a unit test. Each test should test one thing.

Please create a separate test for "with-alpha" and "without-alpha". Perhaps
they can be named like this:
  gl_basic.glx_gl_with_alpha
  gl_basic.glx_gl_without_alpha
or maybe like this: 
  gl_basic.glx_gl_alpha0
  gl_basic.glx_gl_alpha1
Whatever. The name is not that important, as long as they are separated.

- ----
Chad Versace
chad.versace at linux.intel.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPv8LjAAoJEAIvNt057x8iJ7oQAIru4LDkzWJ3eeHGtvgmd5e4
IrAH4OicCuVYKrikjtPnlU03ci9IzKSWUfApXL5zdW9JQfpDlVyt8SFVlLayzWFQ
sqgZTCvVtcj23ncLAvaYOyKwkVgbXct7adLyzIj4XrEK6ANHx2pD0Breti6taS1b
Tx4lHnKdab9rBbJYYG69yCEl/MOgRzfjW2OMJy2bopLBi1LwQBjx9aA0XKSYjvok
lupmu0oO6ntvKX/iaYFkwGzsOhxmYVAUw/PsNP4Gg7h9LtTY61lg6TcYl8ErZHFQ
CO3sIB92JyiiStZvipZWEJ91nMvkdUpQCUzrC1V6GwWWQxBNdnzQjXhD/p8vAIZW
DN6bmbRRjQx+0uIU/3ALYm6ug5snx/TIgD9nsIt8Ur8Zn/DqGnMnhLQRU0XGl1oe
JXsoAbODKVy+DCynu19fS1pn4wvtgiJMapIDwDlaeHjyyLYh29s0VlXiCe7InjPl
VkPBEnJiBNWS301crw+Oigro591FgLaP/78zPg4V27eSdFi7uSLvTUEmnoAWpgRT
fn8ZL1Xjxp/mfPsy/GuH40twRi/obfwvRTM9CYoR+Ggd2Aq0DLqNkBCOmqd67nB6
T1nPkVZ1UssaFcWAE36cqHoHn3SV/df0chsILwBlbtVfYub2kmi2KfVBsk+Fm2uR
UN8RaZdK10dh/4p4vefP
=VcC2
-----END PGP SIGNATURE-----


More information about the waffle mailing list