profile/ivi/clutter.git
15 years ago[clutter-texture] Unref the Cogl material on dispose
Neil Roberts [Thu, 5 Feb 2009 18:27:04 +0000 (18:27 +0000)]
[clutter-texture] Unref the Cogl material on dispose

The material is created in the _init function and is owned by the
ClutterTexture so it will be leaked if not freed.

15 years ago[clutter-texture] Release the temporary ref taken when setting a texture
Neil Roberts [Thu, 5 Feb 2009 18:26:08 +0000 (18:26 +0000)]
[clutter-texture] Release the temporary ref taken when setting a texture

When setting the cogl texture, the ClutterTexture takes a reference to
the Cogl handle but the material takes an additional reference when it
is set as the layer. Nothing was unrefing the temporary reference so
the textures were being leaked.

15 years ago[clutter-clone] Override the parent opacity to self not self->parent
Neil Roberts [Wed, 4 Feb 2009 00:14:16 +0000 (00:14 +0000)]
[clutter-clone] Override the parent opacity to self not self->parent

The opacity of the source actor when painted from the clone should be
combined with the opacity of the clone as well as the clone's parents,
instead of just the parents.

15 years ago[cogl-gles2-wrapper] Remove the FIXME to adjust the fragment color
Neil Roberts [Mon, 2 Feb 2009 22:02:47 +0000 (22:02 +0000)]
[cogl-gles2-wrapper] Remove the FIXME to adjust the fragment color

Removed some debugging code which sets the r and g values to 1 in the
fragment shader.

15 years ago[cogl-texture] Fix the count for the number of enabled arrays
Neil Roberts [Mon, 2 Feb 2009 22:01:47 +0000 (22:01 +0000)]
[cogl-texture] Fix the count for the number of enabled arrays

The quad drawing code keeps track of the number of texture units that
have the tex coord array enabled so that in the next call it can
disabled any that are no longer enabled. However it was using 'i+1' as
the count but 'i' is already set to 'n_layers' from the previous for
loop.

Therefore it was disabling an extra texture unit. This doesn't
normally matter but it was causing GLES 2 to pointlessly realize an
extra unit.

15 years agoFix building GLES 2 after the material branch merge
Neil Roberts [Thu, 29 Jan 2009 13:40:37 +0000 (13:40 +0000)]
Fix building GLES 2 after the material branch merge

- In cogl-material.h it directly sets the values of the
  CoglMaterialLayerCombineFunc to some GL_* constants. However these
  aren't defined in GLES 2 beacuse it has no fixed function texture
  combining. Instead the CGL_* versions are now used. cogl-defines.h
  now sets these to either the GL_* version if it is available,
  otherwise it directly uses the number.

- Under GLES 2 cogl-material.c needs to access the CoglTexture struct
  so it needs to include cogl-texture-private.h

- There are now #define's in cogl-gles2-wrapper.h to remap the GL
  function names to the wrapper names. These are disabled in
  cogl-gles2-wrapper.c by defining COGL_GLES2_WRAPPER_NO_REMAP.

- Added missing wrappers for glLoadMatrixf and glMaterialfv.

- Renamed the TexEnvf wrapper to TexEnvi because the latter is used
  instead from the material API.

15 years ago[cogl-material] Always bind the new texture handle
Neil Roberts [Mon, 2 Feb 2009 14:51:52 +0000 (14:51 +0000)]
[cogl-material] Always bind the new texture handle

Cogl previously tried to cache the currently bound texture when
drawing through the material API to avoid excessive GL calls. However,
a few other places in Cogl and Clutter rebind the texture as well so
this can cause problems.

This was causing shaped windows to fail in Mutter because
ClutterGLXTexturePixmap was binding a different texture to update it
while the second texture unit was still active which meant the mask
texture would not be selected when the shaped window was drawn
subsequent times.

Ideally we would fix this by providing a wrapper around glBindTexture
which would affect the cached value. The cache would also have to be
cleared if a selected texture was deleted.

15 years ago[text] Use create_pango_layout()
Emmanuele Bassi [Mon, 2 Feb 2009 12:04:34 +0000 (12:04 +0000)]
[text] Use create_pango_layout()

Since we added clutter_actor_get_pango_layout() it would be a
good idea to use it in the ClutterText actor to cut down the
PangoContext-related calls.

15 years ago[clone] Allow cloning unparented actors
Emmanuele Bassi [Mon, 2 Feb 2009 11:59:39 +0000 (11:59 +0000)]
[clone] Allow cloning unparented actors

If the source of a ClutterClone does not have a parent actor the
clone will be unable to paint it because it's missing an allocation.

A simple way to fix it is to make the ClutterClone act like a
"foster parent": when it is allocated it will check if the source
actor has a parent and if not it will allocate the source with
its preferred size.

15 years ago[docs] Add clutter_text_set_markup()
Emmanuele Bassi [Mon, 2 Feb 2009 11:08:37 +0000 (11:08 +0000)]
[docs] Add clutter_text_set_markup()

The clutter_text_set_markup() has been added to the public API, and
should be listed in the ClutterText section of the API reference.

15 years agoAdd Actor::create_pango_layout()
Emmanuele Bassi [Mon, 2 Feb 2009 09:01:41 +0000 (09:01 +0000)]
Add Actor::create_pango_layout()

Final bit of integration between ClutterActor and Pango: a simple
method for creating a PangoLayout, pre-filled with text and ready
to be rendered using cogl_pango_render_layout().

This should make writing new Actors rendering custom text in their
paint() implementation easy and reliable.

15 years ago[tests] Update the text-field interactive test
Emmanuele Bassi [Thu, 29 Jan 2009 13:29:43 +0000 (13:29 +0000)]
[tests] Update the text-field interactive test

