profile/ivi/clutter.git
14 years agoeffect: Add PageTurnEffect
Emmanuele Bassi [Thu, 10 Jun 2010 15:56:16 +0000 (16:56 +0100)]
effect: Add PageTurnEffect

A simple deformation effect that simulates a page curl.

Ported from MxDeformPageTurn inside the Mx toolkit, written by
Chris Lord.

14 years agoeffect: Add DeformEffect
Emmanuele Bassi [Wed, 9 Jun 2010 16:52:06 +0000 (17:52 +0100)]
effect: Add DeformEffect

DeformEffect is an abstract class that should be used to write effects
that change the geometry of an actor before submitting it to the GPU.

Just like the ShaderEffect class, DeformEffect renders the actor to
which it has been applied into an FBO; then it creates a mesh and stores
it inside a VBO. Sub-classes can control vertex attributes like
position, texel coordinates and the color.

14 years agooffscreen-effect: Traslate the modelview with the offsets
Emmanuele Bassi [Thu, 10 Jun 2010 16:35:56 +0000 (17:35 +0100)]
offscreen-effect: Traslate the modelview with the offsets

Instead of using the stage offsets when painting we can simply traslate
the current modelview. This allows sub-classes to fully override the
paint_target() virtual function without chaining up.

14 years agodocs: Fix Effect subclassing section
Emmanuele Bassi [Thu, 10 Jun 2010 16:34:48 +0000 (17:34 +0100)]
docs: Fix Effect subclassing section

It still mentions the long since removed "prepare" function.

14 years agocogl-material: Fix the function which sets the enable blend flag
Neil Roberts [Wed, 9 Jun 2010 12:53:34 +0000 (13:53 +0100)]
cogl-material: Fix the function which sets the enable blend flag

This function had two problems. Firstly it would clear the enable
blend flag before calling pre_change_notify so that if blending was
previously enabled the journal would end up being flushed while the
flag was still cleared. Secondly it would call the pre change notify
whenever blending is needed regardless of whether it was already
needed previously.

This was causing problems in test-depth.

14 years agomaterial: Avoid redundant glBindTexture calls
Robert Bragg [Mon, 26 Apr 2010 09:01:43 +0000 (10:01 +0100)]
material: Avoid redundant glBindTexture calls

This adds a _cogl_bind_gl_texture_transient function that should be used
instead of glBindTexture so we can have a consistent cache of the
textures bound to each texture unit so we can avoid some redundant
binding.

14 years agomaterial: Adds backend abstraction for fragment processing
Robert Bragg [Mon, 26 Apr 2010 09:01:43 +0000 (10:01 +0100)]
material: Adds backend abstraction for fragment processing

As part of an effort to improve the architecture of CoglMaterial
internally this overhauls how we flush layer state to OpenGL by adding a
formal backend abstraction for fragment processing and further
formalizing the CoglTextureUnit abstraction.

There are three backends: "glsl", "arbfp" and "fixed". The fixed backend
uses the OpenGL fixed function APIs to setup the fragment processing,
the arbfp backend uses code generation to handle fragment processing
using an ARBfp program, and the GLSL backend is currently only there as
a formality to handle user programs associated with a material. (i.e.
the glsl backend doesn't yet support code generation)

The GLSL backend has highest precedence, then arbfp and finally the
fixed. If a backend can't support some particular CoglMaterial feature
then it will fallback to the next backend.

This adds three new COGL_DEBUG options:
* "disable-texturing" as expected should disable all texturing
* "disable-arbfp" always make the arbfp backend fallback
* "disable-glsl" always make the glsl backend fallback
* "show-source" show code generated by the arbfp/glsl backends

14 years agocogl-atlas-texture: Flush the journal before starting blit not after
Neil Roberts [Wed, 9 Jun 2010 13:42:18 +0000 (14:42 +0100)]
cogl-atlas-texture: Flush the journal before starting blit not after

_cogl_atlas_texture_blit_begin binds a texture to use as the
destination and it expects it to stay bound until
_cogl_atlas_texture_end_blit is called. However there was a call to
_cogl_journal_flush directly after setting up the blit state which
could cause the wrong texture to be bound. This just moves the flush
to before the call to _cogl_atlas_texture_blit_begin.

This was breaking test-cogl-sub-texture.

14 years agoatlas: fix some journal flushing issues
Robert Bragg [Fri, 4 Jun 2010 15:42:30 +0000 (16:42 +0100)]
atlas: fix some journal flushing issues

1) Always flush when migrating textures out of an atlas because although
it's true that the original texture data will remain valid in the
original texture we can't assume that journal entries have resolved the
GL texture that will be used. This is only true if a layer0_override has
been used.

