Commit Graph

687 Commits

Author SHA1 Message Date
Emmanuele Bassi
aab411bde4 test-scrolling: Animate intermediate positions
Animating intermediate positions in the viewport panning is a neat
effect.
2010-05-27 12:32:45 +01:00
Emmanuele Bassi
346ebce573 actor: Add accessors pair for :clip-to-allocation
We should have an accessors pair for the :clip-to-allocation property,
to avoid going through the generic GObject accessors.
2010-05-26 16:09:47 +01:00
Emmanuele Bassi
6ea56f1160 Add a scrolling interactive example
We can use a container with :clip-to-allocation set to TRUE and a
DragAction to create a panning viewport.
2010-05-26 15:58:15 +01:00
Emmanuele Bassi
823251c159 Use ClickAction in test-animation
Instead of using ::button-press-event.
2010-05-26 14:18:19 +01:00
Emmanuele Bassi
728e2d8071 drag: Add a default drag-motion behaviour
The DragAction should, by default, drag the actor to which it has been
applied, instead of delegating what to do to the developer. If custom
code need to override it, g_signal_stop_emission_by_name() can be called
to stop the default handler to ever running.
2010-05-25 11:01:46 +01:00
Øyvind Kolås
8f0b70a9ee state: replaced test with a more complex one 2010-05-24 16:29:04 +01:00
Neil Roberts
70abe3dd8a test-cogl-materials: Test invalid layers with a constant color
This adds a test using a layer with no texture but that replaces the
fragment color with the layer constant. This currently causes the test
to fail.

http://bugzilla.openedhand.com/show_bug.cgi?id=2132
2010-05-24 16:10:56 +01:00
Neil Roberts
ff7ce2c5b2 test-cogl-materials: Run the 'all layers' test with different prims
The drawing code from test_invalid_texture_layers which draws a
rectangle, a polygon and a vertex buffer has been split out to
separate function. test_using_all_layers now also uses this so that it
will also test the other two primitives. This causes the test to fail
when all of the layers are drawn using a vertex buffer.

http://bugzilla.openedhand.com/show_bug.cgi?id=2132
2010-05-24 16:10:56 +01:00
Emmanuele Bassi
382bd394b9 Merge branch 'wip/state-machine'
* wip/state-machine:
  Do not use wildcards in test-state
  script: Implement State deserialization
  state: added a "target-state" property
  state: documented data structures
  Add State interactive tests to the ignore file
  state: Documentation and introspection annotation fixes
  state: Minor coding style fixes
  state: Clean up the header's documentation
  state: Constify StateKey accessors
  Do not include clutter.h from a Clutter header file
  state-machine: made clutter_state_change take a boolean animate argument
  state-machine: use clutter_timeline_get_progress
  state-machine: add completed signal
  state machine: added state machine

Conflicts:
	.gitignore
2010-05-24 10:42:03 +01:00
Emmanuele Bassi
9fcbb274e0 Do not use wildcards in test-state
Use named states, like in a real case.
2010-05-21 14:22:56 +01:00
Emmanuele Bassi
6ca425679e script: Implement State deserialization
It should be possible to describe ClutterState transitions using
ClutterScript in a similar way as ClutterAnimator.
2010-05-21 14:13:14 +01:00
Emmanuele Bassi
5e3dc55666 Merge branch 'wip/constraints'
* wip/constraints: (24 commits)
  Add the Cogl API reference to the fixxref extra directories
  Document the internal MetaGroup class
  Remove the construct-only flag from ActorMeta:name
  doc: Remove gtk-doc annotations from the json-glib copy
  doc: Fix parameter documentation
  Add named modifiers for Action and Constraint
  Remove a redundant animation
  Set the stage resizable in test-constraints
  Use a 9 grid for the constraints test
  Miscellaneous documentation fixes
  docs: Document animating action and constraint properties
  docs: Document BindConstraint and AlignConstraint
  constraint: Rename BindConstraint:bind-axis
  constraints: Add AlignConstraint
  tests: Add a constraints interactive test
  constraint: Add BindConstraint
  actor: Implement Animatable
  animation: Use the new Animatable API for custom properties
  animatable: Add custom properties to Animatable
  constraint: Add ClutterConstraint base class
  ...