We should also display the results of calling set_markup() or
set_use_markup() on ClutterText actors.

15 years ago[text] Merge the attributes with markup enabled
Emmanuele Bassi [Thu, 29 Jan 2009 13:18:57 +0000 (13:18 +0000)]
[text] Merge the attributes with markup enabled

ClutterText should merge the PangoAttributes set by using
clutter_text_set_attributes() with the attributes generated by
parsing Pango markup.

For this to work we must parse the markup and merge the attributes
we get out of pango_parse_markup() with the attributes set by
the user.

Setting the markup or the attributes on an editable text should
not work for the time being.

15 years agoFix clutter_x11_texture_pixmap_get/set_property() following change of PROP_WINDOW...
Tomas Frydrych [Thu, 29 Jan 2009 12:25:18 +0000 (12:25 +0000)]
Fix clutter_x11_texture_pixmap_get/set_property() following change of PROP_WINDOW type.
  PROP_WINDOW is now gulong, so we need to use appropriate GValue accessors.

15 years agoFixed handling of enter and leave events in clutter_x11_handle_event()
Tomas Frydrych [Tue, 27 Jan 2009 16:37:55 +0000 (16:37 +0000)]
Fixed handling of enter and leave events in clutter_x11_handle_event()
  When processing a motion event, we need to spin the event loop two extra
  times to ensure that any enter/leave events that might have been synthesized
  are pumped through (otherwise they end up being pushed down the queue and
  never processed).

15 years agoPost-release bump to 0.9.1
Emmanuele Bassi [Fri, 30 Jan 2009 14:18:46 +0000 (14:18 +0000)]
Post-release bump to 0.9.1

15 years agoUpdate README
Emmanuele Bassi [Fri, 30 Jan 2009 12:39:29 +0000 (12:39 +0000)]
Update README

15 years agoSome updates for the 1.0 release notes regarding Cogl
Robert Bragg [Thu, 29 Jan 2009 16:24:24 +0000 (16:24 +0000)]
Some updates for the 1.0 release notes regarding Cogl

Documents that the cogl_rectangle arguments changed from x1, y1, width, height
to x1, y1, x2, y2; notes that cogl_scale now accepts a z-scale; adds a note
about the new vertex buffer API and fixes a s/CoglMesh/CoglMatrix/ typo.

15 years ago[build] Fix distcheck of ChangeLog
Emmanuele Bassi [Thu, 29 Jan 2009 16:15:05 +0000 (16:15 +0000)]
[build] Fix distcheck of ChangeLog

Relax the copy failure condition.

15 years agoAdd cogl-material-private.h to the source files
Emmanuele Bassi [Thu, 29 Jan 2009 16:00:15 +0000 (16:00 +0000)]
Add cogl-material-private.h to the source files

The material-private.h file was not added to the dist files and
caused a build failure.

15 years ago[gitignore] Update ignore file
Emmanuele Bassi [Thu, 29 Jan 2009 15:44:11 +0000 (15:44 +0000)]
[gitignore] Update ignore file

15 years ago[build] Add automatic ChangeLog generation on dist
Emmanuele Bassi [Thu, 29 Jan 2009 15:38:28 +0000 (15:38 +0000)]
[build] Add automatic ChangeLog generation on dist

Since we moved to Git from Subversion we've abandoned the ChangeLog
file in favour of a more detailed commit log.

In order to maintain a ChangeLog for users of the tarballs, we need
to generate a ChangeLog file out of the commit log when distchecking
a Clutter release.

For this reason, we use a simple Perl script that is invoked by the
dist-hook and generates a ChangeLog file starting from the previous
stable release.

15 years agoFix a variable masking warning
Emmanuele Bassi [Thu, 29 Jan 2009 13:31:11 +0000 (13:31 +0000)]
Fix a variable masking warning

The usual issue with math.h defined symbols.

15 years agoMove the old ChangeLog into its own file
Emmanuele Bassi [Wed, 28 Jan 2009 17:01:26 +0000 (17:01 +0000)]
Move the old ChangeLog into its own file

The old ChangeLog is there to track the project history when it
was in SVN -- also because the commit messages we imported from
Subversion were not that great.

Unfortunately, we need a ChangeLog for autotools to work in
GNU mode; for this reason, we can use a dummy ChangeLog redirecting
to git log.

The ChangeLog will be generated on release from the commit
messages, for users of the tarballs.

15 years ago[cogl] Add an NULL terminator to the call to material_flush_gl_state
Neil Roberts [Thu, 29 Jan 2009 12:21:56 +0000 (12:21 +0000)]
[cogl] Add an NULL terminator to the call to material_flush_gl_state

This fixes a compiler warning and a potential crash.

15 years agoAnother Cogl gl vs gles normalizaion pass
Robert Bragg [Wed, 28 Jan 2009 14:09:51 +0000 (14:09 +0000)]
Another Cogl gl vs gles normalizaion pass

This tries to make a number of files more comparable with the intention of
moving some code into cogl/common/

Files normalized:
 cogl.c
 cogl-context.c
 cogl-context.h
 cogl-texture.c

15 years agoRemoves cogl_color_set_from_4d as it may mislead people.
Robert Bragg [Tue, 27 Jan 2009 11:07:22 +0000 (11:07 +0000)]
Removes cogl_color_set_from_4d as it may mislead people.

Someone not sure which cogl_color_set_from_* version is "best" may use
set_from_4d because taking doubles implies higher precision. Currently
it doesn't have any advantage.

15 years agoChanges cogl_rectangle to take x1, y1, x2, y2 args not x1, y1, width, height
Robert Bragg [Wed, 28 Jan 2009 14:47:03 +0000 (14:47 +0000)]
Changes cogl_rectangle to take x1, y1, x2, y2 args not x1, y1, width, height