2) Don't flush at the point of creating a new atlas simply flush
immediately before reorganizing an atlas. This means we are now assuming
that we will never see recursion due to atlas textures being modified
during a journal flush. This means it's the responsibility of the
primitives code to _ensure_mipmaps for example not the responsibility of
_cogl_material_flush_gl_state.

14 years agoprimitives: make sure to update texture storage before drawing
Robert Bragg [Fri, 4 Jun 2010 16:06:32 +0000 (17:06 +0100)]
primitives: make sure to update texture storage before drawing

We want to make sure that the material state flushing code will never
result in changes to the texture storage for that material. So for
example mipmaps need to be ensured by the primitives code.

Changes to the texture storage will invalidate the texture coordinates
in the journal and we want to avoid a recursion of journal flushing.

14 years agotest-cogl-tex-foreign: save and restore GL state correctly
Robert Bragg [Mon, 26 Apr 2010 15:30:25 +0000 (16:30 +0100)]
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.

14 years agotest-cogl-texture-rectangle: save restore GL state correctly
Robert Bragg [Mon, 26 Apr 2010 15:27:59 +0000 (16:27 +0100)]
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.

14 years agomatrix: add cogl_matrix_equal API
Robert Bragg [Mon, 26 Apr 2010 08:55:50 +0000 (09:55 +0100)]
matrix: add cogl_matrix_equal API

This adds a way to compare two CoglMatrix structures to see if they
represent the same transformations. memcmp can't be used because a
CoglMatrix contains private flags and padding.

14 years agocogl-material: Use fragment programs instead of texture env combiners
Damien Lespiau [Wed, 18 Nov 2009 00:26:09 +0000 (00:26 +0000)]
cogl-material: Use fragment programs instead of texture env combiners

                      THIS IS A WORK IN PROGRESS

Mesa is building a big shader when using ARB_texture_env_combine. The
idea is to bypass that computation, do it ourselves and cache the
compiled program in a CoglMaterial.

For now that feature can be enabled by setting the COGL_PIPELINE
environment variable to "arbfp". COGL_SHOW_FP_SOURCE can be set to a non
empty string to dump the fragment program source too.

TODO:
  * fog (really easy, using OPTION)
  * support tex env combiner operands, DOT3, ADD_SIGNED, INTERPOLATE
    combine modes (need refactoring the generation of temporary
    variables) (not too hard)
  * alpha testing for GLES 2.0?

14 years agocogl: Introduce private feature flags and check for ARB_fp
Damien Lespiau [Sat, 14 Nov 2009 14:59:59 +0000 (14:59 +0000)]
cogl: Introduce private feature flags and check for ARB_fp

The Cogl context has now a feature_flags_private enum that will allow us
to query and use OpenGL features without exposing them in the public
API.

The ARB_fragment_program extension is the first user of those flags.
Looking for this extension only happens in the gl driver as the gles
drivers will not expose them.

One can use _cogl_features_available_private() to check for the
availability of such private features.

While at it, reindent cogl-internal.h as described in CODING_STYLE.

14 years agotest-cogl-texture-rectangle: Fix the size allocated for reading data
Neil Roberts [Wed, 9 Jun 2010 11:18:53 +0000 (12:18 +0100)]
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.

14 years agoAlways have a valid font map
Emmanuele Bassi [Wed, 9 Jun 2010 10:53:58 +0000 (11:53 +0100)]
Always have a valid font map

Every time we request a CoglPangoFontMap, either internally or
externally, we should have one available.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
14 years agoCreate the pango context in clutter_set_font_flags
Johan Bilien [Tue, 8 Jun 2010 19:22:29 +0000 (15:22 -0400)]
Create the pango context in clutter_set_font_flags

if it wasn't already. Allows honoring CLUTTER_FONT_MIPMAPPING.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agobackend-glx: Avoid vblank waits/glFinish calls when throttling blits
Robert Bragg [Thu, 3 Jun 2010 19:03:20 +0000 (20:03 +0100)]
backend-glx: Avoid vblank waits/glFinish calls when throttling blits

If we have the GLX_SGI_video_sync extension then it's possible to always
keep track for the video sync counter each time we call glXSwapBuffers
or do a sub stage blit. This then allows us to avoid waiting before
issuing a blit if we can see that the counter has already progressed.

Also since we expect that glXCopySubBuffer is synchronized to the vblank
we don't need to use glFinish () in conjunction with the vblank wait
since the vblank wait's only purpose is to add a delay.

14 years agobackend-glx: only check for GLX_SGI_video_sync for direct contexts
Robert Bragg [Thu, 3 Jun 2010 22:12:08 +0000 (23:12 +0100)]
backend-glx: only check for GLX_SGI_video_sync for direct contexts

