Commit Graph

5567 Commits

Author SHA1 Message Date
Neil Roberts
dc61d58c0d cogl-pipeline-opengl: Remove the includes for the various backends
Nothing in cogl-pipeline-opengl needs to know about the actual backend
implementations, instead it just accesses then through the vtables.
2010-12-13 17:22:56 +00:00
Emmanuele Bassi
54db48dfd1 animation: Allow transforming values in bind()
While we do check for compatibility and transformability of a GValue
with the GParamSpec value type, we are actually failing really badly
at it.

First of all, we bail out on the wrong conditions.

Then we use the type of the value passed instead of using the type
of the property itself.

This makes it impossible to actually use transformation functions for
GValue types - even those that have been registered by GLib itself -
when using the Animation API directly, instead of going through the
clutter_actor_animate() wrappers.
2010-12-11 17:43:23 +00:00
Emmanuele Bassi
ae4e06d8c4 introspection: Skip some C-only structures
The ParamSpec sub-classes we define are meant to be used only from the C
API, as high-level languages completely ignore them.

The ClutterStageWindow interface is an internal type that escaped into
the public headers; all its methods are private, but we cannot remove
the type until we break for 2.0.
2010-12-10 17:15:39 +00:00
Emmanuele Bassi
d5a4183047 introspection: Add cairo-1.0 to the dependencies 2010-12-10 17:15:23 +00:00
Emmanuele Bassi
49a43a0772 Remove unnecessary duplicate name for private enumerations 2010-12-10 16:03:10 +00:00
Emmanuele Bassi
b91c1ec21c docs: Update NEWS 2010-12-09 16:05:55 +00:00
Emmanuele Bassi
bc58de4658 docs: Add 1.6 index to the API references 2010-12-09 15:53:26 +00:00
Emmanuele Bassi
36c3fc82c5 Use G_STRFUNC correctly
It cannot be chained up via the pre-processor.
2010-12-09 15:42:19 +00:00
Emmanuele Bassi
24133ddadc Rename the EGLDisplay accessors
The accessor for the EGL display should be namespaced for the correct
backend-specific API.
2010-12-09 15:34:22 +00:00
Emmanuele Bassi
f5b51a2428 docs: Documentation fixes 2010-12-09 15:06:12 +00:00
Emmanuele Bassi
ab0eb0a12b docs: Documentation fixes 2010-12-09 13:59:08 +00:00
Emmanuele Bassi
8c7298b0c1 build: Check NEWS file during release, not distcheck
The check-news option in configure.ac conflicts with the idea of using a
buildbot to do a distcheck.

Since we're doing some validation on the state of the build during the
release-check phase we should add the NEWS file check there.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2468
2010-12-09 13:49:01 +00:00
Elliot Smith
88f7579a9d cookbook: Remove bold on emphasis inside programlisting
If an <emphasis> element is placed inside a <programlisting> in a cookbook
recipe, the result is bold italic text in the HTML output. This isn't
particularly readable.

Fix is to style emphasis elements inside programlistings
so the font weight is not bold but is still italicised.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2475
2010-12-09 13:39:48 +00:00
Jussi Kukkonen
ca42ec1a7a tests: Add test for clutter_model_get_iter_at_row()
http://bugzilla.clutter-project.org/show_bug.cgi?id=2460
2010-12-09 13:38:35 +00:00
Jussi Kukkonen
d8515bf429 Fix clutter_list_model_get_iter_at_row() when filtered
Currently clutter_list_model_get_iter_at_row() always returns an
iterator to the last non-filtered row  when asking for row [1-N].

Patch makes the function return an iterator to the Nth non-filtered
row or NULL.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2460
2010-12-09 13:38:35 +00:00
nobled
e7f62bc936 wayland: Update to current api
Adapt to changes from these wayland commits:
35fd2a8cc68c42d90756330535de04cbbb4d2613
2bb3ebe1e437acf836449f0a63f3264ad29566f2
f8fc08f77187f6a5723281dab66841e5f3c24320

http://bugzilla.clutter-project.org/show_bug.cgi?id=2474
2010-12-09 13:32:49 +00:00
nobled
d8a544c0f1 wayland: fix typo
Fixes the build error:

