The tesselator code uses some defines that it expects to be in the GL
headers such as GLAPI and GLAPIENTRY. These are used to mark the entry
points as exportable on each platform. We don't really want the
tesselator code to use these but we also don't want to modify the C
files so instead they are #defined to be empty in the stub glu.h. That
header is only included internally when building the tesselator/ files
so it shouldn't affect the rest of Cogl.
GLES also doesn't have a GLdouble type so we just #define this to be a
regular double.
cogl_material_copy was taking a reference on the original texture when
making a copy. However it then calls _cogl_material_set_parent on the
material which also takes a reference on the parent. The second
reference is cleaned up whenever _cogl_material_unparent is called and
this is also called by _cogl_material_free. However, it seems that
nothing was cleaning up the first reference. I think the reference is
entirely unnecessary so this patch removes it.
The AlignConstraint update is using only the width/height of the source,
but it should also take into account the position.
Also, instead of using the ::notify signal, it should follow the
BindConstraint, and switch to the ::allocation-changed signal, since
it's less expensive (one emission instead of four notifications, one for
each property we use).
Create two HTML versions of the cookbook:
• single page
• multiple pages
Use the online version of the DocBook XHTML XSL, and disable the PDF
generation until we can restore it.
We had several different ways of exposing experimental API, in one case
the symbols had no special suffix, in two other ways the symbols were
given an _EXP suffix but in different ways.
This makes all experimental API have an _EXP suffix which is handled
using #defines in the header so the prototypes in the .c and .h files
don't have the suffix.
The documented reason for the suffix is so that anyone watching Cogl for
ABI changes who sees symbols disappear will hopefully understand what's
going on.
Use a modified version of the Poky Handbook CSS for the HTML version of
the Cookbook.
Promote Elliot as author.
Re-license from the GPLv2.0 to the CC BY-NC-SA 2.0.
This grabs the latest code for libtess from git Mesa. This is mostly
so that we can get the following commit which fixes a lot of compiler
warnings in Clutter:
commit 75acb896c6da758d03e86f8725d6ca0cb2c6ad82
Author: Neil Roberts <neil@linux.intel.com>
Date: Wed Jun 30 12:41:11 2010 +0100
glu: Fix some compiler warnings in libtess
When compiled with the more aggressive compiler warnings such as
-Wshadow and -Wempty-body the libtess code gives a lot more
warnings. This fixes the following issues:
* The 'Swap' macro tries to combine multiple statements into one and
then consume the trailing semicolon by using if(1){/*...*/}else.
This gives warnings because the else part ends up with an empty
statement. It also seems a bit dangerous because if the semicolon
were missed then it would still be valid syntax but it would just
ignore the following statement. This patch replaces it with the more
common idiom do { /*...*/ } while(0).
* 'free' was being used as a local variable name but this shadows the
global function. This has been renamed to 'free_handle'
* TRUE and FALSE were being unconditionally defined. Although this
isn't currently a problem it seems better to guard them with #ifndef
because it's quite common for them to be defined in other headers.
https://bugs.freedesktop.org/show_bug.cgi?id=28845
The scanner has some issues when parsing valid gtk-doc annotations; we
should make its (and, in return, ours) life easier.
We still get warnings for code declared in <programlisting> sections,
unfortunately.
As part of the ongoing effort to remove CoglHandle from the API this
switches the cogl_material API to use a strongly typed CoglMaterial
pointer instead of CoglHandle.
This splits the fragment processing backends (glsl, arbfp and fixed) out
from cogl-material.c into their own cogl-material-{glsl,arbfp,fixed}.c
files in an effort to help and keep cogl-material.c maintainable.
If the backend was disposed then priv->font_name would be freed but not
set to NULL and so if clutter_backend_get_font_name was then called it
would double free priv->font_name.
Apparently, xsltproc recognizes a directory if it has a '/' at the end
of its path, and not by doing the sensible thing and stat()'ing the
argument for the --output option.
This creates a path with an outer clockwise and two internal sub
paths, one clockwise and one counter-clockwise. The path is then
painted twice, once with each fill rule.
This adds two new API calls- cogl_path_set_fill_rule and
cogl_path_get_fill_rule. This allows modifying the fill rule of the
current path. In addition to the previous default fill rule of
'even-odd' it now supports the 'non-zero' rule. The fill rule is a
property of the path (not the Cogl context) so creating a new path or
preserving a path with cogl_path_get_handle affects the fill rule.
The scanline path rasterizer has been removed because the paths can be
drawn with the tesselator instead. The option therefore no longer does
anything.
Instead of drawing paths using the stencil buffer trick, it now
tesselates the path into triangles using the GLU tesselator and
renders them directly. A vbo is created with one vertex for each node
on the path. The tesselator is used to generate a series of indices
into the vbo as triangles. The tesselator's output of strips and fans
is converted into GL_TRIANGLES so that it can be rendered with a
single draw call (but the vertices are still shared via the
indices). The vbo is stored with the path so that if the application
uses retained paths then Cogl won't have to tessellate again.
The vertices also have texture coordinates associated with them so
that it can replicate the old behaviour of drawing a material with a
texture by fitting the texture to the bounding box of the path and
then clipping it. However if the texture contains waste or is sliced
then the vertex buffer code will refuse to draw it. In this case it
will revert back to drawing the path into the stencil buffer and then
drawing the material as a clipped quad.
The VBO is used even when setting up the stencil buffer for clipping
to a path because the tessellated geometry may cover less area.
The old scanline rasterizer has been removed because the tesselator
should work equally well on drivers with no stencil buffer.
This copies the files for the GLU tesselator from Mesa. The Mesa code
is based on the original SGI code and is released under a BSD license.
The memalloc.h header has been replaced with one that forces the code
to use g_malloc and friends. The rest of the files are not altered
from the original so it should be possible to later upgrade the files
by simply overwriting them.
There is a tesselator.h header which is expected to be included by
rest of Cogl to use the tesselator. This contains a trimmed down
version of glu.h that only includes parts that pertain to the
tesselator. There is also a stub glu.h in the GL directory which is
just provided so that the tesselator code can include <GL/gl.h>
without depending on the system header. It just redirects to
tesselator.h
Attached patch contains a cookbook recipe about key press event
handling.
It covers both a simple approach (connecting a callback to a
key-press-event signal which manually analyses the key and
modifiers), and a more complicated one based on a binding pool.
There's also some discussion of the two approaches.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2162
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
The cookbook contains a commented-out recipe covering scaling images
inside a texture while retaining their aspect ratio; the attached
patch fleshes out this recipe.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2163
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
A typo in clutter-event.c meant that the wrong struct location could be
used for the input device of key events. Also, a typo in the X11 event
code meant that key-presses would come from the pointer device (releases
would still come from the keyboard device).
Allow using the BindConstraint to bind width and height of a source
actor.
Also, add a test for the BindConstraint showing all types of usages
for this constraint class.
Some of the arguments to the material and path functions were taking a
pointer to a CoglColor or an array of floats that was not intended to
be written to but were not marked with const.
Update the documentation of :font-name, to make it clear that by setting
it to NULL the Text actor will use the default font.
Also, set the annotation for the @font_name argument of the setter to be
allow-none, and allow passing NULL through bindings.
If a ClutterText actor is using the default font from the backend then
we should track font name changes and update it accordingly. This only
applies to ClutterText actors with the :font-name property unset or
explicitly set to NULL.