Commit Graph

744 Commits

Author SHA1 Message Date
Emmanuele Bassi
7d1445afca Restore the report on the conformance test suite
The report generation was broken by the split of the various test units;
also, we were using GTest in a way that's not really sanctioned by
upstream.

This commit tries to re-use the targets from GLib's Makefile rules while
compensating for our own set up.
2010-07-07 14:52:19 +01:00
Robert Bragg
551945ce6c 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.
2010-07-07 14:07:22 +01:00
Robert Bragg
b24c96189d tests: no longer clean up state between tests
Since we now run every test in a separate process there is no need to
try and avoid state leakage between tests. This removes the code to
cleanup all children of the stage and disconnect handlers from the
stage paint signal. We now explicitly print a warning if the users tries
to run multiple tests in one process.
2010-07-07 14:07:17 +01:00
Øyvind Kolås
5cb4e0c5d0 test-state: fix test for state count after state removal
In the .json file used for the test, there is no null -> "base"
transition defined only a "clicked" -> "base", when the "clicked" state
is removed the "base" state will also disappear.
2010-07-06 14:28:14 +01:00
Øyvind Kolås
6d1f697bc4 state: automatically remove unused states
When there is no further keys with a state as the target state, remove
the state (and all transitions that used this state as a target)
2010-07-06 14:14:34 +01:00
Damien Lespiau
1860d45087 build: Allow to run the tests from any directory
I was fed up to cd into the tests/conform or tests/interactive directories
to launch a specific test. Now, with the power the abs_ variants of
builddir and srcdir we can run specific test from any directory.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2159
2010-07-06 12:39:15 +01:00
Robert Bragg
82ba7220af pixel-array: Allow passing of hints to cogl_buffer_map
This allows you to tell Cogl that you are planning to replace all the
buffer's data once it is mapped with cogl_buffer_map. This means if the
buffer is currently being accessed by the GPU then the driver doesn't
have to stall and wait for it to finish before it can access it from the
CPU and can instead potentially allocate a new buffer with undefined
data and map that.
2010-07-06 12:07:28 +01:00
Robert Bragg
0273b13d75 test-cogl-pixel-array: fix how data is initialized
There was a missing '* 4' and '* i' in the for() loops that initialized
the first test buffer, so it was containing uninitialized data causing
the test to fail.
2010-07-06 12:07:28 +01:00
Emmanuele Bassi
da4dbbb926 Add binaries of the Cally examples to the ignore file 2010-07-05 16:45:43 +01:00
Alejandro Piñeiro
e110b35694 Avoid to load cally module on a11y examples
As cally is being integrated on clutter is not required to load
cally module anymore. Anyway, it is still required to load
the atk bridge by hand. The current way to load it could change
in the future, more information here:

https://bugzilla.gnome.org/show_bug.cgi?id=612599
https://bugzilla.gnome.org/show_bug.cgi?id=619946

Part [4/4] of CB#2099
2010-07-05 16:45:43 +01:00
Alejandro Piñeiro
790d2165f3 Add accessibility tests
http://bugzilla.clutter-project.org/show_bug.cgi?id=2099

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-07-05 16:45:43 +01:00
Emmanuele Bassi
b9c65510cb Update conformance Git ignore file 2010-07-05 16:45:19 +01:00
Robert Bragg
ae43fe9968 conform: don't reference old test_cogl_pixel_buffer symbol
Since CoglPixelBuffer was renamed to CoglPixelArray the test entry point
was also renamed to test_cogl_pixel_array, but mistakenly the
corresponding test-conform-main.c change wasn't pushed at the same time.
2010-07-05 16:19:35 +01:00
Robert Bragg
8a5aed36fe pixel-array: Only allow allocation of arrays with a 2D size
This removes cogl_pixel_array_new which just took a size in bytes.

Without the image size and pixel format then the driver often doesn't
have enough information to allocate optimal GPU memory that can be
textured from directly. This is because GPUs often have ways to
spatially alter the layout of a texture to improve cache access patterns
which may require special alignment and padding dependant in the images
width, height and bpp.