This makes it consistent with cogl_rectangle_with_{multi,}texture_coords.
Notably the reason cogl_rectangle_with_{multi,}texture_coords wasn't changed
instead is that the former approach lets you describe back facing rectangles.
(though technically you could pass negative width/height values to achieve
 this; it doesn't seem as neat.)

15 years agoAdds some debug code to _cogl_journal_flush_quad_batch
Robert Bragg [Wed, 28 Jan 2009 13:46:39 +0000 (13:46 +0000)]
Adds some debug code to _cogl_journal_flush_quad_batch

The code is #if 0 guarded, but when uncommented it outlines all drawn
rectangles with an un-blended red, green or blue border. This may e.g. help
with debugging texture slicing issues or blending issues, plus it looks quite
cool.

15 years ago[clutter-docs] Update the animation tutorial
Emmanuele Bassi [Wed, 28 Jan 2009 16:44:22 +0000 (16:44 +0000)]
[clutter-docs] Update the animation tutorial

The Alpha API and usage has been changed by the recent overhaul
of the ClutterAlpha class; hence, we need to update the relative
documentation in the animation tutorial.

15 years ago[cogl-docs] Add the Materials section
Emmanuele Bassi [Wed, 28 Jan 2009 16:43:05 +0000 (16:43 +0000)]
[cogl-docs] Add the Materials section

The COGL Materials API was not linked from the COGL reference
index.

15 years agoUpdate the pkg-config requires list
Emmanuele Bassi [Wed, 28 Jan 2009 15:19:24 +0000 (15:19 +0000)]
Update the pkg-config requires list

Clutter depends on various libraries, some of them backend-specific
like the X11 libraries.

Whenever possible, we should add those requirements to the pkg-config
file. For this reason, we have a variable inside the configure.ac
template file which should be filled with the backend-specific modules
we check for during configure time, and then added to the standard
list of dependencies that we write inside the clutter.pc file.

15 years agoUndeprecate clutter_actor_set_scale_with_gravity
Neil Roberts [Wed, 28 Jan 2009 16:24:02 +0000 (16:24 +0000)]
Undeprecate clutter_actor_set_scale_with_gravity

The scale center has returned so this function is available again but
it was still deprecated so you couldn't use it.

15 years agoMerge branch 'scale-center'
Neil Roberts [Wed, 28 Jan 2009 09:08:19 +0000 (09:08 +0000)]
Merge branch 'scale-center'

Bug 1349 - Using the anchor point to set the scale center is messy

The branch adds an extra center point for scaling which can be used
for example to set a scale about the center without affecting the
position of the actor.

The scale center can be specified as a unit offset from the origin or
as a gravity. If specified as a gravity it will be stored as a
fraction of the actor's size so that the position will track when the
actor changes size.

The anchor point and rotation centers have been modified so they can
be set with a gravity in the same way. However, only the Z rotation
exposes a property to set using a gravity because the other two
require a Z coordinate which doesn't make sense to interpret as a
fraction of the actor's width or height.

Conflicts:

clutter/clutter-actor.c

15 years ago[clutter-actor] Use G_STMT_START/END instead of do { } while (0)
Neil Roberts [Wed, 28 Jan 2009 15:25:38 +0000 (15:25 +0000)]
[clutter-actor] Use G_STMT_START/END instead of do { } while (0)

In the TRANSFORM_ABOUT_ANCHOR_COORD macro it now uses G_STMT_START and
G_STMT_END instead of directly using do/while because it's more
readable.

15 years agoUpdate NEWS file
Emmanuele Bassi [Wed, 28 Jan 2009 14:36:45 +0000 (14:36 +0000)]
Update NEWS file

15 years agoUpdate the release notes for 1.0
Emmanuele Bassi [Wed, 28 Jan 2009 14:07:23 +0000 (14:07 +0000)]
Update the release notes for 1.0

Add items about the ClutterBehaviourBspline and ClutterEffect
API removals.

15 years ago[cogl-texture] Fix order of tex coords when compensating for waste
Neil Roberts [Wed, 28 Jan 2009 12:57:06 +0000 (12:57 +0000)]
[cogl-texture] Fix order of tex coords when compensating for waste

When drawing a texture with waste in _cogl_multitexture_unsliced_quad
it scales the texture coordinates so that the waste is not
included. However the formula was the wrong way around so it was
calculating as if the texture coordinates are ordered x1,x2,y1,y2 but
it is actually x1,y1,x2,y2.

15 years ago[text-backface-culling] Fix width/height parameters to cogl_rectangle
Neil Roberts [Wed, 28 Jan 2009 12:06:39 +0000 (12:06 +0000)]
[text-backface-culling] Fix width/height parameters to cogl_rectangle

During the upgrade to cogl material, test-backface-culling was
switched to use cogl_rectangle instead of cogl_texture_rectangle to
draw the textures. However, cogl_rectangle takes a width and height
instead of the the top-left and bottom-right vertices so the
rectangles were being drawn in the wrong place.

15 years ago[cogl-texture] Reset size of vertex log after drawing a polygon
Neil Roberts [Wed, 28 Jan 2009 12:00:01 +0000 (12:00 +0000)]
[cogl-texture] Reset size of vertex log after drawing a polygon

Otherwise trying to render a rectangle after a polygon doesn't work
because it expects the array to be empty when it starts logging
vertices.

15 years agoFix rectangles_with_multitexture_coords for sliced without tex coords
Neil Roberts [Wed, 28 Jan 2009 11:29:49 +0000 (11:29 +0000)]
Fix rectangles_with_multitexture_coords for sliced without tex coords

When the texture is sliced it drops back to a fallback function and
passes it the texture coordinates from the rectangle. However if no
tex coords are given it would crash. Now it passes the default
0.0->1.0 tex coords instead.

15 years agoFix _cogl_texture_unsliced_quad when no texture coordinates are given
Neil Roberts [Wed, 28 Jan 2009 11:09:47 +0000 (11:09 +0000)]
Fix _cogl_texture_unsliced_quad when no texture coordinates are given

If no texture coordinates are given then texture_unsliced_quad tries
to generate its own coordinates. However it also tries to read the
texture coordinates to check if they are in [0.0,1.0] range so it will
crash before it reaches that.

15 years agoReuse the layers list
Emmanuele Bassi [Wed, 28 Jan 2009 11:56:12 +0000 (11:56 +0000)]
Reuse the layers list

Instead of getting the layers list twice from the Material, we
can reuse the list when we need to retrieve the first layer.

15 years agoRemove gtk-doc annotation
Emmanuele Bassi [Wed, 28 Jan 2009 11:55:19 +0000 (11:55 +0000)]
Remove gtk-doc annotation

The _cogl_material_flush_layers_gl_state() function is static,
so it should not have a gtk-doc annotation.

15 years agoFix typo in the :clone getter method
Emmanuele Bassi [Tue, 27 Jan 2009 20:06:58 +0000 (20:06 +0000)]
Fix typo in the :clone getter method

The :clone property getter method, clutter_clone_get_source(), was
defined using the wrong name of clutter_clone_get_clone_source().

15 years agoUpdate the release notes for 1.0
Emmanuele Bassi [Tue, 27 Jan 2009 17:44:49 +0000 (17:44 +0000)]
Update the release notes for 1.0

Add entries for the removal of:

  - ClutterLabel
  - ClutterEntry
  - ClutterCloneTexture

15 years agoFix building GLES after _cogl_texture_handle_from_pointer got removed
Neil Roberts [Wed, 28 Jan 2009 10:52:55 +0000 (10:52 +0000)]
Fix building GLES after _cogl_texture_handle_from_pointer got removed

Commit a688b1db removed the function and replaced it with a direct
cast. This was also being used in the GL ES so the build broke.

15 years agoDirectly set backend font options in clutter_set_font_flags
Neil Roberts [Tue, 27 Jan 2009 16:55:25 +0000 (16:55 +0000)]
Directly set backend font options in clutter_set_font_flags

Instead of having a separate set of font options that override the
backend options when clutter_set_font_flags is called, it now just
directly sets the backend font options. So now the font flags are just
a convenience wrapper around the backend font options.

This also makes the ClutterText labels automatically update when the
font flags are changed because they will respond to the 'font-changed'
signal from the backend.

15 years agoListen for the font-changed signal on the backend in ClutterText
Neil Roberts [Tue, 27 Jan 2009 16:47:20 +0000 (16:47 +0000)]
Listen for the font-changed signal on the backend in ClutterText

Whenever a ClutterText is created it now connects to the font-changed
signal. When it is emitted the layout cache is dirtied and a relayout
is queued. That way changes to the font options or resolution will
cause an immediate update to the labels in the scene.

15 years ago[docs] Documentation fixes
Emmanuele Bassi [Tue, 27 Jan 2009 16:53:01 +0000 (16:53 +0000)]
[docs] Documentation fixes

Update the COGL API reference to avoid a lot of warnings coming
from gtk-doc.

15 years ago[docs] Update Clutter API reference symbols
Emmanuele Bassi [Tue, 27 Jan 2009 16:41:51 +0000 (16:41 +0000)]
[docs] Update Clutter API reference symbols

Add the new symbols from the ClutterClone and COGL material API
to the API reference.

15 years agoRemoved unused conditional
Emmanuele Bassi [Tue, 27 Jan 2009 16:40:51 +0000 (16:40 +0000)]
Removed unused conditional

USE_COGL_MATERIAL is a left-over from the development branch.

15 years agoMerge branch 'generic-actor-clone'
Emmanuele Bassi [Tue, 27 Jan 2009 16:12:30 +0000 (16:12 +0000)]
Merge branch 'generic-actor-clone'

* generic-actor-clone:
  Remove CloneTexture from the API
  [tests] Clean up the Clone interactive test
  Rename ActorClone to Clone/2
  Rename ActorClone to Clone/1
  Improves the unit test to verify more awkward scaling and some corresponding fixes
  Implements a generic ClutterActorClone that doesn't need fbos.

15 years agoFallout from cogl-material merge
Emmanuele Bassi [Tue, 27 Jan 2009 16:02:04 +0000 (16:02 +0000)]
Fallout from cogl-material merge

When enabling the maintainer CFLAGS the compiler got very angry
at the code that has been merged.

15 years agoAdds padding to CoglColor to future proof it a bit
Robert Bragg [Tue, 27 Jan 2009 11:01:23 +0000 (11:01 +0000)]
Adds padding to CoglColor to future proof it a bit

This adds enough padding to allow us to change to an internal float storage
for the color components if needs be in the future.

15 years agoSupport scaling on the z axis with cogl_scale
Robert Bragg [Mon, 26 Jan 2009 22:52:38 +0000 (22:52 +0000)]
Support scaling on the z axis with cogl_scale

This simply adds a z argument to cogl_scale and updates clutter-actor.c
to pass 1.0 for the z scale.

15 years agoMerge branch 'cogl-material'
Robert Bragg [Tue, 27 Jan 2009 15:19:34 +0000 (15:19 +0000)]
Merge branch 'cogl-material'

Conflicts:

clutter/cogl/gl/cogl-texture.c
clutter/cogl/gles/cogl-primitives.c

* cogl-material:
 clutter-{clone-,}texture weren't updating their material opacity.
 Updates GLES1 support for CoglMaterial
 Normalizes gl vs gles code in preperation for synching material changes
 Removes cogl_blend_func and cogl_alpha_func
 Fully integrates CoglMaterial throughout the rest of Cogl
 [cogl-material] Restore the GL_TEXTURE_ENV_MODE after material_rectangle
 [cogl-material] Make the user_tex_coords parameter of _rectangle const
 [test-cogl-material] Remove return value from material_rectangle_paint
 Add cogl-material.h and cogl-matrix.h to libclutterinclude_HEADERS
 [cogl-material] improvements for cogl_material_rectangle
 [cogl-material] Adds a cogl_material_set_color function
 [cogl-material] Some improvements for how we sync CoglMaterial state with OpenGL
 [cogl-material] Converts clutter-texture/clutter-clone-texture to the material API
 [doc] Hooks up cogl-material reference documentation
 Updates previous GLES multi-texturing code to use CoglMaterial
 Adds a CoglMaterial abstraction, which includes support for multi-texturing
 [doc] Hooks up cogl-matrix reference documentation
 Adds CoglMatrix utility code
 [tests] Adds an interactive unit test for multi-texturing
 [multi-texturing] This adds a new cogl_multi_texture API for GL,GLES1 + GLES2

15 years agoRemove CloneTexture from the API
Emmanuele Bassi [Tue, 27 Jan 2009 15:18:45 +0000 (15:18 +0000)]
Remove CloneTexture from the API

ClutterClone supercedes ClutterCloneTexture, since it can clone
every kind of actor -- including composite ones.

This is another "brain surgery with a shotgun" kind of commit: it
removes CloneTexture and updates every test case using CloneTexture
to ClutterClone. The API fallout is minimal, luckily for us.

15 years agoRemoves test-simple from tests/interactive/Makefile.am
Robert Bragg [Tue, 27 Jan 2009 15:17:16 +0000 (15:17 +0000)]
Removes test-simple from tests/interactive/Makefile.am

The addition was accidental

15 years agoReplace clutter_set_use_mipmapped_text with clutter_set_font_flags
Neil Roberts [Tue, 27 Jan 2009 14:25:50 +0000 (14:25 +0000)]
Replace clutter_set_use_mipmapped_text with clutter_set_font_flags

The hope is that this function makes it easier to extend the font
settings with more flags without having to add a function for every
setting.

A new flag for enabling hinting has been added. If set, this changes
the font options on the global PangoContext and any newly created
PangoContexts. The options are only set if the flag is changed from
the default so it won't override any detailed setting chosen by the
backend.

15 years ago[tests] Clean up the Clone interactive test
Emmanuele Bassi [Tue, 27 Jan 2009 14:36:12 +0000 (14:36 +0000)]
[tests] Clean up the Clone interactive test

Do not assume the default stage, and store more data inside the
"application" structure that gets passed around instead of relying
on macros.

15 years agoclutter-{clone-,}texture weren't updating their material opacity.
Robert Bragg [Mon, 26 Jan 2009 15:25:55 +0000 (15:25 +0000)]
clutter-{clone-,}texture weren't updating their material opacity.

cogl_set_source_color4ub was previously used to set a transparent
white source color according to the actors opacity, but since
cogl_set_source_color now always implies you want a solid fill we
we use cogl_material_set_color4ub to achieve the same result.

15 years agoUpdates GLES1 support for CoglMaterial
Robert Bragg [Mon, 26 Jan 2009 11:07:35 +0000 (11:07 +0000)]
Updates GLES1 support for CoglMaterial

This updates cogl/gles in line with the integration of CoglMaterial throughout
Cogl that has been done for cogl/gl.

Note: This is still buggy, but at least it builds again and test-actors works.
Some GLES2 specific changes were made, but these haven't been tested yet.

15 years agoNormalizes gl vs gles code in preperation for synching material changes
Robert Bragg [Sat, 24 Jan 2009 16:55:04 +0000 (16:55 +0000)]
Normalizes gl vs gles code in preperation for synching material changes

This changes all GLES code to use the OpenGL function names instead of
the cogl_wrap_* names. For GLES2 we now define the OpenGL name to point
to the wrapper, as opposed to defining the wrapper to point to the
OpenGL name for GLES1.

I've also done a quick pass through gl/cogl.c and gles/cogl.c to make
them more easily comparable. (most of the code is now identical)

15 years agoRemoves cogl_blend_func and cogl_alpha_func
Robert Bragg [Sat, 24 Jan 2009 15:09:43 +0000 (15:09 +0000)]
Removes cogl_blend_func and cogl_alpha_func

The GL blend function and alpha function are now controlled by the material
code, and even internally Cogl should now be using the material API when
it needs control of these.

15 years agoFully integrates CoglMaterial throughout the rest of Cogl
Robert Bragg [Fri, 23 Jan 2009 16:15:40 +0000 (16:15 +0000)]
Fully integrates CoglMaterial throughout the rest of Cogl

This glues CoglMaterial in as the fundamental way that Cogl describes how to
fill in geometry.

It adds cogl_set_source (), which is used to set the material which will be
used by all subsequent drawing functions

It adds cogl_set_source_texture as a convenience for setting up a default
material with a single texture layer, and cogl_set_source_color is now also
a convenience for setting up a material with a solid fill.

"drawing functions" include, cogl_rectangle, cogl_texture_rectangle,
cogl_texture_multiple_rectangles, cogl_texture_polygon (though the
cogl_texture_* funcs have been renamed; see below for details),
cogl_path_fill/stroke and cogl_vertex_buffer_draw*.

cogl_texture_rectangle, cogl_texture_multiple_rectangles and
cogl_texture_polygon no longer take a texture handle; instead the current
source material is referenced. The functions have also been renamed to:
cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords
and cogl_polygon respectivly.

Most code that previously did:
  cogl_texture_rectangle (tex_handle, x, y,...);
needs to be changed to now do:
  cogl_set_source_texture (tex_handle);
  cogl_rectangle_with_texture_coords (x, y,....);

In the less likely case where you were blending your source texture with a color
like:
  cogl_set_source_color4ub (r,g,b,a); /* where r,g,b,a isn't just white */
  cogl_texture_rectangle (tex_handle, x, y,...);
you will need your own material to do that:
  mat = cogl_material_new ();
  cogl_material_set_color4ub (r,g,b,a);
  cogl_material_set_layer (mat, 0, tex_handle));
  cogl_set_source_material (mat);

Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use
cog_rectangle_with_texure_coords since these are the coordinates that
cogl_rectangle will use.

