Bug 1211 - Drop ClutterFeatureFlags usage from COGL
* clutter/cogl/cogl.h.in:
* clutter/cogl/gl/cogl.c:
* clutter/cogl/gles/cogl.c: Do not use ClutterFeatureFlags
when CoglFeatureFlags will do. This removes the last usage
of Clutter API inside COGL.
Bug 1210 - Add CoglColor API
* clutter/cogl/cogl-color.h:
* clutter/cogl/cogl.h.in:
* clutter/cogl/common/Makefile.am:
* clutter/cogl/common/cogl-color.c:
* clutter/cogl/gl/Makefile.am:
* clutter/cogl/gl/cogl.c:
* clutter/cogl/gles/Makefile.am:
* clutter/cogl/gles/cogl-texture.c:
* clutter/cogl/gles/cogl.c: Add a new color-type, to be used by
COGL. CoglColor is optimized to allow the minimum amount of
conversions possible for both GL and GLES implementations.
* clutter/clutter-actor.c:
* clutter/clutter-clone-texture.c:
* clutter/clutter-entry.c:
* clutter/clutter-main.c:
* clutter/clutter-rectangle.c:
* clutter/clutter-stage.c:
* clutter/clutter-texture.c: Use CoglColor when needed.
* clutter/pango/pangoclutter-render.c: Use CoglColor when needed.
* doc/reference/cogl/cogl-docs.sgml:
* doc/reference/cogl/cogl-sections.txt: Update the documentation.
* tests/test-cogl-offscreen.c:
* tests/test-cogl-primitives.c:
* tests/test-cogl-tex-convert.c:
* tests/test-cogl-tex-foreign.c:
* tests/test-cogl-tex-getset.c:
* tests/test-cogl-tex-polygon.c:
* tests/test-cogl-tex-tile.c:
* tests/test-paint-wrapper.c: Update the tests.
* README: Update release notes.
Bug 1209 - Move fixed point API in COGL
* clutter/cogl/cogl-fixed.h:
* clutter/cogl/cogl.h.in:
* clutter/cogl/common/Makefile.am:
* clutter/cogl/common/cogl-fixed.c: Add fixed point API, modelled
after the ClutterFixed. The CoglFixed API supercedes the ClutterFixed
one and avoids the dependency of COGL on Clutter's own API.
* clutter/cogl/common/cogl-clip-stack.c:
* clutter/cogl/common/cogl-primitives.c:
* clutter/cogl/common/cogl-primitives.h: Update internal usage of
ClutterFixed to CoglFixed.
* clutter/cogl/gl/Makefile.am:
* clutter/cogl/gl/cogl-primitives.c:
* clutter/cogl/gl/cogl-texture.c:
* clutter/cogl/gl/cogl.c: Ditto, in the GL implementation of the
COGL API.
* clutter/cogl/gles/Makefile.am:
* clutter/cogl/gles/cogl-fbo.c:
* clutter/cogl/gles/cogl-gles2-wrapper.c:
* clutter/cogl/gles/cogl-primitives.c:
* clutter/cogl/gles/cogl-texture.c:
* clutter/cogl/gles/cogl.c: Ditto, in the GLES implementation of
the COGL API.
* clutter/pango/pangoclutter-glyph-cache.c:
* clutter/pango/pangoclutter-glyph-cache.h: Ditto, in the Pango
renderer glyphs cache.
* clutter/clutter-fixed.c:
* clutter/clutter-fixed.h: ClutterFixed and related API becomes
a simple transition API for bindings and public Clutter API.
* clutter/clutter-actor.c:
* clutter/clutter-alpha.c:
* clutter/clutter-backend.c:
* clutter/clutter-behaviour-depth.c:
* clutter/clutter-behaviour-ellipse.c:
* clutter/clutter-behaviour-path.c:
* clutter/clutter-behaviour-rotate.c:
* clutter/clutter-behaviour-scale.c:
* clutter/clutter-clone-texture.c:
* clutter/clutter-color.c:
* clutter/clutter-entry.c:
* clutter/clutter-stage.c:
* clutter/clutter-texture.c:
* clutter/clutter-timeline.c:
* clutter/clutter-units.h: Move from the internal usage of
ClutterFixed to CoglFixed.
* doc/reference/clutter/clutter-sections.txt:
* doc/reference/cogl/cogl-docs.sgml:
* doc/reference/cogl/cogl-sections.txt: Update the documentation.
* tests/test-cogl-tex-tile.c:
* tests/test-project.c: Fix tests after the API change
* README: Add release notes.
* clutter/cogl/gles/cogl-fbo.c: Copy the code from gl/cogl-fbo but
use the API calls directly instead of loading an extension because
it is part of the core in GLES 2.
* clutter/cogl/gles/cogl.c (_cogl_features_init): Report
COGL_FEATURE_OFFSCREEN.
* clutter/cogl/gles/cogl-fbo.h (CoglFbo): Add gl_stencil_handle.
* clutter/cogl/gles/cogl-context.h (CoglContext): Add
viewport_store
* tests/test-fbo.c (make_shader): Conditionally use the GLES 2
names of the shader variables
* clutter/cogl/gl/cogl-texture.c (cogl_texture_polygon)
(_cogl_texture_quad_sw, _cogl_texture_quad_hw):
* clutter/cogl/gles/cogl-texture.c (cogl_texture_polygon)
(_cogl_texture_quad_sw, _cogl_texture_quad_hw): Enable backface
culling in GL if it is requested.
* clutter/cogl/gles/cogl-texture.c (_cogl_texture_quad_sw)
(_cogl_texture_quad_hw):
* clutter/cogl/gl/cogl-texture.c (_cogl_texture_quad_sw)
(_cogl_texture_quad_hw): Reorder the
vertices so that they are counter-clockwise.
* clutter/cogl/gles/cogl-context.h (CoglContext):
* clutter/cogl/gl/cogl-context.h (CoglContext): Added a flag to
store whether backface culling is currently enabled.
* clutter/cogl/gles/cogl.c (cogl_enable_backface_culling):
* clutter/cogl/gl/cogl.c (cogl_enable_backface_culling): New
function
* doc/reference/cogl/cogl-sections.txt: Add
cogl_enable_backface_culling
* clutter/cogl/gl/cogl-texture.c (_cogl_texture_upload_subregion_to_gl)
(_cogl_texture_upload_to_gl):
* clutter/cogl/gles/cogl-texture.c (_cogl_texture_upload_to_gl)
(_cogl_texture_upload_subregion_to_gl):
When uploading data to a sliced texture, fill the waste pixels
with copies of the edge of the real texture data. Otherwise the
value of the waste pixels are undefined so it will show artifacts
when the texture is scaled with GL_LINEAR and the pixels are
blended in.
values (SIGSEGV)
* clutter/cogl/gl/cogl-texture.c
(_cogl_texture_upload_subregion_to_gl): When iterating over the
slices, discard ones that don't intersect immediatly otherwise it
will call glTexSubImage2D with a negative width/height and then
move the source position incorrectly. Thanks to Gwenole
Beauchesne.
* clutter/cogl/gl/cogl-texture.c (cogl_texture_set_region):
* clutter/cogl/gles/cogl-texture.c (cogl_texture_set_region):
Don't attempt to upload any data if the width or height of the
subregion is zero. Thanks to Gwenole Beauchesne.
* clutter/cogl/gles/cogl.c (cogl_get_viewport): Use glGetIntegerv
instead of glGetFixedv to read the viewport because the latter
converts incorrectly on some hardware.
Bug 1082 - Texture bitmap is destroyed in wrong way
* clutter/cogl/common/cogl-bitmap-pixbuf.c:
(_cogl_bitmap_from_file): Make a copy of the pixbuf data in
the internal image loader so that we can keep working under
the assumption that we are using the GLib memory allocation
and deallocation functions.
* clutter/cogl/gl/cogl.c:
* clutter/cogl/gles/cogl.c:
* clutter/cogl/cogl.h.in: Add cogl_clip_stack_save,
cogl_clip_stack_restore, cogl_viewport and cogl_frustum.
* clutter/cogl/gl/cogl-fbo.h:
* clutter/cogl/gl/cogl-fbo.c: Try to attach a stencil buffer when
creating an FBO.
* clutter/cogl/common/cogl-clip-stack.c: Add functions to save and
restore the whole state of the stack.
* clutter/clutter-texture.c (clutter_texture_paint): When
rendering the FBO source, setup a temporary asymmetric perspective
projection matrix to render it as it would appear on screen.
* clutter/clutter-private.h:
* clutter/clutter-actor.c
(_clutter_actor_apply_modelview_transform_recursive): No longer
static and exported in clutter-private.h
* clutter/cogl/gl/cogl.c (set_clip_plane):
* clutter/clutter-alpha.c (sinc_func): Use G_PI instead of M_PI
because M_PI isn't defined in MSVC without a special
#define. Thanks to Haakon Sporsheim
Bug 980 - cogl-bitmap-fallback.c compiler error/warning due to
cast issue (Haakon Sporsheim)
* clutter/cogl/common/cogl-bitmap-fallback.c:
(_cogl_unpremult_alpha_last),
(_cogl_unpremult_alpha_first): Cast to avoid a compiler warning
with MSC.
* clutter/cogl/gl/cogl.c:
Temp workaround for 10.4 ATI card OSX folks, see #929
(Tommi Komulainen)
Bug 998 - clutter always captures X input events
* clutter/eglx/clutter-stage-egl.c:
* clutter/glx/clutter-stage-glx.c:
When we disable X event retrival, dont still select for window
events.
* 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.
* cogl/Makefile.am:
* cogl/cogl-docs.sgml:
* cogl/version.xml.in
* clutter/version.xml.in
Add full version (including minor) to docs.
Add version to COGL docs
* clutter/cogl/common/cogl-clip-stack.h:
* clutter/cogl/common/cogl-clip-stack.c: Added functions to
maintain a stack of clipping rectangles.
* clutter/cogl/gles/cogl.c:
* clutter/cogl/gl/cogl.c: The cogl_clip_set and unset functions
have moved into cogl-clip-stack.c which calls back to cogl.c to
set the actual rectangles. Multiple clip rectangles are combined
by merging the stencil buffers.
* clutter/cogl/gles/cogl-primitives.c (_cogl_path_fill_nodes):
* clutter/cogl/gl/cogl-primitives.c (_cogl_path_fill_nodes): Merge
the stencil buffer with the contents of the clipping stack after
drawing the path.
* clutter/cogl/gles/cogl-context.h (CoglContext):
* clutter/cogl/gl/cogl-context.h (CoglContext): Store the number
of available stencil bits.
* clutter/cogl/common/Makefile.am
(libclutter_cogl_common_la_SOURCES): Added cogl-clip-stack.c
* doc/reference/cogl/Makefile.am: Ignore cogl/gl and cogl/gles
when building the documentation.
* clutter/cogl/cogl.h.in: Add sections in the header file.
Bug #930 - add support for quartz imagebackend
* clutter/cogl/common/cogl-bitmap-pixbuf.c
(_cogl_bitmap_from_file): When USE_QUARTZ is defined implement
using Core Graphics.
* configure.ac: support --with-imagebackend=quartz and print
which imagebackend is selected. Make quartz default on OSX
(clutter_stage_egl_realize): Use ES 2 renderable type when
building for GLES 2.
* clutter/eglnative/clutter-event-egl.c (get_backend_time): Added
a NULL for the microseconds parameter of g_timer_elapsed.
* clutter/eglnative/clutter-stage-egl.h:
* clutter/eglnative/clutter-egl.h:
* clutter/eglnative/clutter-backend-egl.h: Include
clutter-egl-headers.h instead of including the GL headers directly
so it can include gl2.h when building for GLES 2.
* clutter/eglnative/clutter-egl-headers.h:
* clutter/eglnative/Makefile.am (libclutter_eglnative_la_SOURCES):
Added clutter-egl-headers.h
* clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: GLES 2
doesn't provide a default precision for floats in the fragment
shader and it will reject the shader if there isn't one.
Bug #948 - Remove texture rectangle support
* clutter/clutter-feature.c:
* clutter/clutter-feature.h:
* clutter/clutter-texture.c:
* clutter/cogl/gl/cogl.c:
* clutter/glx/clutter-glx-texture-pixmap.c:
Remove support for GL_TEXTURE_RECTANGLE_ARB (now using just regular
2D textures, with optional npots extension). Simplifys code, + makes
mipmap & shader support much more sane.
Bug 913 - cogl fails to build on OSX
* clutter/cogl/gl/cogl-fbo.c: define GL_READ_FRAMEBUFFER_EXT and
GL_DRAW_FRAMEBUFFER_EXT if not defined in the build system. The
#ifdef can fail if they're not #defines but variables or enums.
As the values are supposed to be industry standard even then
it shouldn't have ill effects.
* clutter/cogl/gles/cogl.c:
* clutter/cogl/gl/cogl.c: The clip planes are now set using the
inverse projection matrix as the modelview matrix so that they can
be specified in screen coordinates.
* clutter/cogl/gles/cogl-context.h (CoglContext):
* clutter/cogl/gl/cogl-context.h (CoglContext): Added a member to
cache the inverse projection matrix
* clutter/clutter-fixed.h: Added a constant for converting from
radians to degrees.
* clutter/clutter-fixed.c (clutter_atani, clutter_atan2i): Added
fixed-point versions of atan and atan2.
* tests/test-clip.c: Added a test for clipping with various
rotations and depths.
* tests/Makefile.am (noinst_PROGRAMS): Added test-clip
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}
uniforms for alpha testing.
* clutter/cogl/gles/cogl-gles2-wrapper.c
(cogl_gles2_wrapper_init): Get the uniforms for alpha testing
settings.
(cogl_wrap_glEnable, cogl_wrap_glDisable): Enable/disable alpha
testing.
(cogl_wrap_glAlphaFunc): Filled in the wrapper.
* clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: Added alpha
testing.
* clutter/cogl/gles/cogl-gles2-wrapper.h:
* clutter/cogl/gles/cogl-gles2-wrapper.c
(cogl_wrap_glGetIntegerv): Added a wrapper for glGetIntegerv so
that it can report zero clip planes.
* clutter/cogl/gles/cogl.c:
* clutter/cogl/gles/cogl-texture.c: Use the wrapped version of
glGetIntegerv
* clutter/cogl/gles/cogl-primitives.c (_cogl_path_fill_nodes): Use
_cogl_features_available to check for the stencil buffer instead
of an #ifdef. The stencil buffer is available in the default
profile for the GLES 2 simulator.
(cogl_gles2_wrapper_init): Get uniforms for fog parameters and
initialise them.
(cogl_wrap_glDrawArrays): Store the modelview matrix in a uniform
as well so that it can be used for fogging calculations.
(cogl_wrap_glEnable, cogl_wrap_glDisable): Enable/disable fogging.
(cogl_wrap_glFogx, cogl_wrap_glFogxv): Fill in wrapper to set
fogging parameters.
* clutter/cogl/gles/cogl-fixed-vertex-shader.glsl: Calculate the
fog amount if fogging is enabled.
* clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: Mix with fog
color.
* clutter/cogl/gles/cogl-gles2-wrapper.h (CoglGles2Wrapper): Add
uniforms for fogging.
glTexParameteri. Call glGenerateMipmap after every change to the
texture image data.
* clutter/cogl/gles/cogl-gles2-wrapper.h:
* clutter/cogl/gles/cogl-gles2-wrapper.c: Added a wrapper for
glTexParameteri so that it can ignore requests to set
GL_GENERATE_MIPMAP. Added a wrapper for glGenerateMipmap that does
nothing on GLES 1
* clutter/eglx/clutter-stage-egl.h:
* clutter/eglx/clutter-egl-headers.h:
* clutter/eglx/clutter-backend-egl.h:
* clutter/eglx/Makefile.am: Include the GLES and EGL headers via
clutter-egl-headers.h so that the right version can be used
depending on whether the GLES 2 wrapper is being used.
* configure.ac: Added an automake conditional for whether the GLES
2 wrapper should be used.
* clutter/eglx/clutter-stage-egl.c (clutter_stage_egl_realize):
Remove the call to glGetIntegerv to get the max texture size. It
was being called before the GL context was bound so it didn't work
anyway and it was causing trouble for the GLES 2 simulator.
* clutter/cogl/gles/stringify.sh: Shell script to convert the
shaders into a C string.
* clutter/cogl/gles/cogl-gles2-wrapper.h:
* clutter/cogl/gles/cogl-gles2-wrapper.c: Wrappers for most of the
missing GL functions in GLES 2.
* clutter/cogl/gles/cogl-fixed-fragment-shader.glsl:
* clutter/cogl/gles/cogl-fixed-vertex-shader.glsl: New shaders for
GLES 2
* clutter/cogl/gles/cogl-defines.h.in: Use the @CLUTTER_GL_HEADER@
macro instead of always using the GLES 1 header.
* clutter/cogl/gles/cogl-context.h (CoglContext): Include a field
for the state of the GLES 2 wrapper.
* clutter/cogl/gles/cogl-texture.c:
* clutter/cogl/gles/cogl-primitives.c:
* clutter/cogl/gles/cogl.c: Use wrapped versions of the GL
functions where neccessary.
* clutter/cogl/gles/Makefile.am: Add sources for the GLES 2
wrapper and an extra build step to put the GLSL files into a C
string whenever the files change.
Bug #912 - Invalid use of int* as parameter for glGetIntegerv
* clutter/cogl/gl/cogl.c (_cogl_features_init): Use GLint
instead of int. (#912, Tommi Komulainen)
* clutter/cogl/gles/cogl.c (error_string): Rename to
_cogl_error_string and remove the static scoping so that it can be
called in cogl-texture etc.
* clutter/cogl/gl/cogl-texture.c (cogl_texture_new_from_foreign):
* clutter/cogl/gles/cogl-texture.c (cogl_texture_new_from_foreign):
GE(*) can't be used to wrap around calls that use the return
value.
* clutter/cogl/gl/cogl-texture.c (_cogl_texture_quad_sw)
(_cogl_texture_quad_hw, cogl_texture_polygon): Remove GE(*)
wrapper around calls in the middle of a glBegin/glEnd pair which
otherwise always generate an error because glGetError can only be
called outside of the pair.
* clutter/cogl/gl/cogl-internal.h: Include stdio.h when definig
COGL_DEBUG and declare a prototype for _cogl_error_string.
* clutter/cogl/gles/cogl-internal.h: Match GE(*) macro to GL
version.
(cogl_texture_download_from_gl:) Implemented a workaround
for missing alpha framebuffer channel. There are still
some issues with detecting whether alpha is present in the
framebuffer. See comments in code. Test-cogl-tex-getset now
successfully retrieves a RGBA texture image data.