Although currently we are limited by OpenGL because it doesn't let us
pass on the width and height when allocating a PBO, the hope is that we
can define a better extension at some point.
2010-07-05 15:20:04 +01:00
Robert Bragg
54f4a3a752 rename CoglPixelBuffer to CoglPixelArray
This renames CoglPixelBuffer to CoglPixelArray to be consistent with the
new CoglVertexArray API.
2010-07-05 15:20:04 +01:00
Robert Bragg
57341dbb60 cogl-buffer: make the COGL_BUFFER_USAGE_HINT private
The usage hint should be implied by the CoglBuffer subclass type so the
public getter and setter APIs for manually changing the usage hint of a
CoglBuffer have now been removed.
2010-07-05 15:20:04 +01:00
Øyvind Kolås
38941372bf state: rename property "target-state" to "state"
This reduces the amount of typing, and should provide for more readable
code for most uses of ClutterState.
2010-07-02 17:41:33 +01:00
Neil Roberts
6341ba98f9 test-cogl-path: Add tests for changing the fill rule
This creates a path with an outer clockwise and two internal sub
paths, one clockwise and one counter-clockwise. The path is then
painted twice, once with each fill rule.
2010-06-29 20:37:14 +01:00
Emmanuele Bassi
32ad63efef bind-constraint: Add width and height binding
Allow using the BindConstraint to bind width and height of a source
actor.

Also, add a test for the BindConstraint showing all types of usages
for this constraint class.
2010-06-28 18:06:23 +01:00
Emmanuele Bassi
98613382a4 test-text-field: Use the system font instead of using Sans 2010-06-25 11:44:53 +01:00
Neil Roberts
fbeab37828 test-conformance: Use -export-dynamic instead of -rdynamic
The -rdynamic linker option is specific to ELF so it was breaking
builds on systems with other object formats such as Windows and
Solaris. This patch replaces that option with -export-dynamic which is
a portable libtool option which should do the right thing on each
platform.

http://bugzilla.clutter-project.org/show_bug.cgi?id=1930
2010-06-24 17:46:29 +01:00
Øyvind Kolås
2a29cd2aee state: removed special handling of state named "default"
The "default" state used for unspecified source transitions is NULL.
Small update and some other fixes to documentation.
2010-06-24 15:49:01 +01:00
Emmanuele Bassi
e9fa68fbdd Add test-cogl-texture-pixmap-x11 to the ignore file 2010-06-22 14:05:39 +01:00
Emmanuele Bassi
c2b8a0272b conform: Do not use deprecated API in test-clutter-units
Setting the DPI is done through the ClutterSettings:font-dpi property.
2010-06-22 13:32:11 +01:00
Neil Roberts
05b6c283eb Add a test case for CoglTexturePixmapX11 2010-06-22 12:22:48 +01:00
Neil Roberts
d42c3069d1 test-pixmap: Use the 'm' key to toggle texture quality
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.
2010-06-22 12:22:48 +01:00
Neil Roberts
c5b5a88d6d test-pixmap: Draw something more interesting when the mouse is clicked
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.
2010-06-22 12:22:48 +01:00
Neil Roberts
02de8b9ad5 test-pixmap: Add a --disable-animation option
Sometimes the animation makes debugging awkward so this patch adds a
--disable-animation option to simplify the test.
2010-06-22 12:22:48 +01:00
Neil Roberts
75f48ad0ec test-pixmap: Enable automatic updates for the hand
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.
2010-06-22 12:22:48 +01:00
Neil Roberts
f7dfc8caa4 test-pixmap: Implement the --disable-x11 option
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.
2010-06-22 12:22:48 +01:00
Robert Bragg
a871ac669f test-shader: guard GLES2 specific changes with COGL_HAS_GLES2
Previously we were using an internal only HAVE_COGL_GLES2 define to
guard GLES 2 specific changes so for instance the precision modifiers
weren't being emitted in the shader source.

http://bugzilla.o-hand.com/show_bug.cgi?id=2178
2010-06-22 11:35:29 +01:00
Robert Bragg
bf9d5f3949 build: distinguish CLUTTER_WINSYS and CLUTTER_SONAME_INFIX
This adds a separate variable name "CLUTTER_SONAME_INFIX" to define the
infix for the clutter library that gets linked. Currently the WINSYS
corresponds to the directory we enter when building to compile the
window system and input support, but it is desirable to be able to
define multiple flavours that use the same WINSYS but should result in
different library names.