The GLX_SGI_video_sync spec explicitly says that it's only supported for
direct contexts so we don't setup up the function pointers if
glXIsDirect () returns GL_FALSE.

14 years agobackend-glx: Make sure to throttle sub region blits
Robert Bragg [Thu, 3 Jun 2010 19:03:20 +0000 (20:03 +0100)]
backend-glx: Make sure to throttle sub region blits

Neither glXCopySubBuffer or glBlitFramebuffer are integrated with the
swap interval of a framebuffer so that means when we do partial stage
updates (as Mutter does in response to window damage) then the blits
aren't throttled which means applications that throw lots of damage
events at the compositor can effectively cause Clutter to run flat out
taking up all the system resources issuing more blits than can even be
seen.

This patch now makes sure we use the GLX_SGI_video_sync or a
DRM_VBLANK_RELATIVE ioctl to throttle blits to the vblank frequency as
we do when using glXSwapBuffers.

14 years agobackend-glx: Provide copy_sub_buffer fallback
Adel Gadllah [Sat, 5 Jun 2010 10:51:32 +0000 (12:51 +0200)]
backend-glx: Provide copy_sub_buffer fallback

Currently glXCopySubBufferMESA is used for sub stage redraws, but in case
a driver does not support GLX_MESA_copy_sub_buffer we fall back to redrawing
the complete stage which isn't really optimal.

So instead to directly fallback to complete redraws try using GL_EXT_framebuffer_blit
to do the BACK to FRONT buffer copies.

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

14 years agocogl-gles2-wrapper: Fix some cases using the wrong texture unit
Neil Roberts [Tue, 8 Jun 2010 16:26:26 +0000 (17:26 +0100)]
cogl-gles2-wrapper: Fix some cases using the wrong texture unit

At two places in cogl_wrap_prepare_for_draw it was trying to loop over
the texture units to flush some state. However it was retrieving the
texture unit pointer using w->active_texture_unit instead of the loop
index so it would end up with the wrong state.

Also in glEnableClientState it was using the active unit instead of
the client active unit.

14 years agotexture-async: Fix path fallback code
Emmanuele Bassi [Tue, 8 Jun 2010 10:19:28 +0000 (11:19 +0100)]
texture-async: Fix path fallback code

And error out in case of load failure.

14 years agoPost-release bump to 1.3.5
Emmanuele Bassi [Mon, 7 Jun 2010 22:26:03 +0000 (23:26 +0100)]
Post-release bump to 1.3.5

14 years agoRelease 1.3.4
Emmanuele Bassi [Mon, 7 Jun 2010 22:19:02 +0000 (23:19 +0100)]
Release 1.3.4

14 years agoscript: Support layout manager properties
Emmanuele Bassi [Mon, 7 Jun 2010 21:45:34 +0000 (22:45 +0100)]
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.

14 years agolayout-manager: Implement set_container()
Emmanuele Bassi [Mon, 7 Jun 2010 20:34:36 +0000 (21:34 +0100)]
layout-manager: Implement set_container()

Store a back pointer of the layout manager inside the container using
the GObject instance data. This introduces a change in the implementation
of ClutterLayoutManager, though it's still binary compatible.

14 years agoblur-effect: Fix loop unrolling
Emmanuele Bassi [Mon, 7 Jun 2010 14:45:24 +0000 (15:45 +0100)]
blur-effect: Fix loop unrolling

The box blur shader was not sampling all the points for producing the
desired effect.

14 years agodoc: Some fixes for the Cogl documentation
Damien Lespiau [Sat, 5 Jun 2010 20:05:23 +0000 (21:05 +0100)]
doc: Some fixes for the Cogl documentation

 • 3 general fixes (typos, copy/paste),
 • ignore cogl-object-private.h,
 • cogl_fixed_atani() was in reality cogl_fixed_atan(), fixed in commit
   43564f05.
 • Fix the cogl-vector section: sections must have a </SECTION> tag at
   the end. Also the cogl-vector section was added in the middle of the
   cogl-buffer one. Let's shiffle it out and add that </SECTION> tag.

14 years agoanimator,state: Mark variadic functions that ends with NULL
Damien Lespiau [Mon, 31 May 2010 20:04:53 +0000 (21:04 +0100)]
animator,state: Mark variadic functions that ends with NULL

GCC can catch errors when it knows that a variadic function must be
ended with NULL. Let's use the glib macro encapsulating the GCC
attribute to clutter_animator_set() and clutter_state_set().

14 years agog_source_set_name on custom sources (if available)
Colin Walters [Fri, 4 Jun 2010 03:34:09 +0000 (23:34 -0400)]
g_source_set_name on custom sources (if available)