Conflicts:
	configure.ac
2010-05-21 10:55:09 +01:00
Øyvind Kolås
1dc8c0ff05 state-machine: made clutter_state_change take a boolean animate argument
Most of the time this will be TRUE, pass FALSE to change to the target
state immediately.
2010-05-20 16:24:29 +01:00
Øyvind Kolås
8761b279a7 state-machine: add completed signal
Added a completed signal to the animator
2010-05-20 16:24:29 +01:00
Øyvind Kolås
fcdc3a8989 state machine: added state machine 2010-05-20 16:24:29 +01:00
Emmanuele Bassi
7ce2693944 Add named modifiers for Action and Constraint
The ClutterActor API should have modifier methods for adding, removing
and retrieving Actions and Constraints using the ClutterActorMeta:name
property - mostly, for convenience.
2010-05-20 11:19:51 +01:00
Emmanuele Bassi
4dc91339c3 Remove a redundant animation 2010-05-19 18:23:29 +01:00
Emmanuele Bassi
86a773536f Set the stage resizable in test-constraints
To demonstrate that constraints can be used to reposition actors in a
resizable stage, set the :user-resizable property to TRUE, and spend the
next 15 minutes playing with the stage size.
2010-05-19 18:20:27 +01:00
Emmanuele Bassi
5d1b18669b Use a 9 grid for the constraints test
Let's complicate the interactive constraints test a little bit by adding
more actors and animating two constraints at a time.
2010-05-19 18:17:49 +01:00
Emmanuele Bassi
e9b93d5676 constraint: Rename BindConstraint:bind-axis
We're not binding an axis: we're really binding a coordinate of an actor
to the coordinate of another one.
2010-05-19 14:34:18 +01:00
Emmanuele Bassi
f857457b9d constraints: Add AlignConstraint
AlignConstraint is a simple constraint that keeps an actor's position
aligned to the width or height of another actor, multiplied by an
alignment factor.
2010-05-19 13:02:43 +01:00
Emmanuele Bassi
56e8e7d62f tests: Add a constraints interactive test
Show how to use constraints and how to animate them.
2010-05-19 12:28:35 +01:00
Neil Roberts
871683abd3 test-cogl-materials: Fix compilation under GLES 2
GLES 2 doesn't have GL_MAX_TEXTURE_UNITS. Instead the cogl backend
uses GL_MAX_TEXTURE_IMAGE_UNITS with a maximum limit of 16. The same
restriction is now used in the test.
2010-05-18 16:11:58 +01:00
Emmanuele Bassi
4fd74e71e6 action: Add DragAction, an action implementing drag capabilities
DragAction is an Action sub-class that provides dragging capabilities to
any actor. DragAction has:

  • drag-begin, drag-motion and drag-end signals, relaying the event
    information like coordinates, button and modifiers to user code;

  • drag-threshold property, for delaying the drag start by a given
    amount of pixels;

  • drag-handle property, to allow using other actors as the drag
    handle.

  • drag-axis property, to allow constraining the dragging to a specific
    axis.

An interactive test demonstrating the various features is also provided.
2010-05-17 16:42:11 +01:00
Neil Roberts
a12a2e591b Add a conformance test for ClutterCairoTexture
This adds a simple test for ClutterCairoTexture that draws two
rectangles to the cairo surface in an idle callback and then verifies
that they appeared at the right colours in the paint callback. If that
succeeds then the second time the idle callback is invoked it will
replace one of the rectangles with a sub region update and the
following paint callback will again verify the rectangles.
2010-05-11 15:57:12 +01:00
Robert Bragg
6228082e14 conform: Make gtester run a list of wrappers
Instead of asking gtester to run ./test-conformance directly we now tell
it to run a list of wrapper scripts. This results in each test being
spawned in a separate process avoiding leakage of state between tests
which has been a big problem with the conformance tests for quite a
while now.
2010-05-07 17:17:59 +01:00
Neil Roberts
0120abe5b0 test-cogl-multitexture: Set linear filters on the two textures
Otherwise it seems that rounding errors will cause the fragments at
the edge of the quad to blend with neighbouring quarters of the
texture which cause the test to fail.
2010-05-07 17:06:01 +01:00
Neil Roberts
21117bb7a9 test-conform-common: Disconnect all paint handlers on the stage
A few of the tests connected to the paint signal but never
disconnected it. Most of these handlers had a call to g_main_quit in
them which meant that it could sometimes cause subsequent tests to
exit after the first frame is painted. Most of the tests don't
validate any of the results until after a couple of frames have been
rendered so this ended up skipping out the test entirely.