For example we are planning to combine the eglx and eglnative window
systems into one "egl" winsys but we will need to preserve the current
library names for the eglx and eglnative flavours.
2010-06-18 17:38:40 +01:00
Emmanuele Bassi
0411ba7d32 actor: Parse actions, constraints and effects members
ClutterActor should allow attaching actions, constraints and effects
just like it allows behaviours, e.g.:

  {
    ...
    "constraints" : [
      {
        "type" : "ClutterAlignConstraint",
        "source" : "stage",
        "align-axis" : "x-axis",
        "factor" : 0.5
      },
      {
        "type" : "ClutterAlignConstraint",
        "source" : "stage",
        "align-axis" : "y-axis",
        "factor" : 0.5
      }
    ],
    ...
  }

or:

  {
    ...
    "actions" : [
      {
        "type" : "ClutterDragAction",
        "signals" : [
          { "name" : "drag-end", "handler" : "on_drag_end" }
        ]
      }
    ],
    ...
  }

In order to do so, we use the Scriptable interface implementation and
add three new custom properties accepting an array; then we parse each
member of the array as a new object.
2010-06-17 17:35:00 +01:00
Emmanuele Bassi
2d99f77e3b cairo-texture: Disable :sync-size
The :sync-size property of ClutterTexture should be set to FALSE by
default by ClutterCairoTexture. The preferred size of the
ClutterCairoTexture is already the size of the internal Cairo surface,
and we override the preferred width/height getters to that effect.

The :sync-size property is also responsible of changing the size of
the Texture actor when changing the texture handle - but since we
encourage that to happen during the CairoTexture allocation, we get a
queue_relayout() invocation (and a warning) when we change the size
of the Cairo image surface.

Since GObject doesn't make it easy to override the default value of the
:sync-size property in sub-classes, we should simply call the setter
function during the ClutterCairoTexture instance initialization.

We should also change one of the interactive tests using a CairoTexture
to rebuild the contents of the actor in response to an allocation.
2010-06-16 13:58:41 +01:00
Emmanuele Bassi
5382e8722b Split out the ignored test files 2010-06-15 16:53:41 +01:00
Robert Bragg
c434f1fc48 material: Make CoglMaterial responsible for depth state
This redirects the legacy depth testing APIs through CoglMaterial and
adds a new experimental cogl_material_ API for handling the depth
testing state.

This adds the following new functions:
cogl_material_set_depth_test_enabled
cogl_material_get_depth_test_enabled
cogl_material_set_depth_writing_enabled
cogl_material_get_depth_writing_enabled
cogl_material_set_depth_test_function
cogl_material_get_depth_test_function
cogl_material_set_depth_range
cogl_material_get_depth_range

As with other experimental Cogl API you need to define
COGL_ENABLE_EXPERIMENTAL_API to access them and their stability isn't
yet guaranteed.
2010-06-15 15:26:28 +01:00
Øyvind Kolås
66de8656e9 test-state: move press/release callbacks to stage avoiding grab 2010-06-14 15:49:20 +01:00
Emmanuele Bassi
f97d16cd2d drag-action: Remove the press event button
Both ::drag-begin and ::drag-end have a "button" argument - even though
we assume internally, and externally, that dragging can only be the
result of a primary button operation.
2010-06-12 17:45:54 +01:00
Emmanuele Bassi
44f300b3a2 effect: Add PageTurnEffect
A simple deformation effect that simulates a page curl.

Ported from MxDeformPageTurn inside the Mx toolkit, written by
Chris Lord.
2010-06-10 18:40:29 +01:00
Robert Bragg
4f0a4b8521 test-cogl-tex-foreign: save and restore GL state correctly
This test breaks out into raw OpenGL to create a foreign texture so it
needs to be careful not to trample on any state that may be cached by
Cogl internally.
2010-06-09 15:19:31 +01:00
Robert Bragg
3907825d05 test-cogl-texture-rectangle: save restore GL state correctly
This test breaks out into raw OpenGL to create a RECTANGLE texture so it
needs to be careful not to trample on any state that may be cached by
Cogl internally.
2010-06-09 15:19:31 +01:00
Neil Roberts
037f7a29d1 test-cogl-texture-rectangle: Fix the size allocated for reading data
The test was only allocating enough space for 256 rows of pixels but
it was then reading 384 so it would randomly fail.
2010-06-09 12:19:55 +01:00
Emmanuele Bassi
00675f42aa texture-async: Fix path fallback code
And error out in case of load failure.
2010-06-08 11:19:28 +01:00
Emmanuele Bassi
4c22f122e1 script: Support layout manager properties
Layout properties work similarly to child properties, with the added
headache that they require the 3-tuple:

  ( layout manager, container, actor )