For cogl_texture_polygon; as well as dropping the texture handle, the
n_vertices and vertices arguments were transposed for consistency. So
code previously written as:
  cogl_texture_polygon (tex_handle, 3, verts, TRUE);
need to be written as:
  cogl_set_source_texture (tex_handle);
  cogl_polygon (verts, 3, TRUE);

All of the unit tests have been updated to now use the material API and
test-cogl-material has been renamed to test-cogl-multitexture since any
textured quad is now technically a test of CoglMaterial but this test
specifically creates a material with multiple texture layers.

Note: The GLES backend has not been updated yet; that will be done in a
following commit.

15 years agoRename ActorClone to Clone/2
Emmanuele Bassi [Mon, 26 Jan 2009 11:03:12 +0000 (11:03 +0000)]
Rename ActorClone to Clone/2

Step two: rename the object and its methods.

While we're at it, adhere more strictly to the coding style
practises; rename :clone-source to :source; add a setter method
for the :source property; take a reference on the source actor
to avoid it disappearing while we're still accessing it.

15 years ago[tests] Remove an unused variable
Emmanuele Bassi [Tue, 27 Jan 2009 13:22:47 +0000 (13:22 +0000)]
[tests] Remove an unused variable

This fixes a compiler warning.

15 years agoBug 1388 - Clarify signal emission for advance_to_marker()
Emmanuele Bassi [Tue, 27 Jan 2009 11:25:06 +0000 (11:25 +0000)]
Bug 1388 - Clarify signal emission for advance_to_marker()