To workaround this the test setup function now disconnects all
handlers for the paint signal on the default stage before the test is
run.
2010-05-06 14:21:53 +01:00
Neil Roberts
61ae7c6df7 test-cogl-readpixels: Reset the viewport and matrices
The on_paint function for test-cogl-readpixels tries to temporarily
set the projection, modelview and viewport to its own values. However
it was never restoring the saved values so it could affect the results
of subsequent tests.
2010-05-06 14:18:32 +01:00
Neil Roberts
b9c7051484 test-cogl-path: Initialise state.frame
state.frame was left unitialized so it would be left to happenstance
which of the first three frames would be used for validating the test.
2010-05-06 14:16:33 +01:00
Neil Roberts
a3bc4a6009 test-cogl-materials: Add a test using the maximum number of layers
This adds a test which creates a material using the maximum number of
layers. All of the layers are assigned a white texture except the last
which is set to red. The default combine mode is used for all of the
layers so the final fragment should end up red.

Currently Cogl doesn't provide a way to query the maximum number of
layers so it just uses glGetIntegerv instead. This might cause
problems on GLES 2 because that adds additional restrictions on the
number of layers.

http://bugzilla.openedhand.com/show_bug.cgi?id=2064
2010-04-29 12:15:06 +01:00
Neil Roberts
fddd316986 test-cogl-path: Test sub paths and intersections
This changes the original tests so that it splits the original path
into two sub paths. When adding a new block to the copied path it also
adds another sub path. This further stresses the path copying
mechanism and exposes a bug.

It also tests intersections by drawing a self-intersecting path and a
path with two sub-paths that overlap. Where the path overlaps it
should be inverted.
2010-04-21 18:58:18 +01:00
Neil Roberts
08a4995383 tests: Add a conformance test for the wrap modes of a cogl material
This renders a texture using different combinations of wrap modes for
the s and t coordinates and then verifies that the expected wrapping
is acheived. The texture is drawn using rectangles, polygons and
vbos. There is also code to test a rectangle using an atlased texture
(which should test the manual repeating) however the validation for
this is currently disabled because it doesn't work.

http://bugzilla.openedhand.com/show_bug.cgi?id=2063
2010-04-12 15:44:23 +01:00
Emmanuele Bassi
6583f8bb49 tests: Fix test-script.json
A trailing comma is breaking the validity of test-script.json
2010-04-09 18:28:37 +01:00
Neil Roberts
10b16b4b7e Add a test case for cogl_path
This tests various paths drawing rectangles and verifies that the
expected pixels are filled in. Some of the paths are drawn by copying
an existing path and modifying it which should test the copy-on-write
code.
2010-04-08 19:54:20 +01:00
Robert Bragg
d2d890a33e test-cogl-offscreen: Setup a clutter style modelview/projection
This updates test-cogl-offscreen to give an example of setting up a
CoglFramebuffer with a Clutter style 2D coordinate system with (0,0) top
left and (framebuffer_width, framebuffer_height) bottom right.
2010-04-06 09:26:10 +01:00
Neil Roberts
fdf608af4c test-cogl-tex-polygon: Actually use the material it creates
test-cogl-tex-polygon creates a separate material so that it can set
the texture filters. However in the paint functions that use
cogl_polygon it was calling cogl_set_source_texture which replaces the
material and ends up always using GL_LINEAR. This patch makes the
paint functions assume the correct source is set up instead of trying
to select a new source.
2010-03-31 19:03:24 +01:00
José Dapena Paz
7b63da69cf Add "homogeneous" mode to ClutterBoxLayout.
Added new "homogeneous" mode to ClutterBoxLayout, that makes layout children
get all the same size.

This is heavily inspired in the "homogeneous" attribute available in GtkBox,
but simplified as we don't have padding nor borders in box layout, only
spacing.

Also added to test-box-layout a key to set/unset homogeneous mode.