to be valid in order to be inspected, parsed and applied. This means
using the newly added back-pointer from the container to the layout
manager and then rejigging a bit how the ScriptParser handles the
unresolved properties.

Similarly to the child properties, which use the "child::" prefix, the
layout manager properties use the "layout::" prefix and are defined with
the child of a container holding a layout manager.
2010-06-07 22:45:34 +01:00
Emmanuele Bassi
8583986e16 blur-effect: Fix loop unrolling
The box blur shader was not sampling all the points for producing the
desired effect.
2010-06-07 15:45:24 +01:00
Robert Bragg
457faaffb7 conform: Adds a test-cogl-object conformance test
This tests the new cogl_object_get/set_user_data API
2010-06-04 14:44:15 +01:00
Robert Bragg
eca2634050 cogl-path: Renames cogl_path_get/set cogl_get/set_path
These aren't path methods so aren't consistent with the
cogl_object_method naming style we are aiming for.
2010-06-04 14:44:15 +01:00
Emmanuele Bassi
781a413362 test-drag: Add desaturation effect
Use a desaturation effect on the drag handle.
2010-06-04 10:16:51 +01:00
Emmanuele Bassi
aef2f805a6 effects: Fix stacking of offscreen-based effects
Stacking multiple effects sub-classing ClutterOffscreenEffect requires
a small fix in the code that computes the screen coordinates of the
actor to position the FBO correctly with regards to the stage.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
8ef4d9fe21 actor: Add "effects" to the animatable metas
Since ClutterEffect is an ActorMeta it should be possible to animate the
properties of named effects using the @effects syntax, just like it
happens for actions and constraints.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
73a773d37a effect: Add DesaturateEffect
A simple shader-based effect that desaturates an actor and its contents
based on a controllable factor.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
a86f1b45bb Add the ClutterEffect abstract class
ClutterEffect is an abstract class that should be used to apply effects
on generic actors.

The ClutterEffect class just defines what an effect should implement; it
could be defined as an interface, but we might want to add some default
behavior dependent on the internal state at a later point.

The effect API applies to any actor, so we need to provide a way to
assign an effect to an actor, and let ClutterActor call the Effect
methods during the paint sequence.

Once an effect is attached to an actor we will perform the paint in this
order:

  • Effect::pre_paint()
  • Actor::paint signal emission
  • Effect::post_paint()

Since an effect might collide with the Shader class, we either allow a
shader or an effect for the time being.
2010-06-03 14:10:55 +01:00
Damien Lespiau
3161e92818 analysis: Make all function declarations be protoypes
It's valid C to declare a function omitting it prototype, but it seems
to be a good practise to always declare a function with its
corresponding prototype.
2010-06-01 12:08:18 +01:00
Damien Lespiau
83b7801e49 analysis: Fix the "key-press-event" callback signature
We were returning FALSE in a function declared as returning a gpointer.
Turns out that the function should return a gboolea instead.
2010-06-01 12:08:18 +01:00
Damien Lespiau
ec59af290c analysis: None used in pointer context
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.
2010-06-01 12:08:18 +01:00
Robert Bragg
589c8d9579 [texture] Support picking textures according to their alpha channel
This adds a boolean "pick-with-alpha" property to ClutterTexture and when
true, it will use the textures alpha channel to define the actors shape when
picking.

Users should be aware that it's a bit more expensive to pick textures like
this (so probably best not to blindly enable it on *all* your textures)
since it implies rasterizing the texture during picking whereas we would
otherwise just send a solid filled quad to the GPU.  It will also interrupt
the internal batching of geometry for pick renders which can otherwise often
be done in a single draw call.
2010-05-28 16:07:17 +01:00
Emmanuele Bassi
dfe6eb1e51 test-scrolling: Use a better looking bounce easing 2010-05-27 16:33:01 +01:00
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