Call g_source_set_name, if the versio of GLib is new enough.
This aids debugging, using e.g. SystemTap.  See
https://bugzilla.gnome.org/show_bug.cgi?id=620511
for more information

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoAdd test-cogl-object to the ignore file
Emmanuele Bassi [Mon, 7 Jun 2010 09:52:32 +0000 (10:52 +0100)]
Add test-cogl-object to the ignore file

14 years agobuild: Don't distribute clutter-version.h and cogl-defines.h
Damien Lespiau [Fri, 4 Jun 2010 16:17:45 +0000 (17:17 +0100)]
build: Don't distribute clutter-version.h and cogl-defines.h

As with a351ff2af earlier, distributing headers generated at configure
time conflicts with out of tree builds as the distributed headers will
be included first instead of including the generated ones.

14 years agocogl-object-private.h: white space cleanup
Robert Bragg [Tue, 1 Jun 2010 18:27:07 +0000 (19:27 +0100)]
cogl-object-private.h: white space cleanup

simply replaces tabs with spaces

14 years agoconform: Adds a test-cogl-object conformance test
Robert Bragg [Tue, 1 Jun 2010 16:27:59 +0000 (17:27 +0100)]
conform: Adds a test-cogl-object conformance test

This tests the new cogl_object_get/set_user_data API

14 years agoCoglObject: Adds a COGL_OBJECT macro for casting
Robert Bragg [Tue, 1 Jun 2010 17:06:47 +0000 (18:06 +0100)]
CoglObject: Adds a COGL_OBJECT macro for casting

This adds a convenience COGL_OBJECT macro for casting CoglObject
subclasses to (CoglObject *) pointers.

14 years agoCoglObject: Adds cogl_object_{get,set}_user_data
Robert Bragg [Thu, 27 May 2010 21:24:56 +0000 (22:24 +0100)]
CoglObject: Adds cogl_object_{get,set}_user_data

This provides a mechanism for associating private data with any
CoglObject. We expect Clutter will use this to associate weak materials
with normal materials.

14 years agocogl-path: Adds missing cogl_is_path prototype
Robert Bragg [Tue, 1 Jun 2010 16:53:42 +0000 (17:53 +0100)]
cogl-path: Adds missing cogl_is_path prototype

This adds a missing cogl_is_path prototype to the public cogl-path.h
header.

14 years agocogl-path: Renames cogl_path_get/set cogl_get/set_path
Robert Bragg [Tue, 1 Jun 2010 16:34:59 +0000 (17:34 +0100)]
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.

14 years agotest-drag: Add desaturation effect
Emmanuele Bassi [Thu, 3 Jun 2010 14:20:17 +0000 (15:20 +0100)]
test-drag: Add desaturation effect

Use a desaturation effect on the drag handle.

14 years agobuild: Fix out of tree gtk-doc generation
Damien Lespiau [Thu, 3 Jun 2010 12:48:53 +0000 (13:48 +0100)]
build: Fix out of tree gtk-doc generation

Various headers are build in builddirs (clutter-marshal.h, mkenums
headers and cogl-define.h) so we need to add the corresponding include
paths for gtk-doc to build its scanner.

14 years agobuild: Do not distribute clutter-json.h
Damien Lespiau [Thu, 3 Jun 2010 10:59:48 +0000 (11:59 +0100)]
build: Do not distribute clutter-json.h

clutter-jon.h is generated at configure time, we should not distribute it.

This caused a build issue when compiling from a tarballs and out of tree
builds as we ended up with two clutter-json.h one in $(top_srcdir)/json
and the other in $(top_builddir)/json and picked up the wrong one
($(top_srcdir)/json is included first in the include search path).

14 years agodocs: Effects fixes for the API reference
Emmanuele Bassi [Thu, 3 Jun 2010 13:34:41 +0000 (14:34 +0100)]
docs: Effects fixes for the API reference

14 years agoeffects: Fix stacking of offscreen-based effects
Emmanuele Bassi [Thu, 3 Jun 2010 13:08:59 +0000 (14:08 +0100)]
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.

14 years agoactor: Add "effects" to the animatable metas
Emmanuele Bassi [Tue, 1 Jun 2010 13:45:55 +0000 (14:45 +0100)]
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.

14 years agoshader-effect: Simplify setting the shader source
Emmanuele Bassi [Mon, 17 May 2010 11:55:46 +0000 (12:55 +0100)]
shader-effect: Simplify setting the shader source

Sub-classes of ShaderEffect currently have to get the handle for the
Cogl shader and call cogl_shader_source(); this makes it awkward to
implement a ShaderEffect, and it exposes handles and Cogl API that we
might want to change in the future.

We should provide a ClutterShaderEffect method that allows to (safely)
set the shader source at the right time for sub-classes to use.

14 years agodocs: Add Effects API to the reference
Emmanuele Bassi [Wed, 21 Apr 2010 10:30:06 +0000 (11:30 +0100)]
docs: Add Effects API to the reference

