Commit Graph

6700 Commits

Author SHA1 Message Date
Emmanuele Bassi
66d46fd55e Deprecate clutter_get_timestamp()
This function should have never been made public in the first place; its
output depends on a configuration option of Clutter, and it's basically
useful only for internal debugging.
2011-11-15 17:47:00 +00:00
Emmanuele Bassi
59f395d856 Rework debug output
Make it consistent across the various build options (with or without
profiling enabled), and add a timestamp using the monotonic clock to
every debug message.
2011-11-15 17:39:49 +00:00
Emmanuele Bassi
c6e487a5c1 Remove CLUTTER_TIMESTAMP debug macro
It's pretty much unused, and it doesn't print out really informative
messages. We should make CLUTTER_NOTE print out a decent timestamp
instead.
2011-11-15 16:07:13 +00:00
Emmanuele Bassi
8b2df7ced9 Remove the GTimer used by clutter_get_timestamp()
Use g_get_monotonic_time() instead, which does the right thing.
2011-11-15 15:34:51 +00:00
Emmanuele Bassi
f63891f030 texture: Do not use clutter_get_timestamp()
The clutter_get_timestamp() output depends on whether Clutter was
compiled with debugging support — it's meant to be used only by the
debugging notes, and it should not be used for anything else.
2011-11-15 14:59:50 +00:00
Neil Roberts
58b6ad787b deform-effect: Use CoglPipeline instead of setting legacy state
Instead of calling cogl_set_depth_test_enabled and
cogl_set_backface_culling_enabled ClutterDeformEffect now uses the
experimental CoglPipeline API. Those global state functions will soon
be deprecated in Cogl and they are implemented by flushing a temporary
override pipline which isn't ideal.

Using the new culling API we can also avoid having a separate buffer
of indices for the back of the texture by just changing the culling
mode to cull front baces instead of the back.

https://bugzilla.gnome.org/show_bug.cgi?id=663636
2011-11-15 11:15:00 +00:00
Neil Roberts
8a752d674b deform-effect: Use CoglPrimitives instead of CoglVertexBuffers
This changes ClutterDeformEffect to use a CoglAttributeBuffer with a
CoglPrimitive instead of the old CoglVertexBuffer. The old vertex
buffer code is now implemented in terms of the attribute buffer code
and it will eventually be deprecated. Using CoglPrimitives should be
slightly more efficient.

This also changes the struct we store the vertices to be
CoglVertexP3T2C4 instead of CoglTextureVertex. The latter is
technically not compatible with neither vertex buffers nor attribute
buffers because it contains a CoglColor and the internal members of
that are private so it is not valid to assume it contains 4 bytes and
use that as an attribute. Also it contains padding so it ends up
redundantly creating a larger buffer. CoglTextureVertex is in the
public API for the deform_vertex virtual so we still have to maintain
that. Instead of directly manipulating the array to upload, the
application is now passed a stack allocated temporary struct which
gets converted to a CoglVertexP3T2C4. This also means that we can map
the buffer as write only and still let the application read-write the
vertex.

