2010-09-21 08:17:53 -04:00
|
|
|
#include "config.h"
|
|
|
|
|
2008-11-07 14:32:28 -05:00
|
|
|
#include <clutter/clutter.h>
|
2010-09-21 08:17:53 -04:00
|
|
|
#include <stdlib.h>
|
2008-11-07 14:32:28 -05:00
|
|
|
|
Add a new GDK backend
This commit introduces a new flavour for Clutter, that uses GDK
for handling all window system specific interactions (except for
creating the cogl context, as cogl does not know about GDK), including
in particular events. This is not compatible with the X11 (glx)
flavour, and this is reflected by the different soname (libclutter-gdk-1.0.so),
as all X11 specific functions and classes are not available. If you
wish to be compatible, you should check for CLUTTER_WINDOWING_X11.
Other than that, this backend should be on feature parity with X11,
including XInput 2, XSettings and EMWH (with much, much less code)
https://bugzilla.gnome.org/show_bug.cgi?id=657434
2011-08-25 21:09:18 -04:00
|
|
|
#ifdef CLUTTER_WINDOWING_X11
|
2010-07-07 08:38:10 -04:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <clutter/x11/clutter-x11.h>
|
|
|
|
#endif
|
|
|
|
|
2008-11-07 14:32:28 -05:00
|
|
|
#include "test-conform-common.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* test_conform_simple_fixture_setup:
|
|
|
|
*
|
|
|
|
* Initialise stuff before each test is run
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
test_conform_simple_fixture_setup (TestConformSimpleFixture *fixture,
|
|
|
|
gconstpointer data)
|
|
|
|
{
|
2010-09-21 08:17:53 -04:00
|
|
|
const TestConformSharedState *shared_state = data;
|
2010-07-07 08:31:35 -04:00
|
|
|
static int counter = 0;
|
2010-05-06 09:21:53 -04:00
|
|
|
|
2010-07-07 08:31:35 -04:00
|
|
|
if (counter != 0)
|
|
|
|
g_critical ("We don't support running more than one test at a time\n"
|
|
|
|
"in a single test run due to the state leakage that often\n"
|
|
|
|
"causes subsequent tests to fail.\n"
|
|
|
|
"\n"
|
|
|
|
"If you want to run all the tests you should run\n"
|
|
|
|
"$ make test-report");
|
|
|
|
counter++;
|
2010-07-07 08:38:10 -04:00
|
|
|
|
2012-06-20 03:50:48 -04:00
|
|
|
#ifdef CLUTTER_WINDOWING_X11
|
2010-09-21 08:17:53 -04:00
|
|
|
{
|
|
|
|
/* on X11 we need a display connection to run the test suite */
|
|
|
|
const gchar *display = g_getenv ("DISPLAY");
|
|
|
|
if (!display || *display == '\0')
|
|
|
|
{
|
|
|
|
g_print ("No DISPLAY found. Unable to run the conformance "
|
|
|
|
"test suite without a display.\n");
|
|
|
|
|
|
|
|
exit (EXIT_SUCCESS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-20 03:50:48 -04:00
|
|
|
/* enable XInput support */
|
2012-06-07 05:08:49 -04:00
|
|
|
clutter_x11_enable_xinput ();
|
2012-06-20 03:50:48 -04:00
|
|
|
#endif
|
2012-06-07 05:08:49 -04:00
|
|
|
|
2010-09-21 08:17:53 -04:00
|
|
|
g_assert (clutter_init (shared_state->argc_addr, shared_state->argv_addr)
|
|
|
|
== CLUTTER_INIT_SUCCESS);
|
|
|
|
|
Add a new GDK backend
This commit introduces a new flavour for Clutter, that uses GDK
for handling all window system specific interactions (except for
creating the cogl context, as cogl does not know about GDK), including
in particular events. This is not compatible with the X11 (glx)
flavour, and this is reflected by the different soname (libclutter-gdk-1.0.so),
as all X11 specific functions and classes are not available. If you
wish to be compatible, you should check for CLUTTER_WINDOWING_X11.
Other than that, this backend should be on feature parity with X11,
including XInput 2, XSettings and EMWH (with much, much less code)
https://bugzilla.gnome.org/show_bug.cgi?id=657434
2011-08-25 21:09:18 -04:00
|
|
|
#ifdef CLUTTER_WINDOWING_X11
|
2010-07-07 08:38:10 -04:00
|
|
|
/* A lot of the tests depend on a specific stage / framebuffer size
|
|
|
|
* when they read pixels back to verify the results of the test.
|
|
|
|
*
|
|
|
|
* Normally the asynchronous nature of X means that setting the
|
|
|
|
* clutter stage size may really happen an indefinite amount of time
|
|
|
|
* later but since the tests are so short lived and may only render
|
|
|
|
* a single frame this is not an acceptable semantic.
|
|
|
|
*/
|
|
|
|
XSynchronize (clutter_x11_get_default_display(), TRUE);
|
|
|
|
#endif
|
2008-11-07 14:32:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* test_conform_simple_fixture_teardown:
|
|
|
|
*
|
|
|
|
* Cleanup stuff after each test has finished
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
test_conform_simple_fixture_teardown (TestConformSimpleFixture *fixture,
|
|
|
|
gconstpointer data)
|
|
|
|
{
|
|
|
|
/* const TestConformSharedState *shared_state = data; */
|
|
|
|
}
|
|
|
|
|
2011-07-13 09:10:47 -04:00
|
|
|
void
|
|
|
|
test_conform_get_gl_functions (TestConformGLFunctions *functions)
|
|
|
|
{
|
|
|
|
functions->glGetString = (void *) cogl_get_proc_address ("glGetString");
|
|
|
|
g_assert (functions->glGetString != NULL);
|
|
|
|
functions->glGetIntegerv = (void *) cogl_get_proc_address ("glGetIntegerv");
|
|
|
|
g_assert (functions->glGetIntegerv != NULL);
|
|
|
|
functions->glPixelStorei = (void *) cogl_get_proc_address ("glPixelStorei");
|
|
|
|
g_assert (functions->glPixelStorei != NULL);
|
|
|
|
functions->glBindTexture = (void *) cogl_get_proc_address ("glBindTexture");
|
|
|
|
g_assert (functions->glBindTexture != NULL);
|
|
|
|
functions->glGenTextures = (void *) cogl_get_proc_address ("glGenTextures");
|
|
|
|
g_assert (functions->glGenTextures != NULL);
|
|
|
|
functions->glGetError = (void *) cogl_get_proc_address ("glGetError");
|
|
|
|
g_assert (functions->glGetError != NULL);
|
|
|
|
functions->glDeleteTextures =
|
|
|
|
(void *) cogl_get_proc_address ("glDeleteTextures");
|
|
|
|
g_assert (functions->glDeleteTextures != NULL);
|
|
|
|
functions->glTexImage2D = (void *) cogl_get_proc_address ("glTexImage2D");
|
|
|
|
g_assert (functions->glTexImage2D != NULL);
|
|
|
|
functions->glTexParameteri =
|
|
|
|
(void *) cogl_get_proc_address ("glTexParameteri");
|
|
|
|
g_assert (functions->glTexParameteri != NULL);
|
|
|
|
}
|