* Coding style fixes.
* Added proper test for homogeneous mode in box layout.
* Fix in homogeneous mode.

http://bugzilla.openedhand.com/show_bug.cgi?id=2034

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-03-25 09:41:54 +00:00
Emmanuele Bassi
382b38c0f7 test-paint-wrapper: Request ARGB visuals on GLX
If we are on GLX we have to request ARGB visuals, otherwise Clutter will
not do it by itself.
2010-03-10 00:25:26 +00:00
Neil Roberts
c3a942abde Add a conformance test for rectangle textures
The test creates a GL_TEXTURE_RECTANGLE_ARB texture using
cogl_texture_new_from_foreign and confirms that rendering it works
correctly. If the rectangle texture extension isn't available then
this test always succeeds.

http://bugzilla.openedhand.com/show_bug.cgi?id=2015
2010-03-04 14:52:12 +00:00
Emmanuele Bassi
9e4c008117 build: Include test-script-model.json
The Model conformance test for ClutterScript parsing requires the file
to be inside the dist.
2010-03-02 19:29:42 +00:00
Emmanuele Bassi
2d51432e52 build: Add test-animator-3.json to EXTRA_DIST 2010-03-02 19:29:42 +00:00
Emmanuele Bassi
2f68949962 conformance: Use g_assert_no_error() if available
GLib 2.20 has a nice g_assert() wrapper which will print out the GError
if it's not NULL.
2010-03-02 19:10:07 +00:00
Emmanuele Bassi
e550755f3d text-field: Cast GString->len to integer before printing
The compiler will warn on 64bit architectures when using %d for
printing a gsize field.

http://bugzilla.openedhand.com/show_bug.cgi?id=2019
2010-03-02 17:50:07 +00:00
Øyvind Kolås
09d8460a5c animator: s/clutter_animator_run/clutter_animator_start/
This is consistent with choice of words in clutter_timeline_start and
makes the API less surprising.
2010-03-02 17:03:03 +00:00
Emmanuele Bassi
aba6c5acc7 flow-layout: Provide a preferred size
The FlowLayout fails to provide a preferred size in case no sizing is
specified on one axis. It should, instead, have the preferred size of
the sum of its children, depending on the orientation property.

http://bugzilla.openedhand.com/show_bug.cgi?id=2013
2010-03-02 15:11:27 +00:00
Neil Roberts
c0a553163b cogl: Support any format in cogl_read_pixels
cogl_read_pixels() no longer asserts that the format passed in is
RGBA_8888 but instead accepts any format. The appropriate GL enums for
the format are passed to glReadPixels so OpenGL should be perform a
conversion if neccessary.

It currently assumes glReadPixels will always give us premultiplied
data. This will usually be correct because the result of the default
blending operations for Cogl ends up with premultiplied data in the
framebuffer. However it is possible for the framebuffer to be in
whatever format depending on what CoglMaterial is used to render to
it. Eventually we may want to add a way for an application to inform
Cogl that the framebuffer is not premultiplied in case it is being
used for some special purpose.

If the requested format is not premultiplied then Cogl will convert
it. The tests have been changed to read the data as premultiplied so
that they won't be affected by the conversion. Picking in Clutter has
been changed to use COGL_PIXEL_FORMAT_RGB_888 because it doesn't need
the alpha component. clutter_stage_read_pixels is left unchanged
because the application can't specify a format for that so it seems to
make most sense to store unpremultiplied values.

http://bugzilla.openedhand.com/show_bug.cgi?id=1959
2010-03-02 11:01:35 +00:00
Emmanuele Bassi
70d7bad98b conformance: Use g_test_verbose() for logging
Protect g_print() calls behind the g_test_verbose() check, to avoid
unwanted output during the conformance test run.
2010-02-25 23:15:59 +00:00
Bastian Winkler
96c31bbf0e model: Implement ClutterScriptable interface
Allow a ClutterModel to be constructed through the ClutterScript API.
Currently this allows a model to be generated like like this:

{
  "id" : "test-model",
  "type" : "ClutterListModel",
  "columns" : [
    [ "text-column", "gchararray" ],
    [ "int-column", "gint" ],
    [ "actor-column", "ClutterRectangle" ]
  ]
}

where 'columns' is an array containing arrays of column-name,
column-type pairs.

