Even if the test has been successfully compiled against the X11 backend,
we need to ensure that it is actually running against it, otherwise bad
things will happen.
In test-pixmap.c instead of using the GdkPixbuf API to load the
redhand.png image we now use the cairo API to load the png into a xlib
surface which wraps our Pixmap.
This test was the last thing that depended on the gdk API and since
it's more concise to use Cairo here which is a hard dependency for
Clutter this change means we avoid depending on GdkPixbuf directly.
This fixes segfaults when something goes wrong during
init, but the test keeps going anyway.
Except for test-easing and test-picking, these were fixed by
sed magic:
sed -i -s -e "s/clutter_init \?(&argc, &argv)/\
if (clutter_init (\&argc, \&argv) != CLUTTER_INIT_SUCCESS)\n\
return 1/" tests/*/*.c
http://bugzilla.clutter-project.org/show_bug.cgi?id=2574
The ClutterGLXTexturePixmap actor is just a wrapper around
ClutterX11TexturePixmap, since the relevant texture-from-pixmap code has
been moved down to Cogl.
The config.h header should be considered a Clutter internal header, and
the test cases (especially the interactive test cases) should strive to
never rely on internal headers.
The Behaviour class and its implementations have been replaced by the
new animation framework API and by the constraints for layout-related
animations.
Currently, we need to make tests build, so we undef DISABLE_DEPRECATED
in specific test cases while they get ported.
As a convenient test that clipped redraws are working correctly in
response to X pixmap damage this updates test-pixmap to have a repeating
1 second timeout that draws arcs on the pixmap.
The keysyms defines in clutter-keysyms.h are generated from the X11 key
symbols headers by doing the equivalent of a pass of sed from XK_* to
CLUTTER_*. This might lead to namespace collisions, down the road.
Instead, we should use the CLUTTER_KEY_* namespace.
This commit includes the script, taken from GDK, that parses the X11
key symbols and generates two headers:
- clutter-keysyms.h: the default included header, with CLUTTER_KEY_*
- clutter-keysyms-compat.h: the compatibility header, with CLUTTER_*
The compat.h header file is included if CLUTTER_DISABLE_DEPRECATED is
not defined - essentially deprecating all the old key symbols.
This does not change any ABI and, assuming that an application or
library is not compiling with CLUTTER_DISABLE_DEPRECATED, the source
compatibility is still guaranteed.
When the 'm' key is pressed it will now recursively look for all
ClutterTexture subclasses on the stage and toggle the texture quality
between high and low. This is useful to test the mipmap fallback.
When the mouse button is pressed it would previously draw a small
1-pixel wide fully transparent line to the pixmap. This is a useful
feature to help test the automatic updates but the line is quite hard
to see so it's to easy miss. This patch changes it to draw a thick
black circle. The circle is drawn at a different position every time
the button is clicked.
The hand actor has a feature that if you click on the stage it will
draw a line to the actor. However it's not possible to see the results
of this because automatic updates were disabled so the texture would
never be updated.
test-pixmap has long had a --disable-x11 option that didn't do
anything. This patch adds the neccessary if (disable_x11) to disable
adding the ClutterX11TexturePixmap actor when the option is given.
While this is totally fine (None is 0L and, in the pointer context, will
be converted in the right internal NULL representation, which could be a
value with some bits to 1), I believe it's clearer to use NULL instead
of None when we talk about pointers.
The build for interactive tests creates symbolic links for the data
under tests/data; it also uses symbolic links for creating "binaries"
for each interactive test. This is less than ideal, though.
Instead, the tests should build a path to the data files by using
a pre-processor define like TESTS_DATADIR; both g_build_filename() and
pre-processor string concatenation can be used to generate a valid
file name with the full path to the files.
The build system should also create wrapper scripts, just like we
do inside the conformance test suite, to be able to launch single
tests.
ClutterEvent is not really gobject-introspection friendly because
of the whole discriminated union thing. In particular, if you get
a ClutterEvent in a signal handler, you probably can't access the
event-type-specific fields, and you probably can't call methods
like clutter_key_event_symbol() either, because you can't cast the
ClutterEvent to a ClutterKeyEvent.
The cleanest solution is to turn every accessor into ClutterEvent
methods, accepting a ClutterEvent* and internally checking the event
type.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1585
Timelines no longer work in terms of a frame rate and a number of
frames but instead just have a duration in milliseconds. This better
matches the working of the master clock where if any timelines are
running it will redraw as fast as possible rather than limiting to the
lowest rated timeline.
Most applications will just create animations and expect them to
finish in a certain amount of time without caring about how many
frames are drawn. If a frame is going to be drawn it might as well
update all of the animations to some fraction of the total animation
rather than rounding to the nearest whole frame.
The 'frame_num' parameter of the new-frame signal is now 'msecs' which
is a number of milliseconds progressed along the
timeline. Applications should use clutter_timeline_get_progress
instead of the frame number.
Markers can now only be attached at a time value. The position is
stored in milliseconds rather than at a frame number.
test-timeline-smoothness and test-timeline-dup-frames have been
removed because they no longer make sense.
The test no longer requires an XID argument to run; instead it creates its
own X Window. The test now also aims to demonstrate whether mipmapping is
working, and clearly informs you if fallbacks are being used for GLX tfp.
* tests/interactive/test-pixmap.c (create_pixmap): Use a format
string instead of passing the error message directly to g_error.
* tests/interactive/test-easing.c (test_easing_main)
(on_button_press):
* tests/interactive/test-animation.c (on_button_press): Use
unsigned variables for the results from clutter_actor_get_size
otherwise it complains about the pointer signedness being
different.
* clutter/clutter-script.c (clutter_script_add_search_paths): Use
G_GSIZE_FORMAT instead of %d for a gsize parameter otherwise it
gets upset on 64-bit.
* tests/interactive/test-pixmap.c:
test-pixmap + test-devices accidentally got dropped from the makefiles
when changing the unit test layout; this puts them back.
framework
* configure.ac:
* tests/*:
The tests have been reorganised into different categories: conformance,
interactive and micro benchmarks.
- conformance tests can be run as part of automated tests
- interactive tests are basically all the existing tests
- micro benchmarks focus on a single performance metric
I converted the timeline tests to conformance tests and also added some
tests from Neil Roberts and Ebassi.
Note: currently only the conformance tests use the glib test APIs,
though the micro benchmarks should too.
The other change is to make the unit tests link into monolithic binaries
which makes the build time for unit tests considerably faster. To deal
with the extra complexity this adds to debugging individual tests I
have added some sugar to the makefiles so all the tests can be run
directly via a symlink and when an individual test is run this way,
then a note is printed to the terminal explaining exactly how that test
may be debugged using GDB.
There is a convenience make rule: 'make test-report', that will run all
the conformance tests and hopefully even open the results in your web
browser. It skips some of the slower timeline tests, but you can run
those using 'make full-report'