The cogl_is_* functions were showing up quite high on profiles due to
iterating through arrays of cogl handles.
This does away with all the handle arrays and implements a simple struct
inheritance scheme. All cogl objects now add a CoglHandleObject _parent;
member to their main structures. The base object includes 2 members a.t.m; a
ref_count, and a klass pointer. The klass in turn gives you a type and
virtual function for freeing objects of that type.
Each handle type has a _cogl_##handle_type##_get_type () function
automatically defined which returns a GQuark of the handle type, so now
implementing the cogl_is_* funcs is just a case of comparing with
obj->klass->type.
Another outcome of the re-work is that cogl_handle_{ref,unref} are also much
more efficient, and no longer need extending for each handle type added to
cogl. The cogl_##handle_type##_{ref,unref} functions are now deprecated and
are no longer used internally to Clutter or Cogl. Potentially we can remove
them completely before 1.0.
* clutter/cogl/cogl-shader.h: Add a function for setting an
integer uniform, similar to cogl_program_uniform_1f().
* clutter/cogl/gl/cogl-program.c: Implement the GL version
of cogl_program_uniform_1i().
* clutter/cogl/gles/cogl-program.c: Implement the GLES version
of cogl_program_uniform_1i().
Bug 1049 - Clutter doesn't support most GLSL uniforms (patch
by Chris Lord and Neil Roberts)
* README: Update release notes.
* clutter/Makefile.am:
* clutter/clutter-shader-types.[ch]: Add GValue types for
shader values.
* clutter/clutter-actor.[ch]: Update the shader API to use
the newly added GValue support for GLSL shader uniform
setters.
* clutter/clutter-shader.[ch]: Add float and integer convenience
API for single value GLSL uniform setters.
* clutter/cogl/cogl-shader.h: Add new uniform setters.
* clutter/cogl/gl/cogl-context.c:
* clutter/cogl/gl/cogl-context.h:
* clutter/cogl/gl/cogl-defines.h.in:
* clutter/cogl/gl/cogl-program.c:
* clutter/cogl/gl/cogl.c: Update the GL implementation of COGL
to handle the GLSL uniform setters.
* clutter/cogl/gles/cogl-gles2-wrapper.c:
* clutter/cogl/gles/cogl-gles2-wrapper.h:
* clutter/cogl/gles/cogl-internal.h:
* clutter/cogl/gles/cogl-program.c: Update the GLES 2.0 implementation
of COGL to handle the GLSL uniform setters.
* doc/reference/clutter/clutter-sections.txt:
* doc/reference/cogl/cogl-sections.txt: Update the documentation.
* tests/interactive/test-fbo.c:
* tests/interactive/test-shader.c: Update the shader tests.
Bug 1219 - Clean up cogl.h
* clutter/cogl/cogl.h.in:
* clutter/cogl/cogl-offscreen.h:
* clutter/cogl/cogl-path.h:
* clutter/cogl/cogl-shader.h:
* clutter/cogl/cogl-texture.h:
* clutter/cogl/cogl-types.h: Split up the massive cogl.h file
into sub-header for each section of the API.
* clutter/cogl/gl/*:
* clutter/cogl/gles/*: Update the GL and GLES implementations
of COGL to cope with the new header structure.
* doc/reference/cogl/Makefile.am: Fix symbol retrieval.
* clutter/cogl/gles/cogl-gles2-wrapper.c: All of the settings and
uniforms are now proxied into COGL variables instead of setting
the GL uniforms directly. Just before glDrawArrays is executed a
shader is generated using the given settings to avoid using 'if'
statements. The shaders are cached.
* clutter/cogl/gles/cogl-fixed-vertex-shader.glsl:
* clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: The shaders
are now split into parts using comments instead of 'if' statements
so that the simplest shader can be generated on the fly.
* clutter/cogl/gles/stringify.sh: Now splits up the shader sources
into separate C strings where deliminated by special comments.
* clutter/cogl/gles/cogl-program.h:
* clutter/cogl/gles/cogl-program.c: A custom shader can no longer
be directly linked with the fixed-functionality replacement
because the replacement changes depending on the settings. Instead
the bound shader is linked with the appropriate replacement shader
just before glDrawArrays is executed. The custom uniform variables
must also be proxied through COGL variables because their location
can change when relinked.
now stored in a separate struct so they can be stored for
application program objects as well.
* clutter/cogl/gles/cogl.c: Moved stub shader functions into
separate files.
(_cogl_features_init): Report support for the shaders feature on
GLES 2
* clutter/cogl/gles/cogl-shader.h:
* clutter/cogl/gles/cogl-shader.c:
* clutter/cogl/gles/cogl-program.h:
* clutter/cogl/gles/cogl-program.c: Separate files to handle
shaders on programs on GLES. If version 1.1 is being used then the
stub functions which all fail are still used.
* clutter/cogl/gles/cogl-gles2-wrapper.c
(cogl_gles2_wrapper_init, cogl_gles2_wrapper_bind_attributes),
(cogl_gles2_wrapper_get_uniforms): Move the uniforms and attribute
bindings into a separate function so they can be used to bind on
application shaders as well.
(cogl_gles2_wrapper_update_matrix): Now takes a parameter and is
no longer static so that it can be used to update all of the
matrices when a new shader is bound.
* clutter/cogl/gles/cogl-defines.h.in: Use GL_COMPILE_STATUS for
CGL_OBJECT_COMPILE_STATUS if the latter isn't available (for
example on GLES 2).
* clutter/cogl/gles/cogl-context.h (CoglContext): Added handle
arrays for programs and shaders.
* clutter/cogl/gles/cogl-context.c (cogl_create_context)
(cogl_destroy_context): Initialize and destroy program and shader
handle array.
* clutter/cogl/gles/Makefile.am (libclutter_cogl_la_SOURCES): Add
cogl-{shader,program}.{c,h}