Like clutter_timeline_advance(), calling advance_to_marker() will
not emit ::new-frame for the frame where the marker is set on; it
will also not emit ::marker-reached for the marker we are advancing
the timeline to.

15 years agoBug 1387 - Clarify new-frame signal emission with advance()
Emmanuele Bassi [Tue, 27 Jan 2009 11:18:09 +0000 (11:18 +0000)]
Bug 1387 - Clarify new-frame signal emission with advance()

When calling clutter_timeline_advance(), a timeline will not emit
the ::new-frame signal for the frame we are advancing to, as this
would break the invariants of the timeline behaviour.

The documentation should make this clear.

15 years ago[timeline] Check the fps property range in the ctor
Emmanuele Bassi [Tue, 27 Jan 2009 10:35:50 +0000 (10:35 +0000)]
[timeline] Check the fps property range in the ctor

The clutter_timeline_new() constructor is not checking the full
range of the passed :fps property. The ParamSpec of the property
and the setter method perform this check, so the ctor should as
well.

15 years ago[timeline] Move a complex condition into its own function
Emmanuele Bassi [Tue, 27 Jan 2009 10:33:44 +0000 (10:33 +0000)]
[timeline] Move a complex condition into its own function

The "is-timeline-complete" condition is pretty long, spanning
four lines and four logical sub-conditions. It is possible to
neatly move it into an is_complete() function and make the
code more readable.