clutter-input-device-wayland.c:154:69:
error: too few arguments to function call

http://bugzilla.clutter-project.org/show_bug.cgi?id=2473
2010-12-09 13:32:41 +00:00
Emmanuele Bassi
3795c9b975 build: Do not hardcode --warn-all for g-ir-scanner
It's possible to use --warn-all through the introspection scanner
options from outside the build environment.
2010-12-09 12:37:41 +00:00
Emmanuele Bassi
d229036441 Reduce the amount of g-ir-scanner warnings
As much as we can; the remaining warnings are mostly valid things that
the introspection scanner still flags as potential issues.
2010-12-09 12:36:50 +00:00
Emmanuele Bassi
e1f48b15ee docs: Use :reverse in the Behaviour migration guide
Instead of the ::completed signal flip.
2010-12-09 12:00:29 +00:00
Emmanuele Bassi
b16ea09988 Merge remote branch 'elliot/cookbook-animations-looping-new-api'
* elliot/cookbook-animations-looping-new-api:
  cookbook: Use new API to reverse timeline
2010-12-09 11:58:10 +00:00
Tomeu Vizoso
b6318bd821 Make clutter_shader_effect_set_uniform_value accept G_TYPE_DOUBLE
For users of gobject-introspection that cannot know which
non-integer type to pass.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2471
2010-12-09 11:57:06 +00:00
Robert Bragg
cf1fced885 pipeline: don't dereference NULL program state
This avoid dereferencing a NULL arbfp program state in
_cogl_pipeline_backend_arbfp_layer_pre_change_notify for
_STATE_COMBINE_CONSTANT changes.
2010-12-08 18:57:42 +00:00
Robert Bragg
46295a0dd1 arbfp: Copy pipelines used as cache keys
We are currently using a pipeline as a key into our arbfp program cache
but because we weren't making a copy of the pipelines used as keys there
were times when doing a lookup in the cache would end up trying to
compare a lookup key with an entry key that would point to invalid
memory.

