mirror of
https://github.com/brl/mutter.git
synced 2024-12-28 22:02:14 +00:00
tests: Force X synchronization so the stage size is reliable
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. This way we should be able to remove all the hacky sleeps and frame count delays from our tests.
This commit is contained in:
parent
b24c96189d
commit
551945ce6c
@ -1,5 +1,10 @@
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#ifdef COGL_HAS_XLIB
|
||||
#include <X11/Xlib.h>
|
||||
#include <clutter/x11/clutter-x11.h>
|
||||
#endif
|
||||
|
||||
#include "test-conform-common.h"
|
||||
|
||||
/**
|
||||
@ -21,6 +26,18 @@ test_conform_simple_fixture_setup (TestConformSimpleFixture *fixture,
|
||||
"If you want to run all the tests you should run\n"
|
||||
"$ make test-report");
|
||||
counter++;
|
||||
|
||||
#ifdef COGL_HAS_XLIB
|
||||
/* 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
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user