The paint debug code to draw line strips for the deform mesh was
previously trying to set a red source material. However this wasn't
working because the material color was being overwritten by the color
attribute in the vertex buffer. This patch fixes that by creating a
seperate primitive for the lines and not adding the color
attribute. The lines code was also drawing both the front and back
indices. I don't think that entirely makes sense so I've just changed
it to draw only the front indices. Maybe painting both would make more
sense if backface culling was still enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=663636
2011-11-15 11:14:59 +00:00
Emmanuele Bassi
b281f2090a Store the master clock pointer in the main context
Let's try and move all singletons into ClutterMainContext.
2011-11-14 17:16:27 +00:00
Emmanuele Bassi
f1ebfe30ce stage-manager: Store the stage manager into the main context
Use the main context to store the stage manager singleton, instead of a
static pointer inside clutter-stage-manager.c.
2011-11-14 15:43:20 +00:00
Lionel Landwerlin
e7720c4156 deform-effect: do not redraw actor on invalidate
When invalidating the deform effect, we are invalidating the vertices
shaping the deformation of an actor. Therefore, there is no need to
trigger a redraw of the associated actor, we can just repaint the
effect.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=663720
2011-11-14 12:01:07 +00:00
Emmanuele Bassi
b5ac927763 stage: Clean up
Improve the consistency of the code.
2011-11-14 11:46:02 +00:00
Emmanuele Bassi
b2d1dfa932 stage: Deprecate clutter_stage_queue_redraw()
It's a wrapper around clutter_actor_queue_redraw().
2011-11-14 11:45:14 +00:00
Emmanuele Bassi
f5d011cb67 Merge branch 'deprecate-default-stage'
* deprecate-default-stage:
  evdev: do not associate device with stage
  evdev: don't even process events without a default stage
  docs: Note default stage deprecation in README
  docs: Remove clutter_stage_get_default()
  stage: Deprecate the default stage
  script: Do not use clutter_stage_get_default()
  cally/actor: Do not use the default stage as a fallback
  Try to mop up the default stage mess
  performance/*: Do not use clutter_stage_get_default()
  interactive/*: Do not use clutter_stage_get_default()
  Merge with a11y
  micro-bench/*: Do not use clutter_stage_get_default()
  accessibility/*: Do not use clutter_stage_get_default()
  conform/*: Do not use clutter_stage_get_default()
2011-11-14 11:07:54 +00:00
Chun-wei Fan
bbe54aa2ec Fix clutter-bakend-win32.c
The VBLANK environmental variable is done universally in clutter-main.c
as in commits e8562089 (main: Add a sync-to-vblank global flag) and
db211a21 (Remove per-backend CLUTTER_VBLANK envvar), so remove these things
here as well.

https://bugzilla.gnome.org/show_bug.cgi?id=663999
2011-11-14 11:06:28 +00:00
Fran Diéguez
65a07db5c0 Updated Galician translations 2011-11-13 18:52:21 +01:00
Daniel Mustieles
a0c9d294b0 Updated Spanish translation 2011-11-11 18:16:06 +01:00
Piotr Drąg
028b716f33 Updated POTFILES.in 2011-11-10 19:54:53 +01:00
Rico Tzschichholz
6d4f105ab2 po: update POTFILES.in 2011-11-10 19:05:39 +01:00
Rico Tzschichholz
b12a94dc27 docs: fix some headers paths 2011-11-10 19:05:39 +01:00
Emmanuele Bassi
821ccef555 build: Disable evdev input by default
It's an experimental input backend, so it should be enabled explicitly.
2011-11-10 17:59:17 +00:00
Lionel Landwerlin
213e6e4a16 evdev: do not associate device with stage
Their might not be any stage at that time, so this avoids to create a
default one.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=651718
2011-11-10 15:41:41 +00:00
Lionel Landwerlin
5705d08b5d evdev: don't even process events without a default stage
The evdev system is a bit different from other input systems in
Clutter because it's completly decorrelated from anything graphic.

In the case of embedded devices with no proper windowing system, you
might want to not implicitly create a default stage when you're
receiving the first input event.

This patch changes this behavior by not forwarding any event if you
don't have a default stage.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=651718
2011-11-10 15:39:16 +00:00
Emmanuele Bassi
b38773f458 docs: Note default stage deprecation in README
Mention the behaviour of Clutter when creating more than one stage on
platforms that only support one stage instance.
2011-11-10 15:38:14 +00:00
Emmanuele Bassi
26aa4b5290 docs: Remove clutter_stage_get_default()
A lot of the example code in the cookbook and the API reference still
uses the default stage — sometimes as if it were a non-default one,
which once again demonstrates how the default stage was a flawed concept
that just confused people.
2011-11-10 15:37:51 +00:00
Emmanuele Bassi
0c18dc6bf9 stage: Deprecate the default stage
Deprecate the clutter_stage_get_default() function, as well as the
clutter_stage_is_default() one, and replace its internal usage.
2011-11-10 15:37:51 +00:00
Emmanuele Bassi
2288d708e2 script: Do not use clutter_stage_get_default()
It's about to go away, so we should use the StageManager API instead.
2011-11-10 15:37:51 +00:00
Emmanuele Bassi
b1ccd262b1 cally/actor: Do not use the default stage as a fallback
Using the default stage as a fallback is wrong in all circumstances.

In this specific case, if an actor is not associated to a stage then it
cannot possibly be the key focus.
2011-11-10 15:37:51 +00:00
Emmanuele Bassi
26f4467392 Try to mop up the default stage mess
The default stage was a neat concept when we started Clutter out,
somewhere in the Jurassic era; a singleton instance that gets created at
initialization time, and remains the same for the entire duration of the
process.

Worked well enough when Clutter was a small library meant to be used to
write fullscreen media browsers, but since the introduction of multiple
stages, and Clutter being used to create all sorts of applications, the
default stage is just a vestigial remainder of that past, like an
appendix; something that complicates the layout of the code and
introduces weird behaviour, so that you notice its existence only when
something goes wrong.

Some platforms we do support, though, only have one framebuffer, so it
makes sense for them to have only one stage.

At this point, the only sane thing to do is to go through the same code
paths on all platforms, and that code path is the stage instance
creation and initialization — i.e. clutter_stage_new() (or
g_object_new() with CLUTTER_TYPE_STAGE).

For platforms that support multiple stages, nothing has changed: the stage
created by clutter_stage_get_default() will be set as the default one;
if nobody calls it, the default stage is never created, and it just
lives on as a meaningless check.

For platforms that only support one stage, clutter_stage_new() and
clutter_stage_get_default() will behave exactly the same the first time
they are called: both will create a stage, and set it as the default.
Calling clutter_stage_new() a second time is treated as a programmer
error, and will result in Clutter aborting. This is a behavioural change
because the existing behaviour or creating a new ClutterStage instance
with the same ClutterStageWindow private implementation is, simply put,
utterly braindamaged and I should have *never* had written it, and I
apologize for it. In my defence, I didn't know any better at the time.

This is the first step towards the complete deprecation of
clutter_stage_get_default() and clutter_stage_is_default(), which will
come later.
2011-11-10 15:37:51 +00:00
Emmanuele Bassi
5903fcc36d performance/*: Do not use clutter_stage_get_default() 2011-11-10 15:37:51 +00:00
Emmanuele Bassi
7c180a0742 interactive/*: Do not use clutter_stage_get_default() 2011-11-10 15:37:50 +00:00
Emmanuele Bassi
6ed879b84c Merge with a11y 2011-11-10 15:37:50 +00:00
Emmanuele Bassi
93eb0bfe32 micro-bench/*: Do not use clutter_stage_get_default() 2011-11-10 15:37:50 +00:00
Emmanuele Bassi
a5522b707e accessibility/*: Do not use clutter_stage_get_default() 2011-11-10 15:37:50 +00:00
Emmanuele Bassi
deba576dd1 conform/*: Do not use clutter_stage_get_default()
Use the correct stage creation/destruction API.
2011-11-10 15:37:50 +00:00
Emmanuele Bassi
89644ae048 docs: Update the release notes in the README 2011-11-10 14:55:04 +00:00
Emmanuele Bassi
6d68ac2e8b osx: Clean up the backend implementation
Instead of implementing create_stage() and a constructor for
ClutterStageOSX, we can use the default implementations in
ClutterBackend, and spare us some code duplication.
2011-11-10 14:55:04 +00:00
Emmanuele Bassi
88b27beea4 wayland/backend: Remove create_stage()
The create_stage() implementation in ClutterBackendWayland isn't doing
anything special, so we can fall back to the default one.
2011-11-10 14:55:04 +00:00
Emmanuele Bassi
7472c07c41 build: Clean up the configuration summary
List the input backends, and remove the EGL backend options.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
17c89bd0a0 backend: Clean up the device manager creation
Create the device manager during the event initialization, where it
makes sense.

This allows us to get rid of the per-backend get_device_manager()
virtual function, and just store the DeviceManager pointer into the
ClutterBackend structure.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
cd1e8da07f */backend: Clean up the stage creation
Use the default implementation of create_stage() wherever possible.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
828ca2982f backend: Provide a default create_stage()
We can now safely create a ClutterStageWindow in the shared code path,
instead of deferring to the backend.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
9c038ebefb stage-window: Add :backend and :wrapper properties
All StageWindow implementation already have back pointers, but we need a
unified API to actually set them from the generic code path; we can use
properties on the StageWindow interface — though this requires fixing
all backends at the same time, to avoid GObject complaining.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
f3c89e82b3 gdk/backend: Fix an invalid chain up 2011-11-10 14:55:03 +00:00
Emmanuele Bassi
b980d2dc17 */backend: Store the StageWindow implementation type 2011-11-10 14:55:03 +00:00
Emmanuele Bassi
6082be409e backend: Store the type of the StageWindow implementation
We can use it later on to create it and provide a default create_stage()
implementation.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
04a2b5f42b egl/backend: Clean up
The "EGL native" backend is just a short-hand for a pure Cogl backend,
using whatever input mechanism was enabled at run-time.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
89e26497de Add a CEx100-specific backend
Instead of piggybacking on the EGL backend, let's create a small
ClutterBackend for the CEx100 platforms. This allows us to handle the
CEx100-specific details in a much cleaner way.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
5c9cafb411 cogl/backend: Remove the ClutterBackendCogl class
All the functionality that ClutterBackendCogl provided has been moved
into ClutterBackend itself, so there is no need to have this class
around in the source.

Cogl-based backends can derive directly from ClutterBackend.
2011-11-10 14:55:03 +00:00
Emmanuele Bassi
5ac0cf1c28 cogl/backend: Remove pre/post_parse
The CLUTTER_VBLANK environment variable is now handled in the common
code path.
2011-11-10 14:55:02 +00:00
Emmanuele Bassi
db211a2131 Remove per-backend CLUTTER_VBLANK envvar
We have a global flag we can use.
2011-11-10 14:55:02 +00:00