15 years ago[timeline] Intern signal names
Emmanuele Bassi [Tue, 27 Jan 2009 10:32:15 +0000 (10:32 +0000)]
[timeline] Intern signal names

The signal names are static string and thus should be interned
so that Glib can do a simple pointer comparison whenever needed,
instead of a strcmp().

15 years ago[timeline] Whitespace fixes
Emmanuele Bassi [Tue, 27 Jan 2009 10:31:53 +0000 (10:31 +0000)]
[timeline] Whitespace fixes

15 years ago[timeline] Documentation and comment fixes
Emmanuele Bassi [Tue, 27 Jan 2009 10:27:33 +0000 (10:27 +0000)]
[timeline] Documentation and comment fixes

The long description of the ClutterTimeline class is very C
developer-oriented. Since many language bindings will refer to
the C API reference we should probably be more verbose and
language agnostic -- at least in the class description.

The methods documentation also requires a little pass to increase
the consistency of the terminology, the grammar and the syntax.

Finally, comments never killed anyone.

15 years ago[tests] Assert as soon as possible
Emmanuele Bassi [Fri, 23 Jan 2009 17:56:25 +0000 (17:56 +0000)]
[tests] Assert as soon as possible

In order to give a usable location of the errors in the test
suite, we need to assert() as soon as possible.

15 years ago[timeline] Create markers hash tables on demand
Emmanuele Bassi [Fri, 23 Jan 2009 17:17:36 +0000 (17:17 +0000)]
[timeline] Create markers hash tables on demand

Since not every timeline will have markers it's unfair to make
all of them crete two empty hash tables (with a preallocated
fixed size).

This commit moves the responsibility of creating the hash tables
to the marker API itself, and adds the relative checks.

