When cogl_texture_new_from_data() fails in clutter_texture_set_from_data()
and no GError is provided, the clutter app will segfault when dereferencing
the GError ** and emitting LOAD_FINISHED signal.
Based on a patch by: Haakon Sporsheim <haakon.sporsheim@gmail.com>
http://bugzilla.openedhand.com/show_bug.cgi?id=1806
Some changes to make COGL pass distcheck with Automake 1.11 and
anal-retentiveness turned up to 11.
The "major" change is the flattening of the winsys/ part of COGL,
which is built directly inside libclutter-cogl.la instead of an
intermediate libclutter-cogl-winsys.la object.
Ideally, the whole COGL should be flattened out using a
quasi-non-recursive Automake layout; unfortunately, the driver/
sub-section ships with identical targets and Automake cannot
distinguish GL and GLES objects.
If an actor calls directly or indirectly clutter_actor_queue_relayout()
on itself from within the allocate() implementation it will cause a
relayout cycle. This is usually a condition that should be checked by
ClutterActor and we should emit a warning if it is verified.
ClutterActor should check whether the current instance is being
destroyed and avoid performing operations like:
• queueing redraws
• queueing relayouts
It should also warn if the actor is being parented to an actor
currently being destroyed.
When showing a warning in the state checks we perform to verify that
the invariants are maintained when showing, mapping and realizing, we
should also print out the name of the actor failing the checks. If the
actor has no name, the GType name should be used as a fallback.
When defining an Alpha in ClutterScript we should allow setting
the alpha function by using a custom property. This makes it
possible to have both:
{
"id" : "behaviour-1",
"type" : "ClutterBehaviourDepth",
"alpha" : { "timeline" : "timeline-1", "function" : "alpha_func" },
...
}
And:
{
"id" : "alpha-1",
"type" : "ClutterAlpha",
"timeline" : "timeline-1",
"function" : "alpha_func"
},
{
"id" : "behaviour-1",
"type" : "ClutterBehaviourDepth",
"alpha" : "alpha-1",
...
}
The latter allows defining a single alpha function for multiple
behaviours.
The block that allows setting a GObject property holding an object
instance is conditionally depending on the USE_PIXBUF define. This
makes it impossible to reference an object inside ClutterScript on
platforms not using GdkPixbuf.
When an actor is hidden, the parent actor is not required to
size request or allocate it. (ClutterGroup does, but, for example,
NbtkBoxLayout doesn't.) This means that the
needs_width_request/needs_height_request/needs_allocate can be
stale when we go to show it again - they are set for the actor
but not the parent. Explicitly setting them to FALSE avoids
clutter_actor_relayout() improperly short-circuiting.
http://bugzilla.openedhand.com/show_bug.cgi?id=1831
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
The change in commit 3bbc96e17e moved the
:text property setter to use set_text_internal(); this function does not
invalidate the Layout cache and does not queue a relayout, thus breaking
the behaviour of ClutterText when setting the contents of the actor using
the property.
http://bugzilla.openedhand.com/show_bug.cgi?id=1851
Since we no longer depend on the GL matrix API in Cogl we can remove a lot
of wrapper code from the GLES 2 backend. This is particularly nice given
that there was no code shared between the cogl-matrix-stack API and gles2
wrappers so we had a lot of duplicated logic.
The indirection through this API isn't necessary since we no longer
arbitrate between the OpenGL matrix API and Cogl's client side API. Also it
doesn't help to maintain an OpenGL style matrix mode API for internal use
since it's awkward to keep restoring the MODELVIEW mode and easy enough to
directly work with the matrix stacks of interest.
This replaces use of the _cogl_current_matrix API with direct use of the
_cogl_matrix_stack API. All the unused cogl_current_matrix API is removed
and the matrix utility code left in cogl-current-matrix.c was moved to
cogl.c.
This cache of the gl matrix mode lets us avoid repeat calls to glMatrixMode
in _cogl_matrix_stack_flush_to_gl when we have lots of sequential modelview
matrix modifications.
This goes a bit further than the previous patch, and as a special case
we now simply represent identity matrices using a boolean, and only
lazily initialize them when they need to be modified.
The journal always uses an identity matrix since it uses software
transformation. Currently it manually uses glLoadMatrix since previous
experimentation showed that the cogl-matrix-stack gave bad performance, but
it would be nice to fix performance so we only have to care about one path
for loading matrices.
For the common case where we do:
cogl_matrix_stack_push()
cogl_matrix_stack_load_identity()
we were effectively initializing the matrix 3 times. Once due to use of
g_slice_new0, then we had a cogl_matrix_init_identity in
_cogl_matrix_state_new for good measure, and then finally in
cogl_matrix_stack_load_identity we did another cogl_matrix_init_identity.
We don't use g_slice_new0 anymore, _cogl_matrix_state_new is documented as
not initializing the matrix (instead _cogl_matrix_stack_top_mutable now
takes a boolean to choose if new stack entries should be initialised) and so
we now only initialize once in cogl_matrix_stack_load_identity.
This relates back to an earlier commitment to stop using the OpenGL matrix
API which is considered deprecated. (ref 54159f5a1d)
The new texture matrix stacks are hung from a list of (internal only)
CoglTextureUnit structures which the CoglMaterial code internally references
via _cogl_get_texure_unit ().
So we would be left with only the cogl-matrix-stack code being responsible
for glMatrixMode, glLoadMatrix and glLoadIdentity this commit updates the
journal code so it now uses the matrix-stack API instead of GL directly.
• Fix list_stages() and peek_stages() documentation
• Fix clutter_text_set_preedit_string() arguments in the header
to match source and documentation
• Add clutter_units_cm() to the private section for Units
• Rename the LayoutManager section
• Add FlowLayout:homogeneous accessors
* layout-manager: (50 commits)
docs: Reword a link
layout, docs: Add more documentation to LayoutManager
layout, docs: Fix description of Bin properties
layout, bin: Use ceilf() instead of casting to int
layout, docs: Add long description for FlowLayout
layout, box: Clean up
layout, box: Write long description for Box
layout, docs: Remove unused functions
layout: Document BoxLayout
layout: Add BoxLayout, a single line layout manager
layout: Report the correct size of FlowLayout
layout: Resizing the stage resizes the FlowLayout box
layout: Use the get_request_mode() getter in BinLayout
layout: Change the request-mode along with the orientation
actor: Add set_request_mode() method
[layout] Remove FlowLayout:wrap
[layout] Rename BinLayout and FlowLayout interactive tests
[layout] Skip invisible children in FlowLayout
[layout] Clean up and document FlowLayout
[layout] Snap children of FlowLayout to column/row
...
The layout manager reference should have some documentation on how
to use a LayoutManager object inside a container and how to implement
a LayoutManager sub-class correctly.
The JSON conditional rules can be moved outside the introspection
conditional ones to avoid a nested check, as all the JSON rules do
is setting up variables that may or may not be used.
The Journal can be considered a standalone component, so even though
it's currently only used to log quads, it seems better to split it
out into its own file.
The additional check draws another front facing rectangle but this time with
the texture coords flipped on the x axis. The code that handles sliced
textures in cogl-primitives.c makes some suspicious changes to the geometry
when the texture coords are inverted.
When we implement atlas textures we will probably want to use the spans API
to handle texture repeating so it doesn't make sense to leave the code in
cogl-texture-2d-sliced.c. Since it's a standalone set of data structures
and algorithms it also seems reasonable to split out from cogl-texture.
cogl-texture-2d-sliced provides an implementation of CoglTexture and this
seperation lays the foundation for potentially supporting atlas textures,
pixmap textures (as in GLX_EXT_texture_from_pixmap) and fast-path
GL_TEXTURE_{1D,2D,3D,RECTANGLE} textures in a maintainable fashion.
cogl-primitives.c was previously digging right into CoglTextures so it could
manually iterate the texture slices for texturing quads and polygons and
because we were missing some state getters we were lazily just poking into
the structures directly.
This adds some extra state getter functions, and adds a higher level
_cogl_texture_foreach_slice () API that hopefully simplifies the way in
which sliced textures may be used to render primitives. This lets you
specify a rectangle in "virtual" texture coords and it will call a given
callback for each slice that intersects that rectangle giving the virtual
coords of the current slice and corresponding "real" texture coordinates for
the underlying gl texture.
At the same time a noteable bug in how we previously iterated sliced
textures was fixed, whereby we weren't correctly handling inverted texture
coordinates. E.g. with the previous code if you supplied texture coords of
tx1=100,ty1=0,tx2=0,ty2=100 (inverted along y axis) that would result in a
back-facing quad, which could be discarded if using back-face culling.
The descriptions for gl_handle and gl_target were inverted.
Thanks to Young-Ho Cha for spotting that.
Signed-off-by: Robert Bragg <robert@linux.intel.com>