14 years agoeffect: Rework the OffscreenEffect painting
Emmanuele Bassi [Fri, 16 Apr 2010 11:33:20 +0000 (12:33 +0100)]
effect: Rework the OffscreenEffect painting

The OffscreenEffect should set up the off screen draw buffer so that it
has the same projection and modelview as if it where on screen; we
achieve that by setting up the viewport to be the same size of the stage
but with an initial offset given by the left-most vertex of the actor.

When we paint the texture attached to the FBO we then set up the
modelview matrix of the on screen draw buffer so that it's the same as
the stage one: this way, the texture will be painted in screen
coordinates and it will occupy the same area as the actor would have
had.

14 years agoeffect: Add ColorizeEffect
Emmanuele Bassi [Tue, 13 Apr 2010 23:40:24 +0000 (00:40 +0100)]
effect: Add ColorizeEffect

A copy of DesaturateEffect that converts to grayscale and applies a
user-defined tint to the render target.

14 years agoeffect: Add DesaturateEffect
Emmanuele Bassi [Fri, 9 Apr 2010 15:14:21 +0000 (16:14 +0100)]
effect: Add DesaturateEffect

A simple shader-based effect that desaturates an actor and its contents
based on a controllable factor.

14 years agoeffect: Add BlurEffect
Emmanuele Bassi [Thu, 8 Apr 2010 17:46:54 +0000 (18:46 +0100)]
effect: Add BlurEffect

A simple, GLSL shader-based blur effect.

The blur shader is taken straight from the test-shader.c interactive
test case. It's a fairly clunky, inefficient and visually incorrect
implementation of a box blur, but it's all we have right now until I
figure out a way to do multi-pass shading with the current API.

14 years agoeffect: Add ShaderEffect
Emmanuele Bassi [Tue, 13 Apr 2010 15:40:31 +0000 (16:40 +0100)]
effect: Add ShaderEffect

The ShaderEffect class is an abstract base type for shader-based
effects. GLSL-based effects should be implemented by sub-classing
ShaderEffect and overriding ActorMeta::set_actor() to set the source
code of the shader, and Effect::pre_paint() to update the uniform
values, if any.

The ShaderEffect has a generic API for sub-classes to set the values
of the uniforms defined by their shaders, and it uses the shader
types we defined for ClutterShader, to avoid re-inventing the wheel
every time.

14 years agoeffect: Add OffscreenEffect
Emmanuele Bassi [Mon, 17 May 2010 10:39:27 +0000 (11:39 +0100)]
effect: Add OffscreenEffect

The OffscreenEffect class is meant to be used to implement Effect
sub-classes that create an offscreen framebuffer and redirect the
actor's paint sequence there. The OffscreenEffect is useful for
effects using fragment shaders.

Any shader-based effect being applied to an actor through an offscreen
buffer should be used before painting the resulting target material and
not for every actor. This means that doing:

       pre_paint: cogl_program_use(program)
                  set up offscreen buffer
           paint: [ actors ] → offscreen buffer → target material
      post_paint: paint target material
                  cogl_program_use(null)

Is not correct. Unfortunately, we cannot really do:

      post_paint: cogl_program_use(program)
                  paint target material
                  cogl_program_use(null)

Because the OffscreenEffect::post_paint() implementation also pops the
offscreen buffer and re-instates the previous framebuffer:

      post_paint: cogl_program_use(program)
                  change frame buffer ← ouch!
                  paint target material
                  cogl_program_use(null)

One way to fix it is to allow using the shader right before painting
the target material - which means adding a new virtual inside the
OffscreenEffect class vtable in additions to the ones defined by the
parent Effect class.

The newly-added paint_target() virtual allows the correct sequence of
actions by adding an entry point for sub-classes to wrap the "paint
target material" operation with custom code, in order to implement the
case above correctly as:

      post_paint: change frame buffer
                  cogl_program_use(program)
                  paint target material
                  cogl_program_use(null)

The added upside is that sub-classes of OffscreenEffect involving
shaders really just need to override the prepare() and paint_target()
virtuals, since the pre_paint() and post_paint() do all that's needed.

14 years agoAdd the ClutterEffect abstract class
Emmanuele Bassi [Thu, 8 Apr 2010 09:55:15 +0000 (10:55 +0100)]
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.

14 years agoactor: Reset the modelview matrix
Emmanuele Bassi [Mon, 19 Apr 2010 11:32:15 +0000 (12:32 +0100)]
actor: Reset the modelview matrix

When getting the relative modelview matrix we need to reset it to the
stage's initial state or, at least, initialize it to the identity
matrix, instead of assuming we have an empty stack.

