ClutterListModel has been added as a terminal class in case we
decided to change API or implementation.
Apparently, it's a lot more resilient than we expected -- or far
too few are using it and reporting bugs. Once common issue, though,
is that it cannot be subclassed, hence it's fairly limited in its
usage.
In the hope that more developers will start using it, here's a
patch that makes ListModel a fully subclassable object.
May whatever god you believe in have mercy on your eventual soul.
The main COGL header file is generated at configure time. If something
changes in the template, though, the file will not be regenerated.
Adding cogl.h to the BUILT_SOURCES list will allow the regeneration to
happen.
Key events can come from different input devices, so they need a
ClutterInputDevice member like the pointer-related events. This
field is reserved for future use.
To convert from a TextureQuality to a COGL filter enumeration
we need to perform two function calls. Since we need both filters
when calling cogl_texture_set_filters() we can safely consolidate
the two conversion functions into one. This also allows using a
shorter function name, thus reducing the lenght of the lines
involved and, more importantly preventing Emmanuele from crying.
The test no longer requires an XID argument to run; instead it creates its
own X Window. The test now also aims to demonstrate whether mipmapping is
working, and clearly informs you if fallbacks are being used for GLX tfp.
This hides a number of internal structs and enums from the docs, and moves
some functions to more appropriate sections as well as misc description
updates (mostly for the vertex buffer api)
Fixes some blending issues when using color arrays since we were
conflicting with the cogl_enable state + fixes a texture layer
validation bug.
Adds a basic textured triangle to test-vertex-buffer-contiguous.
The test simply creates an odd sized texture with different colors at
each of the four corners. It then renders the texture and verifies
that the colors are the expected values. This should help ensure that
the sliced texture rendering code is working properly.
Otherwise if the dipose method is called twice the material will
already be destroyed when texture_free_gl_resources is called so it
will issue a warning about an invalid handle.
When the quad log contains multiple textures (such as when a sliced
texture is drawn) it dispatches the log with multiple calls to
flush_quad_batch and walks a pointer along the list of vertices.
However this pointer was being incremented by only one vertex so the
next quad would be drawn with three of the vertices from the last
quad.
The 'no_slice' property means the texture should never be sliced. We
want cogl to create a texture with any amount of waste so we pass
max_waste as -1. However this got broken in commit 168d55 so that the
meaning got negated (no_slice enabled slicing).
The current code that handles the invariant that the new parent
of an actor needing a layout should also be queued for relayout
is hitting the short-circuiting we do in the queue_relayout()
method.
In order to fix this we can forcibly set the actor to need a
width/height request and an allocation; then we queue a relayout
on the parent.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
The :alignment property is prone to generate confusion: developers
will set it thinking that the contents of a ClutterText will
automagically align themselves.
Instead of using the generic term :alignment, and following the
GTK+ convention, we should use a more specific term, conveying the
actual effect of the property: alignment of the lines with respect
to each other, and not to the overall allocated area.
See bug 1428:
http://bugzilla.openedhand.com/show_bug.cgi?id=1428
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.
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.
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.
- 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.
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.
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.
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.
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.
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).
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.
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.
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.
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
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.
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.)
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.
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.
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.