15 years ago[timeline] Limit timelines to 1000 frames per second
Emmanuele Bassi [Fri, 23 Jan 2009 17:14:39 +0000 (17:14 +0000)]
[timeline] Limit timelines to 1000 frames per second

Since we are using milliseconds granularity to integrate timelines
with the GLib main loop, we cannot allow values of the :fps
property bigger than 1000. This means validating the fps value both
in the GParamSpec and the clutter_timeline_set_speed() accessor
function.

This should also fix floating point exceptions when trying to
perform "n_frames = milliseconds / (1000 / fps)".

See bug 1354:

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

15 years agoBug 1414 - avoid relayout of ClutterTexture if not syncing size
Havoc Pennington [Mon, 26 Jan 2009 16:24:17 +0000 (16:24 +0000)]
Bug 1414 - avoid relayout of ClutterTexture if not syncing size

If a ClutterTexture does not sync size, it should be possible to
change the texture size without causing a relayout.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoBug 1415 - short-circuit setting same clip again
Havoc Pennington [Mon, 26 Jan 2009 16:22:39 +0000 (16:22 +0000)]
Bug 1415 - short-circuit setting same clip again

There is some GL work and a repaint anytime the clip is set
or unset, so avoid that if it isn't really changed.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoSet the SYNC_MATRICES flag when a stage is first realized
Neil Roberts [Wed, 21 Jan 2009 12:47:29 +0000 (12:47 +0000)]
Set the SYNC_MATRICES flag when a stage is first realized

The stage will usually be painted before the first ConfigureNotify
arrives so we need to set the SYNC_MATRICES flag to ensure that the
viewport will be correct for that paint. Unfortunately this means that
the viewport will be set again once the ConfigureNotify is received
but compared to rendering an initial invalid scene I think it is the
lesser of two evils.

15 years agoRename ActorClone to Clone/1
Emmanuele Bassi [Mon, 26 Jan 2009 10:32:53 +0000 (10:32 +0000)]
Rename ActorClone to Clone/1

Step one of the ActorClone -> Clone renaming: rename the files.

15 years agoWhitespace fixes for BehaviourEllipse
Emmanuele Bassi [Fri, 23 Jan 2009 16:50:17 +0000 (16:50 +0000)]
Whitespace fixes for BehaviourEllipse

Simple fallout from the automated conversion scripts that
switched from ClutterFixed to float.

15 years agoBug 1395 - apply and get_nth_actor are inconsistent
Emmanuele Bassi [Fri, 23 Jan 2009 16:22:02 +0000 (16:22 +0000)]
Bug 1395 - apply and get_nth_actor are inconsistent

When calling clutter_behaviour_apply() the new actor is prepended
to the list of actors to which a behaviour is applied; this breaks
the rest of methods working on the actors list, e.g.:

  # adding actors
  apply(actor_0);
  apply(actor_1);
  apply(actor_2);

  # expected: [ actor_0, actor_1, actor_2 ]
  [ actor_2, actor_1, actor_0 ] = get_actors();

  # expected: actor_2
  actor_0 = get_nth_actor(2);

This commit fixes the inconsistency in the returned values.

15 years agoFix the Cogl primitives for the GLES backend
Neil Roberts [Sat, 24 Jan 2009 00:25:24 +0000 (00:25 +0000)]
Fix the Cogl primitives for the GLES backend

The Cogl primitives broke for GLES 1.1 and 2 after the cogl-float
branch merge.

CoglPathNode was still being declared as GLfixed for the GLES backend
but it was being filled with float values so they were all ending up
as numbers < 1.

glDrawArrays was being called with GL_FIXED so this has been changed
to GL_FLOAT.

The scanline rasterizer had a leftover hardcoded ClutterFixed constant
to add a small amount to the height of each line.

struct _CoglFloatVec2 has been removed because it is no longer used
anywhere.

15 years agoSimplify test-cogl-primitives
Neil Roberts [Fri, 23 Jan 2009 23:55:44 +0000 (23:55 +0000)]
Simplify test-cogl-primitives

This removes a lot of code from test-cogl-primitives to make it easier
to follow. The TestCoglBox custom actor has gone and instead a blank
ClutterGroup is created with a paint signal handler.

Instead of rendering constantly and updating when a GTimer elapses a
second, a ClutterTimeline is used with 1 fps and a new redraw is
queued every frame.

The custom main loop is replaced with a regular call to clutter_main.
This fixes the close button of the stage window so you can quit
without having to press Ctrl+C.

15 years ago[test-cogl-primitives] Remove trailing whitespace
Neil Roberts [Fri, 23 Jan 2009 23:41:26 +0000 (23:41 +0000)]
[test-cogl-primitives] Remove trailing whitespace

15 years ago[clutter-timeline] Remove the code for backwards timelines in get_progress
Neil Roberts [Fri, 23 Jan 2009 22:57:36 +0000 (22:57 +0000)]
[clutter-timeline] Remove the code for backwards timelines in get_progress

The special check to invert the progress when the timeline direction
is backwards is not necessary because the actual frame number will be
decreasing in that case. Inverting just makes it progress forwards
again.

This is more apparent since the float-alpha-value branch merge because
the clutter_linear function directly returns the value from
get_progress. For example in test-depth, the animations loop instead
of oscillating back and forth.

15 years agoFix gtk-doc reference since the anchor point changes
Neil Roberts [Fri, 23 Jan 2009 17:25:43 +0000 (17:25 +0000)]
Fix gtk-doc reference since the anchor point changes

The documentation has been updated to reflect the fact that the anchor
point will move when the actor changes size if it was specified using
a gravity value. The new functions for setting the scale center and z
rotation gravity are also documented.