http://bugzilla.openedhand.com/show_bug.cgi?id=2007
2010-02-25 23:09:11 +00:00
Neil Roberts
31b5856d69 test-cogl-blend-strings: Add some more tests
The adds tests for the remaining layer combine functions, the 1 minus
value operator and the TEXTURE_N source. Note however that Cogl
currently fails when parsing a TEXTURE_N source so the test is
commented out.
2010-02-25 12:50:52 +00:00
Emmanuele Bassi
bd303d6efb conform: Verify parsing of multiple properties
The ClutterAnimator support for parsing multiple properties should be
verified in the conformance test suite.

http://bugzilla.openedhand.com/show_bug.cgi?id=2003
2010-02-24 16:43:17 +00:00
Emmanuele Bassi
3a9d842164 conformance: Show the Stage to test invariants
We need to make the Stage set the MAPPED flag on itself if we want to
verify the MAPPED state. That was always the case - it just worked
before because the Stage was shown at least once.
2010-02-24 12:25:48 +00:00
Neil Roberts
a726ef32aa test-cogl-vertex-buffer: Fix the maximum index number
It was passing the number of vertices to
cogl_vertex_buffer_draw_elements but instead it should take the
maximum index which would be the number of vertices minus one. This
was causing errors to be reported with the checks filterset of Bugle.
2010-02-17 14:38:45 +00:00
Emmanuele Bassi
fbcaf1e0b3 Improve LEAVE events for border actors
If an actor is lying on the border of the Stage it might miss the LEAVE
event when the pointer of a device leaves the Stage window. Since the
backend is unsetting the Stage back pointer on the InputDevice we can
queue the emission of a LEAVE event on the pointer actor as well.

http://bugzilla.moblin.org/show_bug.cgi?id=9677
2010-02-17 10:48:18 +00:00
Chris Lord
d42f928c43 [test-interactive] Add a stage sizing test
Add an interactive stage sizing test to test the interaction of
fullscreening/resizing/expanding/shrinking a visible stage.
2010-02-16 15:39:08 +00:00
Emmanuele Bassi
7a3eb452b8 conform: Do not resize the stage
Since all conformance tests share the same state we should not touch
stuff like the stage size; sharing is already fairly complex and adds a
lot of caveats on the implementation of a conformance test unit, and if
we make tests influence later ones then we might slip in bugs or false
negatives - thus defeating the whole point of a conformance test suite.
2010-02-16 12:19:15 +00:00
Emmanuele Bassi
4cadc73005 conform: Use a 640x480 stage in test-pick
Do not resize the stage to a smaller size: the default size is perfectly
fine.
2010-02-16 12:19:15 +00:00
Emmanuele Bassi
e65bb38720 conform: Use g_assert_cmpint() in cogl-readpixels test
The g_assert_cmpint() macro prints out not just the assertion condition
but also the assertion contents; this is useful to catch wrong values
without incrementing the verbosity of the test itself.
2010-02-16 12:01:13 +00:00
Emmanuele Bassi
0d428655e2 actor: Turn push/pop_internal into Actor methods
Since the "internal" state is global, it will leak onto actors that you
didn't intend for it to, because it applies not just to the actors you
create, but also to any actors *they* create. Eg, if you have a dialog
box class, you might push/pop_internal around creating its buttons, so
that those buttons get marked as internal to the dialog box. But
ctx->internal_child will still be set during the *button*'s constructor
as well, and so, eg, the label and icon inside the button actor will
*also* be marked as internal children, even if that isn't what the
button class wanted.

The least intrusive change at this point is to make push_internal() and
pop_internal() two methods of the Actor class, and take a ClutterActor
pointer as the argument - thus moving the locality of the internal_child
counter to the Actor itself.

