Emmanuele Bassi [Thu, 18 Nov 2010 14:14:37 +0000 (14:14 +0000)]
docs: Fix some wrong function/signal/property names
Emmanuele Bassi [Wed, 17 Nov 2010 15:51:35 +0000 (15:51 +0000)]
test-layout: Port away from Behaviour
Use a simple animation with a looping+reversing timeline.
Emmanuele Bassi [Wed, 10 Nov 2010 11:51:42 +0000 (11:51 +0000)]
test-rotate: Remove the behaviour code
Use a looping animation with a shared timeline instead.
Emmanuele Bassi [Wed, 10 Nov 2010 13:15:06 +0000 (13:15 +0000)]
docs: Add Behaviour migration guide
Emmanuele Bassi [Sat, 6 Nov 2010 15:54:21 +0000 (15:54 +0000)]
Deprecate ClutterBehaviour and sub-classes
The Behaviour class and its implementations have been replaced by the
new animation framework API and by the constraints for layout-related
animations.
Currently, we need to make tests build, so we undef DISABLE_DEPRECATED
in specific test cases while they get ported.
Emmanuele Bassi [Wed, 17 Nov 2010 15:27:42 +0000 (15:27 +0000)]
timeline: Add :reverse property
The :reverse property removes the pattern of connecting to the
::completed signal of a Timeline to change the direction.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2408
Emmanuele Bassi [Thu, 18 Nov 2010 14:02:52 +0000 (14:02 +0000)]
docs: Remove unnecessary '#'
The hash is confusing gtk-doc.
Emmanuele Bassi [Thu, 18 Nov 2010 10:53:01 +0000 (10:53 +0000)]
paint-volume: Do not take a reference on the actor
The paint volume structure is cached in the Actor it references, and
this causes a reference cycle.
The paint volume is going to be used when painting, so the actor must
still be valid - otherwise Clutter will bail out far before than
accessing the actor pointer in ClutterPaintVolume.
Otherwise, we could have used dispose() to check for a valid actor and
remove a reference if the actor field is !NULL; it feels less clean,
though, since we're effectively managing an extra reference on
ourselves.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2431
Emmanuele Bassi [Thu, 18 Nov 2010 11:00:08 +0000 (11:00 +0000)]
actor: Group bitfields together
Emmanuele Bassi [Wed, 17 Nov 2010 19:13:55 +0000 (19:13 +0000)]
build: Cogl-2.0 API reference should be conditionally built
Building the API reference for Cogl 2.0 is fairly confusing: the API
itself is experimental and for internal use only -- though we want
feedback for it.
Let's build the API reference only when Clutter is configured with a
specific configure switch, so that people that wish to give feedback on
the API and its documentation can do it.
Emmanuele Bassi [Sun, 7 Nov 2010 16:20:51 +0000 (16:20 +0000)]
Start using the monotonic API in GLib ≥ 2.27
Starting from the 2.27 cycle, GLib is exposing a monotonic clock with
microseconds granularity throughout the time-based API. We can start
using it, given that the old, non-monotonic version is going to be
deprecated by the same cycle.
Emmanuele Bassi [Sun, 7 Nov 2010 15:57:33 +0000 (15:57 +0000)]
Move away from GTimeVal
GLib 2.28 will deprecate GTimeVal and related API in favour of
standardizing on microseconds granularity for all time-based API.
Clutter should switch too.
All of the current users of GTimeVal convert to milliseconds when
doing time operations, and use GTimeVal only as storage. This can
effectively be replaced by a gint64.
The Master Clock uses a microsecond resolution, except when interacting
with the main loop itself, since the main loop has a millisecond
resolution - at least until Ryan Lortie manages to switch that too to
microseconds on Linux.
The clutter_timeline_do_tick() function was erroneously not privatized,
but it was still assumed to be private; we should just remove it from
the public symbols.
Emmanuele Bassi [Wed, 17 Nov 2010 12:49:10 +0000 (12:49 +0000)]
docs: Move the constraints example picture about the source code
Emmanuele Bassi [Wed, 17 Nov 2010 12:47:46 +0000 (12:47 +0000)]
shaders: Fix the usage of the Cogl GLSL variables
Emmanuele Bassi [Wed, 17 Nov 2010 12:14:02 +0000 (12:14 +0000)]
docs: Fix closing tag
Emmanuele Bassi [Mon, 15 Nov 2010 16:30:12 +0000 (16:30 +0000)]
actor: Simple show/hide optimizations
Showing a visible (and hiding an invisible) actor is far less cheap than
it should be.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2422
muflone [Mon, 15 Nov 2010 17:54:01 +0000 (17:54 +0000)]
po: Update Italian translation
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Tue, 16 Nov 2010 17:18:50 +0000 (17:18 +0000)]
docs: Break down the constraints example
Emmanuele Bassi [Mon, 15 Nov 2010 17:27:46 +0000 (17:27 +0000)]
docs: Update the constraints example image
Emmanuele Bassi [Mon, 15 Nov 2010 16:02:15 +0000 (16:02 +0000)]
docs: Fix Since tags for PaintVolume-related API
Emmanuele Bassi [Mon, 15 Nov 2010 15:02:07 +0000 (15:02 +0000)]
docs: Add introductory section on Constraints
Use the snap-constraint code for the example code and screenshot.
Emmanuele Bassi [Wed, 10 Nov 2010 16:37:34 +0000 (16:37 +0000)]
Add SnapConstraint
A SnapConstraint is a constraint that "snaps" the edges of two actors
together.
Emmanuele Bassi [Fri, 12 Nov 2010 18:09:25 +0000 (18:09 +0000)]
actor: Do not queue relayouts on actors being destroyed
Simple optimization is simple.
Emmanuele Bassi [Fri, 12 Nov 2010 18:07:44 +0000 (18:07 +0000)]
actor: Add a get_debug_name() private Actor method
For internal usage, writing:
clutter_actor_get_name (actor) != NULL
? clutter_actor_get_name (actor)
: G_OBJECT_TYPE_NAME (actor)
is overly verbose and does two type checks. A simple, internal method
for getting the same result without type checks would be much more
appreciated.
Emmanuele Bassi [Mon, 15 Nov 2010 15:41:46 +0000 (15:41 +0000)]
Merge remote branch 'elliot/cookbook-opacity-values-fix'
* elliot/cookbook-opacity-values-fix:
cookbook: Fix opacity examples in recipe
cookbook: Fix incorrect value for opacity
Emmanuele Bassi [Mon, 15 Nov 2010 15:37:42 +0000 (15:37 +0000)]
Merge remote branch 'elliot/cookbook-animations-looping'
* elliot/cookbook-animations-looping:
cookbook: Recipe for "looping animations"
cookbook: Clarify how signals are emitted during looped animation
cookbook: First draft for looping animations recipe
cookbook: Recipe skeleton for "looping animations"
cookbook: Looping animation examples
Emmanuele Bassi [Mon, 15 Nov 2010 15:36:41 +0000 (15:36 +0000)]
Fix compilation warning by using the correct type
Emmanuele Bassi [Mon, 15 Nov 2010 15:26:07 +0000 (15:26 +0000)]
Merge remote branch 'elliot/c90-fix'
Elliot Smith [Mon, 15 Nov 2010 11:18:26 +0000 (11:18 +0000)]
cookbook: Recipe for "looping animations"
Added a recipe giving examples of how to loop
animations for each part of the animation API (implicit,
animator, state).
The discussion covers looping a fixed number of times
and inverting a single implicit animation to create
a loop which goes back to its start on each iteration.
Elliot Smith [Thu, 11 Nov 2010 12:04:20 +0000 (12:04 +0000)]
cookbook: Clarify how signals are emitted during looped animation
Added a comment to the example code about how timeline
emits "completed" during looped animation, while the
animation itself doesn't.
Elliot Smith [Thu, 11 Nov 2010 11:44:28 +0000 (11:44 +0000)]
cookbook: First draft for looping animations recipe
Includes video showing the looped animation and
basic section headings, plus outline of content and notes.
Elliot Smith [Wed, 10 Nov 2010 17:43:28 +0000 (17:43 +0000)]
cookbook: Recipe skeleton for "looping animations"
Elliot Smith [Wed, 10 Nov 2010 16:11:27 +0000 (16:11 +0000)]
cookbook: Looping animation examples
Added code examples for creating a looped animation with
each of the animation approaches (implicit, ClutterAnimation,
ClutterState).
Emmanuele Bassi [Sun, 14 Nov 2010 23:06:53 +0000 (23:06 +0000)]
Use the right string in the font settings debug blurb
Emmanuele Bassi [Sun, 14 Nov 2010 15:23:36 +0000 (15:23 +0000)]
text: Do not segfault with NULL :font-name
Make sure that we have a fall back in place for the default font name
string, and use g_strcmp0 to protect ourselves from NULL strings.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2417
Owen W. Taylor [Fri, 12 Nov 2010 23:53:51 +0000 (18:53 -0500)]
xsettings: don't use the xsettings watch function functionality
The "watch" function functionality in xsettings-client.c is designed
for setups like GDK where filters are per-window. If we are going
to pass all events to _clutter_xsettings_client_process_event()
anyways, we can just pass in NULL for watch.
This avoids a nasty infinite loop where an event would get processed
triggering removing a filter and adding a new filter, which would
immediately run and remove a filter and add another and so on
ad-infinitum.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2415
Elliot Smith [Fri, 12 Nov 2010 09:32:04 +0000 (09:32 +0000)]
cookbook: Make example code C90 compliant
Modified all cookbook example code to prevent ISO C90 compliance
warnings occurring during compilation.
Elliot Smith [Fri, 12 Nov 2010 09:54:12 +0000 (09:54 +0000)]
cookbook: Fix opacity examples in recipe
The recipe had examples where opacity was set using
fractional numbers. Fixed all examples to use
integers only.
Elliot Smith [Fri, 12 Nov 2010 09:49:07 +0000 (09:49 +0000)]
cookbook: Fix incorrect value for opacity
Opacity is a guint, so don't use floating point numbers
to set its value.
Lucas Rocha [Thu, 11 Nov 2010 22:23:09 +0000 (22:23 +0000)]
click-action: don't use pointer grabs
The same behavior can be achieved by capturing events on stage while
button is pressed. This fixes a problem when using click and drag
actions on the same actor as there no grabs involved.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2409
Emmanuele Bassi [Thu, 11 Nov 2010 17:53:42 +0000 (17:53 +0000)]
Merge branch 'wip/static-colors'
* wip/static-colors:
Move tests to static colors where possible
color: Add named, global colors
Emmanuele Bassi [Thu, 11 Nov 2010 14:05:36 +0000 (14:05 +0000)]
Add cogl-2.0 reference in the ignore file
Neil Roberts [Thu, 11 Nov 2010 16:24:54 +0000 (16:24 +0000)]
cogl-texture: Remove the gl_handle from CoglTextureSliceCallback
There's no longer any need to use the GL handle in the callback for
_cogl_texture_foreach_sub_texture_in_region because it can now work in
terms of primitive cogl textures so it has now been removed. This
would be helpful if we ever want to make the foreach function public
so that apps could implement their own primitives using sliced
textures.
Neil Roberts [Thu, 11 Nov 2010 16:18:25 +0000 (16:18 +0000)]
cogl-pipeline: Use layer overrides as CoglHandles instead of GLuint
Since
d5634e37 the sliced texture backend now works in terms of
CoglTexture2Ds so there's no need to have special casing for
overriding the texture of a pipeline layer with a GL handle. Instead
we can just use cogl_pipeline_set_layer_texture with the
CoglHandle. The special _cogl_pipeline_set_layer_gl_texture_slice
function has now been removed and parts of the code for comparing
materials have been simplified.
Neil Roberts [Thu, 11 Nov 2010 15:42:12 +0000 (15:42 +0000)]
CoglTexture2DSliced: Pass slice tex to callback in foreach_sub_texture
The cogl_texture_foreach_sub_texture_in_region virtual for the sliced
texture backend was previously passing the CoglHandle of the sliced
texture to the callback. Since
d5634e37 the slice texture backend now
works in terms of 2D textures so it's possible to pass the underlying
slice texture as a handle too. This makes all of the foreach callbacks
consistent in that they pass a CoglHandle of the primitive texture
type that matches the GL handle.
Robert Bragg [Thu, 4 Nov 2010 00:43:48 +0000 (00:43 +0000)]
docs: Adds an initial cogl-2.0 reference manual
So we can keep track of the experimental progress of Cogl 2.0 features
this adds a standalone Cogl 2.0 Reference Manual which doesn't cover
the deprecated 1.x symbols and removes the need for a "Cogl
experimental API" chapter since those sections now make up the main
table of contents.
Robert Bragg [Thu, 4 Nov 2010 00:27:47 +0000 (00:27 +0000)]
path 2.0: update path API for experimental 2.0 API
When COGL_ENABLE_EXPERIMENTAL_2_0_API is defined cogl.h will now include
cogl2-path.h which changes cogl_path_new() so it can directly return a
CoglPath pointer; it no longer exposes a prototype for
cogl_{get,set}_path and all the remaining cogl_path_ functions now take
an explicit path as their first argument.
The idea is that we want to encourage developers to retain path objects
for as long as possible so they can take advantage of us uploading the
path geometry to the GPU. Currently although it is possible to start a
new path and query the current path, it is not convenient.
The other thing is that we want to get Cogl to the point where nothing
depends on a global, current context variable. This will allow us to one
day define a sensible threading model if/when that is ever desired.
Robert Bragg [Thu, 4 Nov 2010 14:22:24 +0000 (14:22 +0000)]
config.h: define COGL_ENABLE_EXPERIMENTAL_2_0_API
By defining COGL_ENABLE_EXPERIMENTAL_2_0_API in config.h we can ensure
that all internal clutter and cogl code can use the Cogl 2.0 API and by
not using AM_CPPFLAGS we avoid having other tools such as glib-mkenums
and the gir-scanner from inadvertently using the define also.
Robert Bragg [Wed, 3 Nov 2010 20:26:20 +0000 (20:26 +0000)]
cogl: Adds COGL_ENABLE_EXPERIMENTAL_2_0_API define
For now this new define is simply an alias for
COGL_ENABLE_EXPERIMENTAL_API but the intention is that we will also use
it to start experimenting with changes that need to break the existing
Cogl API in incompatible ways.
Emmanuele Bassi [Mon, 11 Oct 2010 16:45:30 +0000 (17:45 +0100)]
Move tests to static colors where possible
Emmanuele Bassi [Tue, 6 Apr 2010 09:54:20 +0000 (10:54 +0100)]
color: Add named, global colors
Since EGA colors are apparently all the rage in other toolkits, Clutter
should not be left out. On top of the usual CGA/EGA palette the static
colors also include the Tango Icon palette, which at least is more
pleasant to the eye.
Static colors are accessed through an enumeration by using
clutter_color_get_static(), or using the short-hand pre-processor
macros.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2066
Emmanuele Bassi [Thu, 11 Nov 2010 12:03:24 +0000 (12:03 +0000)]
build: Sanitize the hack for ACLOCAL_FLAGS
Move the ACLOCAL_FLAGS hack we have to use with jhbuild and autoreconf
inside the ACLOCAL_AMFLAGS declaration in Makefile.am, and leave
autogen.sh alone.
Emmanuele Bassi [Wed, 10 Nov 2010 16:37:44 +0000 (16:37 +0000)]
build: Hack build/autotools into autoreconf
Since we require a version of gettext that might not match the version
installed we need to hack the order of includes for autoreconf.
This hack should go away, and we should just use the installed copy of
gettext.
Robert Bragg [Fri, 23 Jul 2010 16:46:41 +0000 (17:46 +0100)]
cogl-shader: Prepend boilerplate for portable shaders
We now prepend a set of defines to any given GLSL shader so that we can
define builtin uniforms/attributes within the "cogl" namespace that we
can use to provide compatibility across a range of the earlier versions
of GLSL.
This updates test-cogl-shader-glsl.c and test-shader.c so they no longer
needs to special case GLES vs GL when splicing together its shaders as
well as the blur, colorize and desaturate effects.
To get a feel for the new, portable uniform/attribute names here are the
defines for OpenGL vertex shaders:
#define cogl_position_in gl_Vertex
#define cogl_color_in gl_Color
#define cogl_tex_coord_in gl_MultiTexCoord0
#define cogl_tex_coord0_in gl_MultiTexCoord0
#define cogl_tex_coord1_in gl_MultiTexCoord1
#define cogl_tex_coord2_in gl_MultiTexCoord2
#define cogl_tex_coord3_in gl_MultiTexCoord3
#define cogl_tex_coord4_in gl_MultiTexCoord4
#define cogl_tex_coord5_in gl_MultiTexCoord5
#define cogl_tex_coord6_in gl_MultiTexCoord6
#define cogl_tex_coord7_in gl_MultiTexCoord7
#define cogl_normal_in gl_Normal
#define cogl_position_out gl_Position
#define cogl_point_size_out gl_PointSize
#define cogl_color_out gl_FrontColor
#define cogl_tex_coord_out gl_TexCoord
#define cogl_modelview_matrix gl_ModelViewMatrix
#define cogl_modelview_projection_matrix gl_ModelViewProjectionMatrix
#define cogl_projection_matrix gl_ProjectionMatrix
#define cogl_texture_matrix gl_TextureMatrix
And for fragment shaders we have:
#define cogl_color_in gl_Color
#define cogl_tex_coord_in gl_TexCoord
#define cogl_color_out gl_FragColor
#define cogl_depth_out gl_FragDepth
#define cogl_front_facing gl_FrontFacing
Robert Bragg [Tue, 9 Nov 2010 15:56:03 +0000 (15:56 +0000)]
tests: test-cogl-shader-arbfp wasn't compiling shader
test-cogl-shader-arbfp was never calling cogl_shader_compile so it was a
fluke that it used to run before.
Emmanuele Bassi [Wed, 10 Nov 2010 13:59:09 +0000 (13:59 +0000)]
build: Honour ACLOCAL_FLAGS with autoreconf
Tomeu Vizoso [Wed, 27 Oct 2010 17:02:47 +0000 (19:02 +0200)]
Discard the current pick buffer...
if we are asked to pick with a different mode.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2385
Emmanuele Bassi [Mon, 8 Nov 2010 16:15:23 +0000 (16:15 +0000)]
reference: Add a Wayland section
Emmanuele Bassi [Mon, 8 Nov 2010 16:03:44 +0000 (16:03 +0000)]
gtk-doc: Add PathConstraint to the Clutter API reference
Emmanuele Bassi [Mon, 8 Nov 2010 16:01:19 +0000 (16:01 +0000)]
gtk-doc: Fixes for the API references
Emmanuele Bassi [Mon, 8 Nov 2010 15:52:17 +0000 (15:52 +0000)]
timeout-pool: Deprecate the structure too
Don't leave it lying around, since nothing can use it anyway.
Emmanuele Bassi [Sun, 7 Nov 2010 21:35:40 +0000 (21:35 +0000)]
path-constraint: Add a ::node-reached signal
Emit a signal whenever a node in the path has been reached.
Emmanuele Bassi [Sun, 7 Nov 2010 15:27:17 +0000 (15:27 +0000)]
build: Re-instate profile builds
The profiling support was broken - probably during the restructuring of
the build environment, but I'm too lazy to bisect that.
The fix is trivial, and everything works as it should.
Emmanuele Bassi [Sat, 6 Nov 2010 20:00:39 +0000 (20:00 +0000)]
Deprecate ClutterFrameSource
The FrameSource API hasn't been used internally since 1.0; since it's
not part of the paint clock, it is of limited use.
Emmanuele Bassi [Sat, 6 Nov 2010 19:59:58 +0000 (19:59 +0000)]
Deprecate ClutterTimeoutPool
Timelines have stopped using the pool since 1.0; there is no real reason
to expose it as part of the active API.
Emmanuele Bassi [Sat, 6 Nov 2010 18:12:41 +0000 (18:12 +0000)]
Remove a compiler warning
Maxim Ermilov [Fri, 5 Nov 2010 17:20:14 +0000 (20:20 +0300)]
CoglContext: correct initialization order
http://bugzilla.clutter-project.org/show_bug.cgi?id=2401
Piotr Drąg [Tue, 2 Nov 2010 12:22:55 +0000 (12:22 +0000)]
po: Update the Polish translation
Neil Roberts [Fri, 5 Nov 2010 18:33:37 +0000 (18:33 +0000)]
Make test-cogl-npot-texture a bit more extensive
The size of the texture used for test-cogl-npot-texture was only using
1 pixel of waste and the texture was scaled down so it would be quite
likely that the test would still pass if only the top left slice was
rendered. It also didn't test using non-default texture
coordinates. These problems made it fail to pick up bug 2398. The
texture is now using the maximum amount of waste and rendered in four
parts at 1:1 scale.
Neil Roberts [Fri, 5 Nov 2010 14:38:19 +0000 (14:38 +0000)]
cogl-texture-2d-sliced: Fix the foreach callback for waste textures
When converting the virtual coordinates of the underlying texture for
a slice to virtual coordinates for the whole texture it was using the
size and offset of the intersection as the size of the child
texture. This would be incorrect if the texture contains waste or the
texture coordinates are not the default. Instead the sliced foreach
function now passes the CoglSpan to the callback instead of the
intersection.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2398
Neil Roberts [Fri, 5 Nov 2010 14:55:46 +0000 (14:55 +0000)]
Replace the disable-npots tool with a COGL_DEBUG option
Previously in the tests/tools directory we build a disable-npots
library which was used as an LD_PRELOAD to trick Cogl in to thinking
there is no NPOT texture extension. This is a little awkward to use so
it seems much simpler to just define a COGL_DEBUG option to disable
npot textures.
Robert Bragg [Tue, 2 Nov 2010 12:20:32 +0000 (12:20 +0000)]
actor: Check "paint" handlers in _get_paint_volume
Instead of waiting until clutter_actor_paint to check if there are any
handlers connected to the "paint" signal, we now do the check whenever
the paint-volume is requested in _actor_get_paint_volume_mutable().
Previously we checked in clutter_actor_paint(), but at that time we may
already be using a stage clip that could be derived from an invalid
paint-volume. We used to try and handle that by queuing a follow up,
unclipped, redraw but anyway there was an additional problem with the
previous approach because the checking wasn't enough to always catch
invalid volumes involved in culling (considering that containers may
derive their volume from children that haven't yet been painted)
By moving the check to _get_paint_volume time not only do we now
correctly check children in cases where a container derives its volume
from its children's volumes but we no longer need to queue follow up
redraws to cover up artefacts.
Since we now never queue follow up redraws, this in turn means we should
no longer clobber redraws queued with an explicit clip which was
something affecting gnome-shell since it connects a handler to the paint
signal of the stage.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2388
Damien Lespiau [Thu, 14 Oct 2010 15:37:25 +0000 (16:37 +0100)]
gitignore: Update the path of generated GLES2 shaders
The generation is not happening in the main Cogl directory, Update the
.gitignore file accordingly.
Robert Bragg [Mon, 1 Nov 2010 22:07:11 +0000 (22:07 +0000)]
matrix-stack: use GArray instead of GSList for stack
In some micro-benchmarks testing journal throughput the list
manipulation jumps pretty high in the profile. This replaces the GSList
usage with a GArray instead which is effectively a grow only allocation
that means we avoid ongoing allocations while manipulating the stack
mid-scene.
Robert Bragg [Mon, 1 Nov 2010 20:33:20 +0000 (20:33 +0000)]
pipeline: Avoid costly checking of lighting properties
During _cogl_pipeline_needs_blending_enabled we were always checking the
current lighting properties (ambient,diffuse,specular,emission) which
had a notable impact during micro-benchmarks that exercise journal
throughput of simple colored rectangles. This #if 0's the offending code
considering that Cogl doesn't actually support lighting currently and
when it actually does then we will be able to optimize this by avoiding
the checks when lighting is disabled.
Robert Bragg [Mon, 1 Nov 2010 20:27:32 +0000 (20:27 +0000)]
cogl: add separate material for blended source_colors
When using cogl_set_source_color4ub there is a notable difference
between colors that require blending and those that dont. When trying to
modify the color of pipeline referenced by the journal we don't force a
flush of the journal unless the color change will also change the
blending state. By using two separate pipeline objects for handing
opaque or transparent colors we can avoid ever flushing the journal when
repeatedly using cogl_set_source_color and jumping between opaque and
transparent colors.
Robert Bragg [Mon, 1 Nov 2010 18:55:48 +0000 (18:55 +0000)]
texture_quad_multiple_primitives: rework wrap mode overrides
This reworks _cogl_texture_quad_multiple_primitives so instead of using
the CoglPipelineWrapModeOverrides mechanism to force the clamp to edge
repeat mode we now derive an override pipeline using cogl_pipeline_copy
instead. This avoids a relatively large, unconditional, memset.
Robert Bragg [Mon, 1 Nov 2010 18:33:17 +0000 (18:33 +0000)]
_multitexture_quad_single_primitive: avoid wrap overrides
This avoids using the wrap mode overrides mechanism to implement
_cogl_multitexture_quad_single_primitive which requires memsetting a
fairly large array. This updates it to use cogl_pipeline_foreach_layer()
and we now derive an override_material to handle changes to the wrap
modes instead of using the CoglPipelineWrapModeOverrides.
Neil Roberts [Wed, 3 Nov 2010 16:02:27 +0000 (16:02 +0000)]
cogl-path: Don't bother filling the path if less than 3 nodes
Previously there was a check to avoid filling the path if there are
zero nodes. However the tesselator also won't generate any triangles
if there are less than 3 nodes so we might as well bail out in that
case too. If we don't emit any triangles then we would end up trying
to create an empty VBO. Although I don't think this should necessarily
be a problem, this seems to cause Mesa to segfault in version 7.8.1
when calling glBufferSubData (although not in
master). test-cogl-primitives tries to fill a path with only two
points so it's convenient to be able to avoid the crash in this case.
Neil Roberts [Tue, 2 Nov 2010 17:35:17 +0000 (17:35 +0000)]
cogl-journal: Log the clip state in the journal
When adding a new entry to the journal a reference is now taken on the
current clip stack. Modifying the current clip state no longer causes
a journal flush. The journal flushing code now has an extra stage to
compare the clip state of each entry. The comparison can simply be
done by comparing the pointers. Although different clip states will
still end up with multiple draw calls this at leasts allows a scene
comprising of multiple different clips to be upload with one vbo. It
also lays the groundwork to do certain tricks when drawing clipped
rectangles such as modifying the geometry instead of setting a clip
state.
Neil Roberts [Tue, 2 Nov 2010 17:34:51 +0000 (17:34 +0000)]
cogl-framebuffer: Add a flag to skip flushing the clip state
This adds a flag to avoid flushing the clip state when flushing the
framebuffer state. This will be used by the journal to manage its own
clip state flushing.
Neil Roberts [Tue, 2 Nov 2010 17:15:06 +0000 (17:15 +0000)]
cogl: Don't flush the journal when flushing clip state
Flushing the clip state no longer does anything that would cause the
journal to flush. The clip state is only flushed when flushing the
framebuffer state and in all cases this ends up flushing the journal
in one way or another anyway. Avoiding flushing the journal will make
it easier to log the clip state in the journal.
Previously when trying to set up a rectangle clip that can't be
scissored or when using a path clip the code would use cogl_rectangle
as part of the process to fill the stencil buffer. This is now changed
to use a new internal _cogl_rectangle_immediate function which
directly uses the vertex array API to draw a triangle strip without
affecting the journal. This should be just as efficient as the
previous journalled code because these places would end up flushing
the journal immediately before and after submitting the single
rectangle anyway and flushing the journal always creates a new vbo so
it would effectively do the same thing.
Similarly there is also a new internal _cogl_clear function that does
not flush the journal.
Neil Roberts [Wed, 3 Nov 2010 15:48:56 +0000 (15:48 +0000)]
cogl-path: Use the vertex array API instead of CoglVertexBuffer
The new vertex array is now implemented in terms of the
CoglVertexBuffer anyway so it should be slightly faster to use a
vertex array directly.
Neil Roberts [Tue, 2 Nov 2010 14:28:12 +0000 (14:28 +0000)]
cogl: Move the clip stack dirtiness to the context rather than the FB
Previously we tracked whether the clip stack needs flushing as part of
the CoglClipState which is part of the CoglFramebuffer state. This is
a bit odd because most of the clipping state (such as the clip planes
and the scissor) are part of the GL context's state rather than the
framebuffer. We were marking the clip state on the framebuffer dirty
every time we change the framebuffer anyway so it seems to make more
sense to have the dirtiness be part of the global context.
Instead of a just a single boolean to record whether the state needs
flushing, the CoglContext now holds a reference to the clip stack that
was flushed. That way we can flush arbitrary stack states and if it
happens to be the same as the state already flushed then Cogl will do
nothing. This will be useful if we log the clip stack in the journal
because then we will need to flush unrelated clip stack states for
each batch.
Neil Roberts [Mon, 1 Nov 2010 19:52:45 +0000 (19:52 +0000)]
cogl-clip-stack: Don't allocate a separate struct for CoglClipStack
Instead of having a separate CoglHandle for CoglClipStack the code is
now expected to directly hold a pointer to the top entry on the
stack. The empty stack is then the NULL pointer. This saves an
allocation when we want to copy the stack because we can just take a
reference on a stack entry. The idea is that this will make it
possible to store the clip stack in the journal without any extra
allocations.
The _cogl_get_clip_stack and set functions now take a CoglClipStack
pointer instead of a handle so it would no longer make sense to make
them public. However I think the only reason we would have wanted that
in the first place would be to save the clip state between switching
FBOs and that is no longer necessary.
Neil Roberts [Wed, 3 Nov 2010 13:34:21 +0000 (13:34 +0000)]
cogl: Don't flush the framebuffer state for the internal draw
CoglVertexAttribute has an internal draw function that is used by the
CoglJournal to avoid the call to cogl_journal_flush which would
otherwise end up recursively flushing the journal forever. The
enable_gl_state function called by this was previously also calling
_cogl_flush_framebuffer_state. However the journal code tries to
handle this function specially by calling it with a flag to disable
flushing the modelview matrix. This is useful because the journal
handles flushing the modelview itself. Without this patch the journal
state ends up getting flushed twice. This isn't a particularly big
problem currently because the matrix stack has caching to recognise
when it would push the same state twice and bails out. However if we
later want to use the framebuffer flush flags to override a particular
state of the framebuffer (such as the clip state) then we need to make
sure the flush isn't called twice.
Neil Roberts [Thu, 4 Nov 2010 16:01:23 +0000 (16:01 +0000)]
cogl-buffer: Use void* instead of guint8* for map and set_data
Unless the CoglBuffer is being used for texture data then it's
relatively unlikely that the data will contain an array of bytes. For
example if it's used as a vertex array then it's more likely to be
floats or some vertex struct. In that case it's much more convenient
if set_data and map use void* pointers so that we can avoid a cast.
Neil Roberts [Thu, 4 Nov 2010 17:31:59 +0000 (17:31 +0000)]
Add a conformance test for the CoglPrimitive convenience constructors
This adds a simple conformance test which calls all of the convenience
constructors for CoglPrimitive.
Neil Roberts [Thu, 4 Nov 2010 17:21:56 +0000 (17:21 +0000)]
cogl-primitive: Fix the texture attribute offsets
The offsets for the texture coordinate attributes in the convenience
constructors were all wrong.
Neil Roberts [Thu, 4 Nov 2010 16:54:20 +0000 (16:54 +0000)]
cogl-primitive: Fix a typo in new_with_attributes_array
A typo in the g_return_val_if_fail was causing it to segfault.
Neil Roberts [Thu, 4 Nov 2010 16:42:11 +0000 (16:42 +0000)]
cogl-primitive: Add the missing cogl_primitive_new_p2 function
There was a struct defined for CoglP2Vertex but there was no
constructor function to use it.
Neil Roberts [Thu, 4 Nov 2010 16:13:01 +0000 (16:13 +0000)]
cogl-primitive: Fix the ref-counting for the convenience constuctors
The convenience constructors for the builtin vertex structs were
creating the primitive and then immediately destroying it and
returning the pointer. I think the intention was to unref the
attributes instead. This adds an internal wrapper around the
new_with_attributes_array constructor which unrefs the attributes
instead of the primitive. The convenience constructors now use that.
Robert Bragg [Thu, 4 Nov 2010 13:23:23 +0000 (13:23 +0000)]
primitive: fix prototypes and start adding docs
This fixes the prototypes for the cogl_primitive_new_xyz functions and
also adds documentation with examples for each one.
Neil Roberts [Thu, 4 Nov 2010 14:56:44 +0000 (14:56 +0000)]
cogl-gles2-wrapper: Fix a reference to the old name for CoglPipeline
The GLES2 wrapper was referring to COGL_MATERIAL_PROGRAM_TYPE_GLSL but
this has since been renamed to COGL_PIPELINE_PROGRAM_TYPE_GLSL so the
GLES2 backend wouldn't compile.
Robert Bragg [Fri, 29 Oct 2010 14:49:25 +0000 (15:49 +0100)]
gles2: disable vbos until while we rework backend
The gles2 wrapper functions don't understand about the CoglBuffer API so
they don't support attributes stored in a CoglVertexArray. Instead of
teaching the backend about buffers we are going to wait until we have
overhauled the GLES 2 backend. We are currently making progress
consolidating the GLES 2 backend with a new GLSL backend for
CoglMaterial. This will hugely simplify the GLES 2 support and share
code with the OpenGL backend. In the end it's hoped that this problem
will simply go away so it doesn't make much sense to solve it with the
current design.
Robert Bragg [Wed, 27 Oct 2010 17:54:57 +0000 (18:54 +0100)]
cogl: rename CoglMaterial -> CoglPipeline
This applies an API naming change that's been deliberated over for a
while now which is to rename CoglMaterial to CoglPipeline.
For now the new pipeline API is marked as experimental and public
headers continue to talk about materials not pipelines. The CoglMaterial
API is now maintained in terms of the cogl_pipeline API internally.
Currently this API is targeting Cogl 2.0 so we will have time to
integrate it properly with other upcoming Cogl 2.0 work.
The basic reasons for the rename are:
- That the term "material" implies to many people that they are
constrained to fragment processing; perhaps as some kind of high-level
texture abstraction.
- In Clutter they get exposed by ClutterTexture actors which may be
re-inforcing this misconception.
- When comparing how other frameworks use the term material, a material
sometimes describes a multi-pass fragment processing technique which
isn't the case in Cogl.
- In code, "CoglPipeline" will hopefully be a much more self documenting
summary of what these objects represent; a full GPU pipeline
configuration including, for example, vertex processing, fragment
processing and blending.
- When considering the API documentation story, at some point we need a
document introducing developers to how the "GPU pipeline" works so it
should become intuitive that CoglPipeline maps back to that
description of the GPU pipeline.
- This is consistent in terminology and concept to OpenGL 4's new
pipeline object which is a container for program objects.
Note: The cogl-material.[ch] files have been renamed to
cogl-material-compat.[ch] because otherwise git doesn't seem to treat
the change as a moving the old cogl-material.c->cogl-pipeline.c and so
we loose all our git-blame history.
Robert Bragg [Wed, 27 Oct 2010 11:43:36 +0000 (12:43 +0100)]
pango: Use CoglMaterial type for materials
Instead of using the CoglHandle type for material variables this updates
the pango code to use CoglMaterial * instead. CoglHandle is the old
typename which is being phased out of the API.
Robert Bragg [Wed, 27 Oct 2010 11:36:24 +0000 (12:36 +0100)]
pango: push/pop source instead of trashing users source
The pango-display-list code was calling cogl_set_source in numerous
places and it didn't appear to be saving the users source to restore
later. This could result in the user inadvertantly drawing a primitive
with one of these internally managed materials instead of one that they
chose. To rectify this the code now uses cogl_{push,pop}_source to save
and restore the users source.
Robert Bragg [Mon, 18 Oct 2010 16:17:22 +0000 (17:17 +0100)]
primitives: implements cogl_polygon on vertex_attributes
This updates the implementation of cogl_polygon so it sits on the new
CoglVertexArray and CoglVertexAttribute apis. This lets us minimize the
number of different drawing paths we have to maintain in Cogl.
Since the sliced texture support for cogl_polygon has been broken for a
long time now and no one has complained this patch also greatly
simplifies the code by not doing any special material validation so
cogl_polygon will be restricted in the same way as
cogl_draw_vertex_attributes. (i.e. sliced textures not supported).
Robert Bragg [Tue, 26 Oct 2010 18:22:57 +0000 (19:22 +0100)]
journal: port to the vertex_attributes API
Instead of using raw OpenGL in the journal we now use the vertex
attributes API instead. This is part of an ongoing effort to reduce the
number of drawing paths we maintain in Cogl.