15 years ago[test-anchors] Add tests for the rotation centers
Neil Roberts [Fri, 23 Jan 2009 15:57:20 +0000 (15:57 +0000)]
[test-anchors] Add tests for the rotation centers

The rotation centers are now tested in a similar way to the anchor
point and scale centers.

The notification handling code has been simplified a bit to handle the
increased amount of properties.

15 years agoConvert the rotation centers to be AnchorCoords
Neil Roberts [Fri, 23 Jan 2009 15:55:41 +0000 (15:55 +0000)]
Convert the rotation centers to be AnchorCoords

Currently only the Z axis rotation center can be set using a gravity
but the other rotations also store their center as an AnchorCoord for
consistency. Specifying the center as a gravity makes less sense for
the other axes because the actors have no size along the Z axis.

The rotation angles are now stored as gdoubles and the fixed point *x
entry points have been removed.

The Z rotation can now be set with a gravity center using the
following new function:

void clutter_actor_set_z_rotation_from_gravity (ClutterActor   *self,
                                                gdouble         angle,
                                                ClutterGravity  gravity);

15 years ago[test-anchors] Add tests for the scale center
Neil Roberts [Fri, 23 Jan 2009 11:12:54 +0000 (11:12 +0000)]
[test-anchors] Add tests for the scale center

A separate set of tests for the scale center have been added that work
in a similar way to the anchor point tests.

15 years agoAdd a scale center property to ClutterActor
Neil Roberts [Fri, 23 Jan 2009 11:11:24 +0000 (11:11 +0000)]
Add a scale center property to ClutterActor

This sets the center point from which the scaling will occur. This can
be used insetad of the anchor point to avoid moving the actor. Like
the anchor point, it can be specified as either a coordinate in units
or a gravity enum.

To set the center you can use two new variants of set_scale:

clutter_actor_set_scale_full (ClutterActor *self,
                              gdouble       scale_x,
                              gdouble       scale_y,
                              int           center_x,
                              int           center_y);

or

clutter_actor_set_scale_with_gravity (ClutterActor   *self,
                                      gdouble         scale_x,
                                      gdouble         scale_y,
                                      ClutterGravity  gravity);

The ClutterFixed variants of the set_scale functions have been removed
and the scale value is now always stored as a double.

15 years agoAdd a conformance test for the anchor point
Neil Roberts [Thu, 22 Jan 2009 13:14:02 +0000 (13:14 +0000)]
Add a conformance test for the anchor point

This verifies that the anchor point can be set from a gravity and then
it moves when the anchor point changes size.

15 years agoStore when the anchor point is set from a gravity
Neil Roberts [Thu, 22 Jan 2009 13:07:33 +0000 (13:07 +0000)]
Store when the anchor point is set from a gravity

This makes it so when the anchor point is set using a gravity enum
then the anchor point moves when the actor changes size. A new
property is added for the anchor point gravity. If the anchor point is
set from gravity then the position in units can also be retreived with
the regular API.

A new union type is used to store the anchor point with helper
accessor functions. The hope is these can be reused for the scale and
rotation center points.

15 years ago[test-text] Use g_setenv instead of setenv
Neil Roberts [Fri, 23 Jan 2009 18:20:46 +0000 (18:20 +0000)]
[test-text] Use g_setenv instead of setenv

setenv doesn't appear to be available on Windows so it fails to
compile.

15 years agoMerge commit 'origin/master' into cogl-material
Robert Bragg [Fri, 23 Jan 2009 15:23:49 +0000 (15:23 +0000)]
Merge commit 'origin/master' into cogl-material

Conflicts:

clutter/clutter-texture.c
clutter/cogl/cogl-texture.h
clutter/cogl/cogl.h.in
clutter/cogl/common/Makefile.am
clutter/cogl/gl/Makefile.am
clutter/cogl/gles/Makefile.am
clutter/cogl/gles/cogl-gles2-wrapper.c
clutter/cogl/gles/cogl-gles2-wrapper.h

15 years agoBug 1361 - Unused ClutterStage::get_resolution() methods
Emmanuele Bassi [Fri, 23 Jan 2009 15:16:21 +0000 (15:16 +0000)]
Bug 1361 - Unused ClutterStage::get_resolution() methods

The clutter_stage_get_resolution() and fixed-point API are just
shorthands for:

        clutter_backend_get_resolution (default_backend);

And as such do not fit at all in the ClutterStage class. The only
reason for their existence was the ClutterUnit conversion macros,
which have now been fixed to use the default backend through a
function call instead.

Thus, we can safely remove the stage entry points.

15 years agoClean up the test reports
Emmanuele Bassi [Fri, 23 Jan 2009 13:29:55 +0000 (13:29 +0000)]
Clean up the test reports

Since we override the clean-generic target in order to remove
the shell scripts we create for each conformance test unit, we
cannot use CLEANFILES to remove the test reports.

15 years agoSplit maintainer-flags from the compiler flags
Emmanuele Bassi [Fri, 23 Jan 2009 13:09:51 +0000 (13:09 +0000)]
Split maintainer-flags from the compiler flags

The maintainer compiler flags we use trigger warnings and errors
in the autogenerated code that gtk-doc creates to scan the header
and source files. Since we cannot control that, and we must run
a distcheck with both --enable-gtk-doc and --enable-maintainer-flags
turned on, we need to use less-strict compiler flags when inside
the doc/reference subdirectories.

The way to do this is to split the maintainer compiler flags into
their own Makefile variable, called MAINTAINER_CFLAGS. The we
can use $(MAINTAINER_CFLAGS) in the INCLUDES or _CFLAGS sections
of each part of the source directories we wish to check with the
anal retentiveness suited for maintainers.