http://bugzilla.openedhand.com/show_bug.cgi?id=1990
2010-02-15 16:09:26 +00:00
Emmanuele Bassi
fef82fae5c build: Enable experimental COGL API in tests/conform
Enable the experimental API when building the conformance test suite.
2010-02-15 11:58:55 +00:00
Emmanuele Bassi
032121ce17 build: Disable deprecated API in tests/conform
We should not be using deprecated API in the conformance test suite.
2010-02-15 11:57:48 +00:00
Emmanuele Bassi
c3354cb2c0 conform: Do not use deprecated API
There is no more type-specific ref/unref pairs: it is all under
CoglHandle now.
2010-02-15 11:56:34 +00:00
Neil Roberts
4be4f56bdf cogl-sub-texture: Optimise taking a sub texture of a sub texture
When creating a Cogl sub-texture, if the full texture is also a sub
texture it will now just offset the x and y and reference the full
texture instead. This avoids one level of indirection when rendering
the texture which reduces the chances of getting rounding errors in
the calculations.
2010-02-12 16:57:17 +00:00
Emmanuele Bassi
00c4bfc3c6 analysis: Interactive tests
Abort if test-behave was passed the wrong type of behaviour to test.
2010-02-12 14:57:56 +00:00
Emmanuele Bassi
46182233c0 analysis: Conformance tests
Initialize ClutterPathNote members to 0 using "{ 0, }".
2010-02-12 14:57:56 +00:00
Emmanuele Bassi
f54b29a0c0 test-text-field: Tone down the border
Use a low opacity for the text field border.
2010-02-10 15:45:54 +00:00
Emmanuele Bassi
2670fc5871 test-text-field: Use ActorBox methods for the border
Clamp to pixel and use get_size() when painting the border of the text
field.
2010-02-10 15:45:54 +00:00
Emmanuele Bassi
cccf23caa4 build: Always build conformance tests with debug symbols
Having the conformance test suite build without debug symbols doesn't
make any sense.
2010-02-09 13:24:13 +00:00
Robert Bragg
e46db37c03 conform: fix stack corruption in test-behaviours.c
The test was calling g_object_get to fetch the "opacity-start" property
(unsigned int) into a guint8 local variable. It's a bit of a mean trap
given that the getter function returns guint8 values so this also adds a
comment explaining what's going on.
2010-02-09 13:09:24 +00:00
Emmanuele Bassi
a139bf9c40 test-animator: Do not use mid-function blocks
The test_animator_properties unit is so small that declaring a
mid-function block for two variables is not that clever.
2010-02-08 17:56:35 +00:00
Damien Lespiau
c02dded0f6 cogl-buffer: Use TEXTURE as the only value for CoglBufferUsageHint
We should try to use more explicit defines than GL for our hints. For
now we only support using a CoglBuffer to generate textures.
2010-02-08 17:14:49 +00:00
Damien Lespiau
b5d5821304 tests: Add a test for CoglPixelBuffers
Exercise the whole public CoglBuffer / CoglPixelBuffer and
cogl_texture_new_from_buffer API.
2010-02-08 17:14:49 +00:00
Emmanuele Bassi
069ba6daf9 Merge branch 'animator-parser'
* animator-parser:
  docs: Describe the Animation definition syntax
  animator: Provide a ClutterScript parser
  animator: Allow retrieving type property type from a key
  script: Use a node when resolving an animation mode
2010-02-08 16:53:11 +00:00
Emmanuele Bassi
4dd11d6915 animator: Provide a ClutterScript parser
The whole point of having the Animator class is that the developer can
describe a complex animation using ClutterScript. Hence, ClutterAnimator
should hook into the Script machinery and parse a specific description
format for its keys.
2010-02-08 15:52:18 +00:00
Emmanuele Bassi
8ac27e6070 test-flow-layout: Remove unneeded Stage sizing
The bug with resizable stages getting a 1, 1 window on X11 has been
fixed by Chris.
2010-02-08 10:40:39 +00:00
Øyvind Kolås
4cc269a468 Add ClutterAnimator
ClutterAnimator is a class for managing the animation of multiple
properties of multiple actors over time with keyframing of values.

The Animator class is meant to be used to effectively describe
animations using the ClutterScript definition format, and to construct
complex implicit animations from the ground up.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-02-07 18:25:19 +00:00
Emmanuele Bassi
e55966d675 Deprecate clutter_util_next_p2()
The next_p2() function should have never been publicly exposed by
Clutter.
2010-02-06 10:49:33 +00:00
Emmanuele Bassi
dcdb97006b build: Add suppressions file to EXTRA_DIST 2010-02-06 10:49:33 +00:00
Neil Roberts
830f2402d4 Merge branch 'more-texture-backends'
This adds three new texture backends.