Note: the current approach isn't ideal from the pov that that key
pipeline may reference some arbitrarily large user textures will now be
kept alive indefinitely. The plan to improve on this is that we will
have a mechanism to create a special "key pipeline" which will derive
from the default Cogl pipeline (to avoid affecting the lifetime of
other pipelines) and only copy state from the original pipeline that
affects the arbfp program and will reference small dummy textures
instead of potentially large user textures.
2010-12-08 18:35:03 +00:00
Robert Bragg
87b2300f98 arbfp: initialize arbfp_program_state->next_constant_id
When allocating a new ArbfpProgramState struct when starting code
generation we weren't initializing arbfp_program_state->next_constant_id
to 0.
2010-12-08 18:35:02 +00:00
Robert Bragg
bac600b21b pipeline: Clarify stages for finding an arbfp program
In the arbfp backend there is a seqential approach to finding a suitable
arbfp program to use for a given pipeline; first we see if there's
already a program associated with the pipeline, 2nd we try and find a
program associated with the "arbfp-authority" 3rd we try and lookup a
program in a cache and finally we resort to starting code-generation for
a new program. This patch slightly reworks the code of these steps to
hopefully make them a bit clearer.
2010-12-08 18:35:02 +00:00
Neil Roberts
9606c42c55 cogl-pipeline: Fix the layer_has_alpha_cb
_cogl_pipeline_needs_blending_enabled tries to determine whether each
layer is using the default combine state. However it was using
argument 0 for both checks so the if-statement would never be true.
2010-12-08 18:35:02 +00:00
Robert Bragg
ab5f394e5a pipeline: remove unused HashState member
There was an unused pipeline_differences member as part of the HashState
struct which this patch remove to avoid confusion.
2010-12-08 18:35:02 +00:00
Robert Bragg
5fd8e9c608 pipeline: initialize HashState flags member
There are a set of "EvalFlags" that get passed to _cogl_pipeline_hash
that can tweak the semantics of what state is evaluated for hashing but
these flags weren't getting passed via the HashState state structure
so it would be undefined if you would get the correct semantics.
2010-12-08 18:35:02 +00:00
Robert Bragg
ea66156c83 pipeline: don't use near/far symbols
According to 9cc9033347 the windows headers #define near as nothing,
and presumable the same is true for 'far' too. Apparently this define is
to improve compatibility with code written for Windows 3.1, so it's good
that people will be able to incorporate such code into their Clutter
applications.
2010-12-08 18:35:01 +00:00
Emmanuele Bassi
acd3d61568 docs: Fix listitem tag 2010-12-08 14:26:27 +00:00
Emmanuele Bassi
c454526bbb docs: Clean up clutter_color_from_string()
Add hsl() and hsla() formats, and clean up the wording.
2010-12-08 14:03:02 +00:00
Neil Roberts
ca7dc2f951 cogl-backend-egl: Chain up to the X11 backend init_events
Since c6493885c3 when building the EGL backend for eglx there was
no fallback in the init_events implementation so the X11 backend init
function would never get called. This was stopping it from receiving
any X events so a lot of things broke. It now just chains up.
2010-12-07 23:32:47 +00:00
Damien Lespiau
b0751d2342 input-device: Downgrade over-zealous warning to note
This warning is really harmless, we just discard the event anyway, let's
demote it to a CLUTTER_NOTE() so event backend implementers can see it.
2010-12-07 22:32:56 +00:00
Neil Roberts
f8fc194b3b clutter-score: Initialize ClutterScoreEntry::complete_id
When clutter_score_append_at_marker is called instead of
clutter_score_append the complete_id field of ClutterScoreEntry was
being left uninitialised. When the entry is eventually freed it would
sometimes try to disconnect an invalid signal id. This was causing
conformance test failures for me on GLES2.
2010-12-07 21:44:32 +00:00
Robert Bragg
9d836d8ce5 context: only declare arbfp cache for GL
We were trying to declare and initializing an arbfp program cache for
GLES but since the prototypes for the _hash and _equal functions were
only available for GL this broke the GLES builds. By #ifdefing the code
to conditionally declare/initialize for GL only this should hopefully
fix GLES builds.
2010-12-07 16:47:02 +00:00
Robert Bragg
67c2a1b29f pipeline: remove spurious use of True instead of TRUE
The constant 'True' is defined by Xlib which isn't used for all clutter
builds so this replaces occurrences of True with TRUE which is defined
by glib. This should hopefully fix the win32 builds.
2010-12-07 16:36:44 +00:00
Robert Bragg
464ed7e6b7 arbfp: Adds an ARBfp program cache
This adds a cache (A GHashTable) of ARBfp programs and before ever
starting to code-generate a new program we will always first try and
find an existing program in the cache. This uses _cogl_pipeline_hash and
_cogl_pipeline_equal to hash and compare the keys for the cache.

There is a new COGL_DEBUG=disable-program-caches option that can disable
the cache for debugging purposes.
2010-12-07 16:00:32 +00:00
Robert Bragg
e87c3820ee pipeline: Implements _cogl_pipeline_hash function
This allows us to get a hash for a set of state groups for a given
pipeline. This can be used for example to get a hash of the fragment
processing state of a pipeline so we can implement a cache for compiled
arbfp/glsl programs.
2010-12-07 16:00:32 +00:00
Robert Bragg
cc36e49ec5 pipeline: generalize _cogl_pipeline_equal
_cogl_pipeline_equal now accepts a mask of pipeline differences and layer
differences to constrain what state will be compared. In addition a set
of flags are passed that can tweak the comparison semantics for some
state groups. For example when comparing layer textures we sometimes
only need to compare the texture target and can ignore the data itself.