14 years agobuild: Distribute cogl-object.h
Damien Lespiau [Thu, 3 Jun 2010 10:33:54 +0000 (11:33 +0100)]
build: Distribute cogl-object.h

cogl-object.h is a new public header. Include it in the right list of
source files to have it distributed.

14 years agodocs: Miscellaneous fixes to silence gtk-doc
Emmanuele Bassi [Tue, 1 Jun 2010 13:14:41 +0000 (14:14 +0100)]
docs: Miscellaneous fixes to silence gtk-doc

14 years agoclip_stack: Remove use of CoglHandle in the CoglClipStack API
Robert Bragg [Fri, 28 May 2010 00:01:28 +0000 (01:01 +0100)]
clip_stack: Remove use of CoglHandle in the CoglClipStack API

This replaces the use of CoglHandle with strongly type CoglClipStack *
pointers instead. The only function not converted for now is
cogl_is_clip_stack which will be done in a later commit.

14 years agobitmap: Remove use of CoglHandle in the CoglBitmap API
Robert Bragg [Thu, 27 May 2010 23:51:40 +0000 (00:51 +0100)]
bitmap: Remove use of CoglHandle in the CoglBitmap API

This replaces the use of CoglHandle with strongly type CoglBitmap *
pointers instead. The only function not converted for now is
cogl_is_bitmap which will be done in a later commit.

14 years agopath: Remove use of CoglHandle in the CoglPath API
Robert Bragg [Thu, 27 May 2010 23:35:47 +0000 (00:35 +0100)]
path: Remove use of CoglHandle in the CoglPath API

This replaces the use of CoglHandle with strongly type CoglPath *
pointers instead. The only function not converted for now is
cogl_is_path which will be done in a later commit.

14 years agocogl: avoid ‘_cogl_xyz_handle_new’ defined but not used warnings
Robert Bragg [Tue, 1 Jun 2010 10:50:02 +0000 (11:50 +0100)]
cogl: avoid ‘_cogl_xyz_handle_new’ defined but not used warnings

This patch makes it so that only the backwards compatibility
COGL_HANDLE_DEFINE macro defines a _cogl_xyz_handle_new function. The
new COGL_OBJECT_DEFINE macro only defines a _cogl_xyz_object_new
function.

14 years agoanalysis: Fix some CoglFixed API
Damien Lespiau [Thu, 27 May 2010 12:30:07 +0000 (13:30 +0100)]
analysis: Fix some CoglFixed API

2 functions where not correctly defined/documented, use the actual
symbol name instead.

14 years agoanalysis: Use static functions when possible
Damien Lespiau [Thu, 27 May 2010 12:28:43 +0000 (13:28 +0100)]
analysis: Use static functions when possible

It's best to ensure the functions only used in one compilation unit are
marked as static so GCC can inline them if it feels like it.

14 years agoanalysis: Make all function declarations be protoypes
Damien Lespiau [Thu, 27 May 2010 11:18:29 +0000 (12:18 +0100)]
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.

14 years agoanalysis: Fix the "key-press-event" callback signature
Damien Lespiau [Thu, 27 May 2010 08:23:26 +0000 (09:23 +0100)]
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.

14 years agoanalysis: None used in pointer context
Damien Lespiau [Thu, 27 May 2010 08:07:11 +0000 (09:07 +0100)]
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.

14 years agoanalysis: FALSE/0 used in pointer context
Damien Lespiau [Thu, 27 May 2010 07:28:29 +0000 (08:28 +0100)]
analysis: FALSE/0 used in pointer context