- CoglTexture2D: This is a trimmed down version of CoglTexture2DSliced
  which only supports a single texture and only works with the
  GL_TEXTURE_2D target. The code is a lot simpler so it has a less
  overheads than dealing with slices. Cogl will use this wherever
  possible.

- CoglSubTexture: This is used to get a CoglHandle to represent a
  subregion of another texture. The texture can be used as if it was a
  standalone texture but it does not need to copy the resources.

- CoglAtlasTexture: This collects RGB and RGBA textures into a single
  GL texture with the aim of reducing texture state changes and
  increasing batching. The backend will try to manage the atlas and
  may move the textures around to close gaps in the texture. By
  default all textures will be placed in the atlas.
2010-02-06 00:20:32 +00:00
Emmanuele Bassi
15c6fef7e3 tests: Add a Valgrind suppression file
When running tests under Valgrind it would be useful to pass a
suppression file for the known one-off allocations done by Clutter
and by its dependencies. This trims the output of Valgrind and
improves the ability to actually spot leaks.
2010-02-04 16:49:06 +00:00
Emmanuele Bassi
16a5911cff tests: Clean up the cairo-flowers interactive test 2010-02-03 15:05:37 +00:00
Kristian Høgsberg
5bec49aea9 Use ClutterTimeline in test-clutter-cairo-flowers.c
http://bugzilla.openedhand.com/show_bug.cgi?id=1969
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-02-02 19:19:06 +00:00
Emmanuele Bassi
12b004b0e7 tests: Add an initial Behaviour conformance suite
The coverage of the Behaviour sub-classes is currently abysmal. An
initial test suite for Behaviours should at least verify that the
accessors and the constructors are doing the right thing.

This initial test suite just verifies the BehaviourOpacity sub-class,
but it already bumps up the overall coverage by 2%.
2010-02-02 12:58:27 +00:00
Neil Roberts
145cc9d3df Merge remote branch 'master' into texture-debugging
Conflicts:
	clutter/cogl/cogl/cogl-context.h
2010-02-01 13:37:19 +00:00
Emmanuele Bassi
5f1c8a17e4 Merge branch 'device-manager'
* device-manager: (37 commits)
  x11: Re-enable XI1 extension keyboards
  x11: Always handle core device events before XI events
  docs: Documentation fixes for DeviceManager
  device-manager: Fix the signals definition
  docs: Add sections for InputDevice and DeviceManager
  docs: Add clutter_input_device_get_device_name()
  tests: Print out the device details on motion
  Always register core devices
  device: Remove unused is_default member
  win32: Experimental implementation of device support
  tests: Print the device name, as well as its Id
  x11: Fill out the :name property of the InputDevices
  device: Add the :name property to InputDevice
  x11: Store core devices on the X11 Backend singleton
  device: Unset the cursor actor when leaving the stage
  device: Add pointer actor getter
  x11: Discard the LeaveNotify for off-stage ButtonRelease
  device: Do not overwrite the stage for an InputDevice
  event: Off-stage button releases have a click count of 1
  event: Scroll events do not have click count
  ...