In updating the code this patch also changes it so all required pipeline
authorities are resolved in one step up-front instead of resolving the
authority for each state group in turn and repeatedly having to traverse
the pipeline's ancestry. This adds two new functions
_cogl_pipeline_resolve_authorities and
_cogl_pipeline_layer_resolve_authorities to handle resolving a set of
authorities.
2010-12-07 16:00:32 +00:00
Robert Bragg
62b051951c docs: don't dist cogl-2.0 manual if not built
If not configured with --enable-cogl2-reference then don't try and dist
the doc/references/cogl-2.0 manual. Although this means a tarball built
this way will not be able to build the experimental cogl-2.0 manual this
isn't considered a big problem since anyone interested in this would
hopefully be tracking git for now or we can simply be careful to
configure with --enable-cogl2-reference for our tarball releases.
2010-12-07 12:16:51 +00:00
Robert Bragg
ff646b7fc3 pipeline: remove layer->backend_priv[] array
This removes the unused array of per-packend priv data pointers
associated with every CoglPipelineLayer. This reduces the size of all
layer allocations and avoids having to zero an array for each
_cogl_pipeline_layer_copy.
2010-12-07 12:16:51 +00:00
Robert Bragg
1180fd159e cogl-object: remove un-used cogl_object_get_type
A non-static function named cogl_object_get_type was inadvertently added
during the addition of the CoglObject base type, but there is no public
prototype in the headers and it's only referenced inside cogl-object.c
to implement cogl_handle_get_type() for compatibility. This removes the
function since we don't want to commit to CoglObject always simply being
a boxed type. In the future we may want to register hierarchical
GTypeInstance based types.
2010-12-07 12:16:50 +00:00
Robert Bragg
ef02cb7ff2 matrix gtype: registers a boxed type for CoglMatrix
To allow us to have gobject properties that accept a CoglMatrix value we
need to register a GType. This adds a cogl_gtype_matrix_get_type function
that will register a static boxed type called "CoglMatrix".

This adds a new section to the reference manual for GType integration
functions.
2010-12-07 12:16:50 +00:00
Robert Bragg
c29a7526c0 matrix: Adds matrix_copy and _free functions
As a pre-requisite for being able to register a boxed GType for
CoglMatrix (enabling us to define gobject properties that accept a
CoglMatrix) this adds cogl_matrix_copy and _free functions.
2010-12-07 12:16:50 +00:00
Robert Bragg
3edd02841b pipeline simple optimization for _needs_blending_enabled
In _cogl_pipeline_needs_blending_enabled after first checking whether
the property most recently changed requires blending we would then
resort to checking all other properties too in case some other state
also requires blending. We now avoid checking all other properties in
the case that blending was previously disabled and checking the property
recently changed doesn't require blending.

Note: the plan is to improve this further by explicitly keeping track
of the properties that currently cause blending to be enabled so that we
never have to resort to checking all other properties we can constrain
the checks to those masked properties.
2010-12-03 17:16:58 +00:00
Robert Bragg
9ff191bd3b pipeline: inline _get_parent and _get_authority
This moves _cogl_pipeline_get_parent and _cogl_pipeline_get_authority
into cogl-pipeline-private.h so they can be inlined since they have been
seen to get quite high in profiles. Given that they both contain such
small amounts of code the function call overhead is significant.
2010-12-03 17:16:58 +00:00
Neil Roberts
3fa91efea8 Add a COGL_DEBUG option to disable software clipping
This adds a debug option called disable-software-clipping which causes
the journal to always log the clip stack state rather than trying to
manually clip rectangles.
2010-12-03 17:16:58 +00:00
Neil Roberts
62c893feee cogl-journal: Attempt to clip manually to avoid breaking up batches
Before flushing the journal there is now a separate iteration that
will try to determine if the matrix of the clip stack and the matrix
of the rectangle in each entry are on the same plane. If they are it
can completely avoid the clip stack and instead manually modify the
vertex and texture coordinates to implement the clip. The has the
advantage that it won't break up batching if a single clipped
rectangle is used in a scene.

The software clip is only used if there is no user program and no
texture matrices. There is a threshold to the size of the batch where
it is assumed that it is worth the cost to break up a batch and
program the GPU to do the clipping. Currently this is set to 8
although this figure is plucked out of thin air.

To check whether the two matrices are on the same plane it tries to
determine if one of the matrices is just a simple translation of the
other. In the process of this it also works out what the translation
would be. These values can be used to translate the clip rectangle
into the coordinate space of the rectangle to be logged. Then we can
do the clip directly in the rectangle's coordinate space.
2010-12-03 17:16:58 +00:00
Neil Roberts
be63fcee7f cogl-clip-stack: Move the struct definitions to the header
It will be useful to be able to directly examine the contents of the
clip stack within the journal code.
2010-12-03 17:16:58 +00:00