While this is totally fine (0 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 in the pointer
context.

It seems that, in most case, it's more an overlook than a deliberate
choice to use FALSE/0 as NULL, eg. copying a _COGL_GET_CONTEXT (ctx, 0)
or a g_return_val_if_fail (cond, 0) from a function returning a
gboolean.

14 years agoUpdate git ignore file
Emmanuele Bassi [Sun, 30 May 2010 14:24:18 +0000 (15:24 +0100)]
Update git ignore file

14 years agobuffer: Remove use of CoglHandle in the CoglBuffer API
Robert Bragg [Thu, 27 May 2010 22:40:40 +0000 (23:40 +0100)]
buffer: Remove use of CoglHandle in the CoglBuffer API

This replaces the use of CoglHandle with strongly type CoglBuffer *
pointers instead. The only function not converted for now is
cogl_is_buffer which will be done in a later commit.

14 years agoStart eradicating the CoglHandle typedef
Robert Bragg [Thu, 27 May 2010 22:31:40 +0000 (23:31 +0100)]
Start eradicating the CoglHandle typedef

CoglHandle is a common source of complaints and confusion because people
expect a "handle" to be some form of integer type with some indirection
to lookup the corresponding objects as opposed to a direct pointer.

This patch starts by renaming CoglHandle to CoglObject * and creating
corresponding cogl_object_ APIs to replace the cogl_handle ones.

The next step though is to remove all use of CoglHandle in the Cogl APIs
and replace with strongly typed pointer types such as CoglMaterial * or
CoglTexture * etc also all occurrences of COGL_INVALID_HANDLE can just
use NULL instead.

After this we will consider switching to GTypeInstance internally so we
can have inheritance for our types and hopefully improve how we handle
bindings.

Note all these changes will be done in a way that maintains the API and
ABI.

14 years agocogl-texture-2d: Regenerate the mipmaps when the texture is modified
Neil Roberts [Fri, 28 May 2010 17:12:53 +0000 (18:12 +0100)]
cogl-texture-2d: Regenerate the mipmaps when the texture is modified

When the texture is modified by cogl_texture_set_region, it wasn't
setting mipmaps_dirty so it would never update the mipmaps.

14 years agotexture: don't use a static bool to gate warning
Robert Bragg [Fri, 28 May 2010 16:11:31 +0000 (17:11 +0100)]
texture: don't use a static bool to gate warning

in create_pick_material we were using a static boolean to gate when we
show a warning, but that would mean if the problem recurs between
different textures then the warning will only be shown once. We now have
a private bitfield flag instead, just so we don't spew millions of
warnings if the problem is recurring.

14 years ago[texture] Support picking textures according to their alpha channel
Robert Bragg [Fri, 25 Sep 2009 18:14:40 +0000 (19:14 +0100)]
[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.

14 years ago[material] fix _set_alpha_test_function: missing a glEnable(GL_ALPHA_TEST)
Robert Bragg [Fri, 25 Sep 2009 18:04:13 +0000 (19:04 +0100)]
[material] fix _set_alpha_test_function: missing a glEnable(GL_ALPHA_TEST)

Since the default alpha test function of GL_ALWAYS is equivalent to
GL_ALPHA_TEST being disabled we don't need to worry about Enabling/Disabling
it when flushing material state, instead it's enough to leave it always
enabled.  We will assume that any driver worth its salt wont incur any
additional cost for glEnable (GL_ALPHA_TEST) + GL_ALWAYS vs
glDisable (GL_ALPHA_TEST).

This patch simply calls glEnable (GL_ALPHA_TEST) in cogl_create_context

14 years ago[texture] remove redundant if (paint_opacity == 0) bailout
Robert Bragg [Wed, 23 Sep 2009 18:04:03 +0000 (19:04 +0100)]
[texture] remove redundant if (paint_opacity == 0) bailout

clutter_texture_paint shouldn't need to optimize the case where
paint_opacity == 0 and bailout, since we've been doing this optimization for
all actors in clutter_actor_paint for a while now.

14 years agotest-scrolling: Use a better looking bounce easing
Emmanuele Bassi [Thu, 27 May 2010 15:32:32 +0000 (16:32 +0100)]
test-scrolling: Use a better looking bounce easing

14 years agocogl-vertex-buffer: Don't disable any texture coord arrays
Neil Roberts [Thu, 27 May 2010 13:54:14 +0000 (14:54 +0100)]
cogl-vertex-buffer: Don't disable any texture coord arrays

The enabled state of the texture coord arrays is cached in the cogl
context so there is no need to disable them when we've finished
rendering a vbo.

14 years agocogl: Record new enabled arrays in _cogl_disable_other_texcoord_arrays
Neil Roberts [Thu, 27 May 2010 13:51:44 +0000 (14:51 +0100)]
cogl: Record new enabled arrays in _cogl_disable_other_texcoord_arrays

When _cogl_disable_other_texcoord_arrays is called it disables the
neccessary texcoord arrays and then removes the bits for the disabled
arrays in ctx->texcoord_arrays_enabled. However none of the places
that call the function then set any bits in ctx->texcoord_arrays_enabled
so the arrays would never get marked and they would never get disabled
again.

This patch just changes it so that _cogl_disable_other_texcoord_arrays
also sets the corresponding bits in ctx->texcoord_arrays_enabled.

14 years agotest-scrolling: Animate intermediate positions
Emmanuele Bassi [Thu, 27 May 2010 11:32:45 +0000 (12:32 +0100)]
test-scrolling: Animate intermediate positions

Animating intermediate positions in the viewport panning is a neat
effect.

14 years agodrag-action: Re-use press_button in emit_drag_end()
Emmanuele Bassi [Thu, 27 May 2010 11:30:22 +0000 (12:30 +0100)]
drag-action: Re-use press_button in emit_drag_end()

Since emit_drag_end() can be called from a MOTION event capture we
cannot call clutter_event_get_button(). We should, instead, use the
press_button value because if we're emitting ::drag-end it means we
also emitted ::drag-begin and the value is valid.

14 years agoactor: Add accessors pair for :clip-to-allocation
Emmanuele Bassi [Wed, 26 May 2010 15:09:47 +0000 (16:09 +0100)]
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.

14 years agoAdd a scrolling interactive example
Emmanuele Bassi [Wed, 26 May 2010 14:58:15 +0000 (15:58 +0100)]
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.

14 years agoUse ClickAction in test-animation
Emmanuele Bassi [Wed, 26 May 2010 13:18:19 +0000 (14:18 +0100)]
Use ClickAction in test-animation

Instead of using ::button-press-event.

14 years agoactor: Fix a type check thinko in add_action_with_name()
Emmanuele Bassi [Wed, 26 May 2010 13:16:48 +0000 (14:16 +0100)]
actor: Fix a type check thinko in add_action_with_name()

14 years agodocs: Description fixes for Action and Constraint
Emmanuele Bassi [Wed, 26 May 2010 13:09:24 +0000 (14:09 +0100)]
docs: Description fixes for Action and Constraint

14 years agostate: Minor fixes and documentation additions
Emmanuele Bassi [Wed, 26 May 2010 12:43:42 +0000 (13:43 +0100)]
state: Minor fixes and documentation additions

Clean up the code a bit, and move common code paths into separate
function. Also, document clutter_state_set() with examples.

14 years agointrospection: Add --pkg atk
Emmanuele Bassi [Wed, 26 May 2010 12:40:18 +0000 (13:40 +0100)]
introspection: Add --pkg atk

We need to tell the introspection scanner all the dependencies we
require, including the pkg-config name to use when compiling the
GIR file into a typelib object.

14 years agoclick-action: Handle the event
Emmanuele Bassi [Tue, 25 May 2010 12:27:29 +0000 (13:27 +0100)]
click-action: Handle the event

In case we did handle the event, we should return TRUE from the ::event
signal handler.

14 years agodocs: Fix DragAction documentation
Emmanuele Bassi [Tue, 25 May 2010 12:10:38 +0000 (13:10 +0100)]
docs: Fix DragAction documentation

The ::drag-motion signal does not have a ModifierType argument; also,
there's no need to connect to the ::drag-motion signal any more.

14 years agoFix typo in get_accessible()
Emmanuele Bassi [Tue, 25 May 2010 12:03:24 +0000 (13:03 +0100)]
Fix typo in get_accessible()

14 years agoactor: Put get_accessible() at the end of the class structure
Emmanuele Bassi [Tue, 25 May 2010 11:54:59 +0000 (12:54 +0100)]
actor: Put get_accessible() at the end of the class structure

New virtual functions cannot go wherever they want, if we need to
preserve the ABI.

Also, the coding style should match the rest of ClutterActor and
Clutter's own coding style.

14 years agodocs: Add ClickAction to the API reference
Emmanuele Bassi [Tue, 25 May 2010 10:53:59 +0000 (11:53 +0100)]
docs: Add ClickAction to the API reference

And clean up the reference index.

14 years agoactor-meta: Disconnect on actor destroy
Emmanuele Bassi [Mon, 24 May 2010 10:30:17 +0000 (11:30 +0100)]
actor-meta: Disconnect on actor destroy

When destroying an Actor the various ActorMeta instance should already
be disposed - unless something is holding a reference to them, in which
case we should use the ::destroy signal to unset the ActorMeta:actor
back pointer.

14 years agoaction: Add ClickAction
Emmanuele Bassi [Mon, 24 May 2010 09:41:19 +0000 (10:41 +0100)]
action: Add ClickAction

ClickAction adds "clickable" semantics to an actor. It provides all
the business logic to emit a high-level "clicked" signal from the
various low-level signals inside ClutterActor.

14 years agodrag: Add a default drag-motion behaviour
Emmanuele Bassi [Tue, 25 May 2010 10:01:46 +0000 (11:01 +0100)]
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.

14 years agoPost-release version bump to 1.3.3
Emmanuele Bassi [Mon, 24 May 2010 15:57:35 +0000 (16:57 +0100)]
Post-release version bump to 1.3.3

14 years agoRelease 1.3.2 (snapshot)
Emmanuele Bassi [Mon, 24 May 2010 15:50:36 +0000 (16:50 +0100)]
Release 1.3.2 (snapshot)

14 years agodocs: Add Actor.get_accessible() to the API reference
Emmanuele Bassi [Mon, 24 May 2010 15:46:38 +0000 (16:46 +0100)]
docs: Add Actor.get_accessible() to the API reference

14 years agodocs: Update NEWS
Emmanuele Bassi [Mon, 24 May 2010 15:12:47 +0000 (16:12 +0100)]
docs: Update NEWS