2010-02-01 11:26:56 +00:00
Emmanuele Bassi
5f5f6d825f build: Allow disabling the conformance test suite
When building Clutter for packaging on headless boxes it's pointless to
allow building the conformance test to be built (and run on 'make
check').
2010-02-01 10:40:34 +00:00
Damien Lespiau
afb30f4013 tests: blend-string: use g_assert_cmpint
It's very useful to see the actual number the reference value is
compared too when the test fails. GTest has g_assert_cmp$type()
functions for that, so make good use of them.
2010-01-26 17:25:10 +00:00
Damien Lespiau
de31cbf4f7 test-cogl-multitexture: use several materials with texture matrices
A small doubt has risen about the use of CoglTextureUnit in materials:
will texture matrices still work if we have several materials, each of
them having at texture on the same texture unit? The answer is yes!

test-cogl-multitexture has been extended to use 2 materials with about
the same setup except a little difference: the texture matrices for the
lightmaps rotate in opposite directions.

While at it, changed the rotation behaviour by an implicit animation
with a small additional bonus bling.
2010-01-26 16:59:50 +00:00
Emmanuele Bassi
d0f7debfba test-easing: Do not reconnect signals multiple times
The test should keep track of the last animation and avoid reconnecting
signals to the same instance in case the -r argument has been passed.
2010-01-22 21:44:28 +00:00
Emmanuele Bassi
8a4b647154 x11: Re-enable XI1 extension keyboards
The extension keyboard support in XInput 1.x is hopelessly broken.

Nevertheless, it's possible to use some bits of it, as we prefer the
core keyboard events to the XInput events, thus at least having proper
handling for X11 key events on the Stage window.
2010-01-20 19:40:58 +00:00
Emmanuele Bassi
1f5a7b61b7 tests: Print out the device details on motion
The test-device interactive test should print out the device name and id
when it detects a motion event.
2010-01-20 00:38:53 +00:00
Emmanuele Bassi
850dd5a38f tests: Print the device name, as well as its Id
The test-devices interactive test should display the device name along
with the id.
2010-01-20 00:38:09 +00:00
Emmanuele Bassi
68b47e3ed4 tests: Fix test-events output
• The enter/leave event line should take into account the case where
  the related field is set to NULL (meaning entering from off-stage
  and leaving the stage).

• The ButtonRelease line shows the click count but uses the button; the
  button *and* the click count should be displayed for both ButtonPress
  and ButtonRelease, to verify they match.
2010-01-20 00:38:08 +00:00
Emmanuele Bassi
75f05646fa tests: Clean up test-events
The output of test-events is a bit of a mess; this patch should clean
it up a little bit - at least enough for it to be useful again during
visual inspection.
2010-01-20 00:38:08 +00:00
Emmanuele Bassi
d5331bfb57 tests: Update the devices test
Use the DeviceManager API instead of the X11 specific API.
2010-01-20 00:38:08 +00:00
Neil Roberts
1ef40b8823 test-cogl-npot-texture: Use the COGL_TEXTURE_NO_ATLAS flag
If the texture is put in the atlas it won't be sliced whatever size it
is so it negates the test. We can avoid this with the NO_ATLAS flag.
2010-01-19 17:15:51 +00:00
Neil Roberts
ff1d9cf090 test-texture-fbo: Disconnect the paint handler for the stage
Otherwise the paint handler will still be run for the subsequent
tests. This ends up writing to the ‘state’ variable which used to be
on the stack so it will end up corrupting some stack variable. This
was causing test-cogl-premult to fail.
2010-01-18 12:42:46 +00:00
Neil Roberts
36f18e5ac5 cogl: Make CoglSubTexture only work for quad rendering
The sub texture backend doesn't work well as a completely general
texture backend because for example when rendering with cogl_polygon
it needs to be able to tranform arbitrary texture coordinates without
reference to the other coordintes. This can't be done when the texture
coordinates are a multiple of one because sometimes the coordinate
should represent the left or top edge and sometimes it should
represent the bottom or top edge. For example if the s coordinates are
0 and 1 then 1 represents the right edge but if they are 1 and 2 then
1 represents the left edge.

Instead the sub-textures are now documented not to support coordinates
outside the range [0,1]. The coordinates for the sub-region are now
represented as integers as this helps avoid rounding issues. The
region can no longer be a super-region of the texture as this
simplifies the code quite a lot.

There are two new texture virtual functions:

transform_quad_coords_to_gl - This transforms two pairs of coordinates
     representing a quad. It will return FALSE if the coordinates can
     not be transformed. The sub texture backend uses this to detect
     coordinates that require repeating which causes cogl-primitives
     to use manual repeating.

ensure_non_quad_rendering - This is used in cogl_polygon and
     cogl_vertex_buffer to inform the texture backend that
     transform_quad_to_gl is going to be used. The atlas backend
     migrates the texture out of the atlas when it hits this.
2010-01-18 09:22:04 +00:00
Neil Roberts
ead4399536 Merge branch 'master' into more-texture-backends 2010-01-15 12:15:46 +00:00
Neil Roberts
a70ebe4f52 tests: Add a simple conformance test for texture mipmaps
This adds a test which renders a texture into a 1x1 pixel quad with
and without filters that use mipmaps. The pixel without mipmaps will
be one of the colors from the texture and the one with will be the
average of all the pixels in the texture.
2010-01-15 12:05:19 +00:00