Robert Bragg [Wed, 17 Feb 2010 17:53:28 +0000 (17:53 +0000)]
cogl debug: hint that all debugging paths are G_UNLIKELY
Most Cogl debugging code conditions are marked as G_UNLIKELY with the
intention of having the CPU branch prediction always assume the
path is disabled so having debugging support in release binaries has
negligible overhead.
This patch simply fixes a few cases where we weren't using G_UNLIKELY.
Robert Bragg [Wed, 17 Feb 2010 17:40:57 +0000 (17:40 +0000)]
cogl debug: Support "minimum" level debugging by default
We basically want all Clutter applications out in the wild to at least
have the basic set of COGL_DEBUG/--cogl-debug options available for
investigating issues.
Robert Bragg [Wed, 17 Feb 2010 14:38:11 +0000 (14:38 +0000)]
cogl debug: Makes COGL_DEBUG=all|verbose|help more useful
COGL_DEBUG=all wasn't previously useful as there are several options
that change the behaviour of Cogl and all together wouldn't help anyone
debug anything.
This patch makes it so COGL_DEBUG=all|verbose now only enables options
that don't change the behaviour of Cogl, i.e. they only affect the
amount of noise we'll print to a terminal.
In addition to that this patch also improves the output from
COGL_DEBUG=help so we now print a table of options including one liner
descriptions of what each option enables.
Emmanuele Bassi [Tue, 23 Feb 2010 17:59:09 +0000 (17:59 +0000)]
box: Tweak the depth sorting function
By changing the depth sorting function we can achieve the same effect as
ClutterGroup but without the costly append+sort.
http://bugzilla.openedhand.com/show_bug.cgi?id=1988
Emmanuele Bassi [Tue, 23 Feb 2010 16:51:26 +0000 (16:51 +0000)]
cogl: Add deprecation annotation to CoglMaterial ref/unref
The G_GNUC_DEPRECATED annotation was missing from the material ref and
unref functions.
Emmanuele Bassi [Tue, 16 Feb 2010 20:08:35 +0000 (20:08 +0000)]
debug: Split debugging notes from behavioural modifiers
Some of the ClutterDebugFlags are not meant as a logging facility: they
actually change Clutter's behaviour at run-time.
It would be useful to have this distinction ratified, and thus split
ClutterDebugFlags into two: one DebugFlags for logging facilities and
another set of flags for behavioural changes.
This split is warranted because:
• it should be possible to do "CLUTTER_DEBUG=all" and only have
log messages on the output
• it should be possible to use behavioural modifiers even on a
Clutter that has been compiled without debugging messages
support
The commit adds two new debugging flags:
ClutterPickDebugFlags - controlled by the CLUTTER_PICK environment
variable
ClutterPaintDebugFlags - controlled by the CLUTTER_PAINT environment
variable
The PickDebugFlags are:
nop-picking
dump-pick-buffers
While the PaintDebugFlags is:
disable-swap-events
The mechanism is equivalent to the CLUTTER_DEBUG environment variable,
but it does not depend on the debug level selected when configuring and
compiling Clutter. The picking and painting debugging flags are
initialized at clutter_init() time.
http://bugzilla.openedhand.com/show_bug.cgi?id=1991
Neil Roberts [Wed, 17 Feb 2010 22:16:17 +0000 (22:16 +0000)]
cogl-vertex-buffer: Fix the malloc fallback for indices
The size of the malloc'd buffer for indices when VBOs are not
available was too small so memory corruption would result if it was
used.
http://bugzilla.o-hand.com/show_bug.cgi?id=1996
Emmanuele Bassi [Mon, 22 Feb 2010 11:34:04 +0000 (11:34 +0000)]
device: Motion events compression should honour the device
The motion event compression should be affected by the device field of
the event; that is: we should compress motion events coming from the
same device.
Emmanuele Bassi [Mon, 22 Feb 2010 11:30:14 +0000 (11:30 +0000)]
device: Force ENTER on Stage with overlapping Actors
If an actor is on the boundary of a Stage and the pointer for a device
enters the Stage over that actor, the sequence of events currently is:
➔ ENTER (source: actor, related: NULL)
➔ MOTION
Thus the Stage never gets an ENTER event. This is a regression from
Clutter 1.0.
The correct sequence is:
➔ ENTER (source: stage, related: NULL)
➔ ENTER (source: actor, related: stage)
➔ MOTION
This also maps to the sequence of events sythesized by Clutter when
leaving the Stage through an actor overlapping the Stage boundary.
http://bugzilla.moblin.org/show_bug.cgi?id=9781
Emmanuele Bassi [Thu, 18 Feb 2010 16:58:29 +0000 (16:58 +0000)]
stage: Only clutter_stage_get_default() creates the default stage
The introduction of the StageManager in 0.8 implied that the first Stage
instance to be created was automatically assigned the status of "default
stage". This was all well and good, since the default stage was created
behind the curtains by the initialization sequence.
Now that the initialization sequence does not create a default stage any
longer, it means that the first stage created using clutter_stage_new()
gets to be the default, and all special and warm and fuzzy - which also
means that the first stage created by clutter_stage_new() cannot be
destroyed or handled as any other stage. Whoopsie.
Let's go back to the old semantics: the stage created by the first
invocation of clutter_stage_get_default() is the default stage, and
nothing else can be set as default. One day we'll be able to break the
API and the whole default stage business will be a thing of the past.
Emmanuele Bassi [Thu, 18 Feb 2010 11:34:06 +0000 (11:34 +0000)]
docs: Document the InputDevice update method
Embedding toolkits should benefit from a proper documentation of
clutter_input_device_update_from_event(): its meaning, its use and
the caveats for the "update_stage" argument.
Neil Roberts [Wed, 17 Feb 2010 18:18:38 +0000 (18:18 +0000)]
win32: Fixup compilation errors from
b398292089b0f7
That commit added some Win32 code which breaks compilation.
Thanks to Samuel Degrande for help with this.
Robert Bragg [Tue, 16 Feb 2010 14:53:10 +0000 (14:53 +0000)]
cogl_texture_new_from_foreign: improve docs
Improve the explanation of what the x_pot_waste and y_pot_waste
arguments can be used for.
Robert Bragg [Tue, 16 Feb 2010 14:23:11 +0000 (14:23 +0000)]
cogl-texture: for foreign textures; always trust user geom
We now never query the width and height of the given texture object
from OpenGL. The problem is that the user may be creating a Cogl
texture from a texture_from_pixmap object where glTexImage2D was
never called and the texture_from_pixmap spec doesn't clarify that
it's reliable to query the width from OpenGL.
This should address:
http://bugzilla.openedhand.com/show_bug.cgi?id=1502
Thanks to Johan Bilien for reporting
Emmanuele Bassi [Wed, 17 Feb 2010 19:02:43 +0000 (19:02 +0000)]
docs: Fixes for DeviceManager
Emmanuele Bassi [Wed, 17 Feb 2010 18:21:50 +0000 (18:21 +0000)]
device: Allow updating devices from embedding toolkits
Embedding toolkits most likely will disable the event handling, so all
the input device code will not be executed. Unfortunately, the newly
added synthetic event generation of ENTER and LEAVE event pairs depends
on having input devices.
In order to unbreak things without reintroducing the madness of the
previous code we should allow embedding toolkits to just update the
state of an InputDevice by using the data contained inside the
ClutterEvent. This strategy has two obvious reasons:
• the embedding toolkit is creating a ClutterEvent by translating
a toolkit-native event anyway
• this is exactly what ClutterStage does when processing events
We are, essentially, deferring input device handling to the embedding
toolkits, just like we're deferring event handling to them.
Emmanuele Bassi [Wed, 17 Feb 2010 17:06:25 +0000 (17:06 +0000)]
device: Impose per-backend DeviceManager
The DeviceManager class should be abstract in Clutter, and implemented
by each backend, as different backends will have different ways to
detect, initialize and list devices; the X11 backend alone has *two*
ways of dealing with devices.
This commit makes DeviceManager an abstract class and delegates the
device initialization and enumeration to per-backend sub-classes.
The responsible for creating the device manager is, obviously, the
backend singleton.
The X11 and Win32 backends have been updated to the new layout; the
Win32 backend has been updated blindly, so it might require additional
testing.
Chris Lord [Wed, 17 Feb 2010 16:56:30 +0000 (16:56 +0000)]
[event-x11] Don't relayout on window move
ConfigureNotify is delivered on window movements too, but there is no
need to queue a relayout on these as the viewport hasn't changed size.
Check for the window actually changing size on ConfigureNotify before
queueing a relayout.
This fixes laggy window movement when moving a window in response to
Clutter mouse motion events.
Neil Roberts [Wed, 17 Feb 2010 15:58:32 +0000 (15:58 +0000)]
cogl-clip-stack: Round the coords when clipping to a window rect
The size and position of the window rectangle for clipping in
try_pushing_rect_as_window_rect is calculated by projecting the
rectangle coordinates. Due to rounding errors, this can end up with
slightly off numbers like 34.999999. These were then being cast
directly to an integer so it could end up off by one.
This uses a new macro called COGL_UTIL_NEARBYINT which is a
replacement for the C99 nearbyint function.
Neil Roberts [Wed, 17 Feb 2010 14:38:45 +0000 (14:38 +0000)]
test-cogl-vertex-buffer: Fix the maximum index number
It was passing the number of vertices to
cogl_vertex_buffer_draw_elements but instead it should take the
maximum index which would be the number of vertices minus one. This
was causing errors to be reported with the checks filterset of Bugle.
Emmanuele Bassi [Wed, 17 Feb 2010 10:46:16 +0000 (10:46 +0000)]
Improve LEAVE events for border actors
If an actor is lying on the border of the Stage it might miss the LEAVE
event when the pointer of a device leaves the Stage window. Since the
backend is unsetting the Stage back pointer on the InputDevice we can
queue the emission of a LEAVE event on the pointer actor as well.
http://bugzilla.moblin.org/show_bug.cgi?id=9677
Chris Lord [Tue, 16 Feb 2010 18:25:46 +0000 (18:25 +0000)]
[stage-x11] Fix a warning due to a missing cast
I stupidly forgot to cast a ClutterStage to a ClutterActor and somehow
missed or didn't get the compiler warning. Fix.
Chris Lord [Tue, 16 Feb 2010 18:17:55 +0000 (18:17 +0000)]
[stage-x11] Fix resizing for foreign windows
As well as manually setting the geometry size, we needed to queue a
relayout. This is what the ConfigureNotify handler would normally do,
but we don't get this event when using a foreign window (obviously).
This should fix resizing in things like gtk-clutter.
Chris Lord [Tue, 16 Feb 2010 17:46:52 +0000 (17:46 +0000)]
[stage-x11] Set the geometry size for foreign wins
If we get into the resize function and it's a foreign window, set the
geometry size so that the allocate will set the backend size and call
glViewport.
Emmanuele Bassi [Tue, 16 Feb 2010 16:31:20 +0000 (16:31 +0000)]
Add test-stage-sizing to the ignore file
Chris Lord [Tue, 16 Feb 2010 15:39:08 +0000 (15:39 +0000)]
[test-interactive] Add a stage sizing test
Add an interactive stage sizing test to test the interaction of
fullscreening/resizing/expanding/shrinking a visible stage.
Chris Lord [Tue, 16 Feb 2010 14:50:14 +0000 (14:50 +0000)]
[stage-x11] Fix switching fullscreen mode
Setting/unsetting fullscreen on a mapped or unmapped window now works
correctly.
If you unfullscreen a window that was initially full-screened, it will
unset the fullscreen hint and the WM will likely push the size down to
the largest valid size.
If the window was previously un-fullscreened, Clutter will restore the
previous size.
Fullscreening also now works if the WM switches the hint without the
application's knowledge (as happens when you resize a window to the size
of the screen, for example, with stock metacity).
Emmanuele Bassi [Tue, 16 Feb 2010 12:32:37 +0000 (12:32 +0000)]
Post-release version bump to 1.1.13
Emmanuele Bassi [Tue, 16 Feb 2010 12:21:15 +0000 (12:21 +0000)]
Release 1.1.12 (developers snapshot)
Emmanuele Bassi [Tue, 16 Feb 2010 12:16:02 +0000 (12:16 +0000)]
conform: Do not resize the stage
Since all conformance tests share the same state we should not touch
stuff like the stage size; sharing is already fairly complex and adds a
lot of caveats on the implementation of a conformance test unit, and if
we make tests influence later ones then we might slip in bugs or false
negatives - thus defeating the whole point of a conformance test suite.
Emmanuele Bassi [Tue, 16 Feb 2010 12:15:23 +0000 (12:15 +0000)]
conform: Use a 640x480 stage in test-pick
Do not resize the stage to a smaller size: the default size is perfectly
fine.
Neil Roberts [Tue, 16 Feb 2010 12:01:18 +0000 (12:01 +0000)]
cogl-atlas-texture: Don't use the atlas if FBOs aren't supported
If FBOs aren't supported then it will end up very slow to reorganize
the atlas. Also currently the CoglTexture2D backend will refuse to
create any textures anyway so the full atlas texture won't be created.
Neil Roberts [Tue, 16 Feb 2010 11:58:47 +0000 (11:58 +0000)]
cogl-atlas-texture: Check for errors when creating the atlas texture
cogl_texture_2d_new may fail in certain circumstances so
cogl_atlas_texture_reserve_space should detect this and also
fail. This will cause cogl_texture_new to fallback to a sliced
texture.
Thanks to Vladimir Ivakin for reporting this problem.
Emmanuele Bassi [Tue, 16 Feb 2010 11:38:51 +0000 (11:38 +0000)]
conform: Use g_assert_cmpint() in cogl-readpixels test
The g_assert_cmpint() macro prints out not just the assertion condition
but also the assertion contents; this is useful to catch wrong values
without incrementing the verbosity of the test itself.
Emmanuele Bassi [Mon, 15 Feb 2010 19:03:37 +0000 (19:03 +0000)]
docs: Document SWAP_EVENTS feature flag
Chris Lord [Mon, 15 Feb 2010 18:53:58 +0000 (18:53 +0000)]
[stage] Fix some races to do with window resizing
When we resize, we relied on the stage's allocate to re-initialise the
GL viewport. Unfortunately, if we resized within Clutter, the new size
was cached before the window is actually resized, so glViewport wasn't
being called after resizing (some of the time, it's a race condition).
Change the way resizing works slightly so that we only resize when the
geometry size doesn't match our preferred size, and queue a relayout on
ConfigureNotify so the glViewport gets called.
Also change window creation slightly so that setting the size of a
window before it's realized works correctly.
Emmanuele Bassi [Mon, 15 Feb 2010 16:09:26 +0000 (16:09 +0000)]
actor: Turn push/pop_internal into Actor methods
Since the "internal" state is global, it will leak onto actors that you
didn't intend for it to, because it applies not just to the actors you
create, but also to any actors *they* create. Eg, if you have a dialog
box class, you might push/pop_internal around creating its buttons, so
that those buttons get marked as internal to the dialog box. But
ctx->internal_child will still be set during the *button*'s constructor
as well, and so, eg, the label and icon inside the button actor will
*also* be marked as internal children, even if that isn't what the
button class wanted.
The least intrusive change at this point is to make push_internal() and
pop_internal() two methods of the Actor class, and take a ClutterActor
pointer as the argument - thus moving the locality of the internal_child
counter to the Actor itself.
http://bugzilla.openedhand.com/show_bug.cgi?id=1990
Emmanuele Bassi [Mon, 15 Feb 2010 12:04:50 +0000 (12:04 +0000)]
stage: Add sanity checks for get_pending_swaps()
The master clock might have a Stage during its destruction phase,
without a StageWindow attached to it. If this happens and we try
to dereference the StageWindow to get its class and call a virtual
function we might experience some slight turbulence and... then...
explode.
http://bugzilla.openedhand.com/show_bug.cgi?id=1987
Emmanuele Bassi [Mon, 15 Feb 2010 11:58:55 +0000 (11:58 +0000)]
build: Enable experimental COGL API in tests/conform
Enable the experimental API when building the conformance test suite.
Emmanuele Bassi [Mon, 15 Feb 2010 11:57:48 +0000 (11:57 +0000)]
build: Disable deprecated API in tests/conform
We should not be using deprecated API in the conformance test suite.
Emmanuele Bassi [Mon, 15 Feb 2010 11:56:34 +0000 (11:56 +0000)]
conform: Do not use deprecated API
There is no more type-specific ref/unref pairs: it is all under
CoglHandle now.
Emmanuele Bassi [Mon, 15 Feb 2010 11:45:35 +0000 (11:45 +0000)]
x11: Do not set pid or title on foreign windows
If a StageX11 is using a foreign window we should not need to set the
_NET_WM_PID or the WM_TITLE properies.
http://bugzilla.openedhand.com/show_bug.cgi?id=1989
Emmanuele Bassi [Mon, 15 Feb 2010 11:44:02 +0000 (11:44 +0000)]
docs: Mention signal-swapped-after modifier
The signal-swapped-after:: modifier for signal connection inside the
clutter_actor_animate* variadic arguments functions is not mentioned in
the documentation.
Damien Lespiau [Mon, 8 Feb 2010 19:18:36 +0000 (19:18 +0000)]
docs: Add 2010 in COGL's Copyright notice
While at it, fix the usage of <year> in <copyright> to let the
stylesheet do the collation when having several years.
Damien Lespiau [Fri, 12 Feb 2010 17:24:15 +0000 (17:24 +0000)]
cogl-buffer: fix compilation for GL ES
In the frenzy of the last 10mins before API freeze, I obviously forgot
to update the OpenGL path for _cogl_buffer_hints_to_gl_enum(). This
commit fixes this.
Neil Roberts [Fri, 12 Feb 2010 15:33:56 +0000 (15:33 +0000)]
cogl-atlas-texture: Flush the journal before adding a new texture
When the atlas is reorganised we could potentially be moving around
textures that are already referenced in the journal. We therefore need
to flush the journal otherwise they will be rendered with incorrect
texture coordinates. We also need to flush the journal even if we are
not reorganizing so that we can rely on the old texture contents
remaining in the atlas after migrating a texture out.
Neil Roberts [Fri, 12 Feb 2010 10:08:51 +0000 (10:08 +0000)]
cogl-sub-texture: Optimise taking a sub texture of a sub texture
When creating a Cogl sub-texture, if the full texture is also a sub
texture it will now just offset the x and y and reference the full
texture instead. This avoids one level of indirection when rendering
the texture which reduces the chances of getting rounding errors in
the calculations.
Emmanuele Bassi [Fri, 12 Feb 2010 16:24:27 +0000 (16:24 +0000)]
actor: Split get_paint_opacity() from the type check
Since get_paint_opacity() recurses through the hierarchy it might lead
to a lot of type checks while we walk the parent-child chain. We can
split the recursive function from the public entry point and perform the
type check just once.
Emmanuele Bassi [Fri, 12 Feb 2010 16:18:12 +0000 (16:18 +0000)]
actor: Do not call get_opacity() from get_paint_opacity()
We already have access to the opacity private field, there's no need to
go through the public API.
Emmanuele Bassi [Fri, 12 Feb 2010 15:52:07 +0000 (15:52 +0000)]
docs: Fixes for Cogl
Emmanuele Bassi [Fri, 12 Feb 2010 14:46:43 +0000 (14:46 +0000)]
build: Use -Wuninitialized instead of -Wno-uninitialized
We want to be warned about uninitialized variables.
Emmanuele Bassi [Fri, 12 Feb 2010 14:45:49 +0000 (14:45 +0000)]
analysis: Interactive tests
Abort if test-behave was passed the wrong type of behaviour to test.
Emmanuele Bassi [Fri, 12 Feb 2010 14:45:04 +0000 (14:45 +0000)]
analysis: Conformance tests
Initialize ClutterPathNote members to 0 using "{ 0, }".
Emmanuele Bassi [Thu, 11 Feb 2010 15:24:41 +0000 (15:24 +0000)]
analysis: x11: ClutterEvent
Remove an unused variable.
Emmanuele Bassi [Thu, 11 Feb 2010 15:24:17 +0000 (15:24 +0000)]
analysis: CoglPangoRenderer
Remove unused variables.
Emmanuele Bassi [Thu, 11 Feb 2010 15:20:25 +0000 (15:20 +0000)]
analysis: ClutterTimeoutPool
Do not pre-initialize the list iterator, the for loop will do it for us.
Emmanuele Bassi [Thu, 11 Feb 2010 15:20:07 +0000 (15:20 +0000)]
analysis: ClutterTimeline
Remove an unused variable.
Emmanuele Bassi [Thu, 11 Feb 2010 15:19:46 +0000 (15:19 +0000)]
analysis: ClutterTexture
Remove unused variables.
Emmanuele Bassi [Thu, 11 Feb 2010 15:19:32 +0000 (15:19 +0000)]
analysis: ClutterText
Remove unused variables.
Emmanuele Bassi [Thu, 11 Feb 2010 15:19:18 +0000 (15:19 +0000)]
analysis: ClutterStage
Remove unused variables.
Emmanuele Bassi [Thu, 11 Feb 2010 15:17:53 +0000 (15:17 +0000)]
analysis: ClutterScriptParser
We parse a JSON value depending on the initial state of an uninitialized
variable. Ouch.
Emmanuele Bassi [Thu, 11 Feb 2010 15:17:32 +0000 (15:17 +0000)]
analysis: ClutterRectangle
Remove unused variables.
Emmanuele Bassi [Thu, 11 Feb 2010 15:17:07 +0000 (15:17 +0000)]
analysis: ClutterModel
Remove unused variables.
Emmanuele Bassi [Thu, 11 Feb 2010 15:13:40 +0000 (15:13 +0000)]
analysis: ClutterMain
• Remove unused variables.
• Do not pre-initialize ClutterActor's GType; pre-emptive optimizations
like these are more black magic than real optimization.
Emmanuele Bassi [Thu, 11 Feb 2010 15:13:20 +0000 (15:13 +0000)]
analysis: ClutterInterval
Remove unused variables.
Emmanuele Bassi [Thu, 11 Feb 2010 15:11:51 +0000 (15:11 +0000)]
analysis: ClutterBoxLayout
Remove an useless assignment. The n_expand_children is not used outside
the extra_space check, and if n_expand_children is 0 then the extra
space we allocate is 0.
Emmanuele Bassi [Thu, 11 Feb 2010 15:11:25 +0000 (15:11 +0000)]
analysis: ClutterBehaviour
Remove an unused variable.
Emmanuele Bassi [Thu, 11 Feb 2010 15:09:51 +0000 (15:09 +0000)]
analysis: ClutterAnimation
• Remove one unused variable.
• We ignore the result of get_timeline_internal() so we need to tell
the compiler that - though a better solution would be to split the
timeline implicit creation into its own function.
Emmanuele Bassi [Thu, 11 Feb 2010 15:09:12 +0000 (15:09 +0000)]
analysis: ClutterAnimator/2
Clean up an unused variable.
Emmanuele Bassi [Thu, 11 Feb 2010 15:08:19 +0000 (15:08 +0000)]
analysis: ClutterAnimator/1
Do not de-reference a void*; use a temporary variable -- after
checking the contents of the pointer. This actually simplifies
the readability and avoids pulling a Lisp with the parentheses.
Emmanuele Bassi [Thu, 11 Feb 2010 15:07:38 +0000 (15:07 +0000)]
analysis: ClutterAlpha
Clean up unused variables.
Emmanuele Bassi [Thu, 11 Feb 2010 15:05:18 +0000 (15:05 +0000)]
analysis: ClutterActor
Clean up ClutterActor for unused variables.
Neil Roberts [Fri, 12 Feb 2010 14:26:33 +0000 (14:26 +0000)]
cogl: Cache the value for GL_MAX_TEXTURE_UNITS
The function _cogl_get_max_texture_units is called quite often while
rendering and it returns a constant value so we might as well cache
the result. Calling glGetInteger on Mesa can be expensive because it
flushes a lot of state.
Robert Bragg [Thu, 11 Feb 2010 16:12:26 +0000 (16:12 +0000)]
cogl: resolves some low hanging issues flagged by clang
An initial pass over the Cogl source code using the Clang static
analysis tool flagged a few low hanging issues such as un-used variables
or redundant initializing of variables which this patch fixes.
Robert Bragg [Thu, 11 Feb 2010 15:33:01 +0000 (15:33 +0000)]
cogl_rectangle: avoid redundant copy of geometry
All the cogl_rectangle* APIs normalize their input into into an array of
_CoglMutiTexturedRect rectangles and pass these on to our work horse;
_cogl_rectangles_with_multitexture_coords. The definition of
_CoglMutiTexturedRect had 4 separate float members, x_1, y_1, x_2 and
y_2 which meant for some common cases we were having to copy out from an
array into these members. We are now able to simply point into the users
array avoiding a copy which seems desirable when submiting lots of
rectangles.
Robert Bragg [Wed, 10 Feb 2010 22:47:49 +0000 (22:47 +0000)]
cogl: explicitly mark cogl_<object>_ref/unref APIs as deprecated
This uses the G_GNUC_DEPRECATED macros to mark the
cogl_{texture,vertex_buffer,shader}_ref and unref APIs as deprecated.
Since this flagged that cogl-pango-display-list.c and
clutter-glx-texture-pixmap.c were still using deprecated _ref/_unref
APIs they have now been changed to use the cogl_handle_ref/unref API
instead.
Robert Bragg [Wed, 10 Feb 2010 22:30:37 +0000 (22:30 +0000)]
cogl: cleanly separate primitives + paths code
The function prototypes for the primitives API were spread between
cogl-path.h and cogl-texture.h and should have been in a
cogl-primitives.h.
As well as shuffling the prototypes around into more sensible places
this commit splits the cogl-path API out from cogl-primitives.c into
a cogl-path.c
Robert Bragg [Wed, 10 Feb 2010 18:18:30 +0000 (18:18 +0000)]
cogl: remove redundant _cogl_journal_flush prototype
There was a redundant _cogl_journal_flush function prototype in
cogl-primitives.h
Robert Bragg [Wed, 10 Feb 2010 01:57:32 +0000 (01:57 +0000)]
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
Robert Bragg [Fri, 5 Feb 2010 16:32:19 +0000 (16:32 +0000)]
cogl: deprecates cogl_check_extension
OpenGL is an implementation detail for Cogl so it's not appropriate to
expose OpenGL extensions through the Cogl API.
Note: Clutter is currently still using this API, because it is still
doing raw GL calls in ClutterGLXTexturePixmap, so this introduces a
couple of (legitimate) build warnings while compiling Clutter.
Robert Bragg [Tue, 9 Feb 2010 19:34:32 +0000 (19:34 +0000)]
never presume queuing redraws on invisible actors is redundant
This replaces code like this:
if (CLUTTER_ACTOR_IS_VISIBLE (self))
clutter_actor_queue_redraw (self);
with:
clutter_actor_queue_redraw (self);
clutter_actor_queue_redraw internally knows what can be optimized when
the actor is not visible, but it also knows that the queue_redraw signal
must always be sent in case a ClutterClone is cloning a hidden actor.
Robert Bragg [Tue, 9 Feb 2010 19:19:44 +0000 (19:19 +0000)]
box: port a ClutterGroup::foreach fix to ClutterBox
ClutterGroup::foreach was recently changed (ref:
ce030a3fce) to use
g_list_foreach() to iterate the children instead of manually iterating
the list so it would safely handle calls like:
clutter_container_foreach (container, clutter_actor_destroy);
(In this example clutter_actor_destroy will result in the current
list item being iterated being freed.)
Robert Bragg [Tue, 9 Feb 2010 19:06:59 +0000 (19:06 +0000)]
box: Adds missing copyright header
Adds a Copyright (C) 2009,2010 Intel Corporation header
Robert Bragg [Tue, 9 Feb 2010 18:54:28 +0000 (18:54 +0000)]
group: make it comparable to ClutterBox
There is a lot of duplication between ClutterGroup and ClutterBox so
this makes the two files diff-able so that new fixes can easily be
ported to both and bug fixes missing in one or the other can be spotted
more easily. This doesn't change the behaviour of either actor; it's
really just a shuffle around of code and normalizes the coding style to
make the files comparable.
This has already uncovered one bug in ClutterBox, and also highlights
a bug in ClutterGroup + many other actors:
1) ClutterGroup::real_foreach was recently changed to use
g_list_foreach instead of manually iterating the child list so it can
safely handle calls like:
clutter_container_foreach (container, clutter_actor_destroy);
ClutterBox is still manually iterating the list.
2) In ClutterGroup we guard _queue_redraw() calls like this:
if (CLUTTER_ACTOR_IS_VISIBLE (container))
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
In ClutterBox we don't:
I think ClutterBox is correct here because
clutter_actor_queue_redraw already optimizes the case where the
actor's not visible, but it also considers that the actor may be
cloned and so the guard in ClutterGroup could break clones. This
actually highlights a wider clutter bug since the same kinds of
guards can be found in all other clutter actors.
Emmanuele Bassi [Fri, 12 Feb 2010 11:38:47 +0000 (11:38 +0000)]
docs: Update the backend HACKING file
Clarify the Backend::create_context() vfunc role, and the
Stage::realize() vfunc with regards to creating the GL/GLES
context.
Neil Roberts [Thu, 11 Feb 2010 14:20:48 +0000 (14:20 +0000)]
cogl: Add a fallback for when the signbit macro is missing
The signbit macro is defined in C99 so it should be available but some
versions of GCC don't appear to define it by default. If it's not
available we can use a hack to test the bit directly.
Emmanuele Bassi [Wed, 10 Feb 2010 17:20:31 +0000 (17:20 +0000)]
Do a sanity check on _clutter_do_pick() arguments
We should check that the passed ClutterStage pointer is indeed: a) still
valid and b) a Stage.
Emmanuele Bassi [Wed, 10 Feb 2010 17:12:27 +0000 (17:12 +0000)]
input-device: Do not pick() on NULL stages
If the stage associated to the InputDevice is not set we should
short-circuit out and return NULL. This will result in a pick()
done on the event's stage - if applicable.
http://bugzilla.moblin.org/show_bug.cgi?id=9602
Emmanuele Bassi [Wed, 10 Feb 2010 15:38:41 +0000 (15:38 +0000)]
text: Bump up the preferred height
Instead of returning a sub-pixel height round up the preferred height to
the nearest integral value that is not less than the size reported by
Pango, once converted in pixels.
Emmanuele Bassi [Wed, 10 Feb 2010 15:38:07 +0000 (15:38 +0000)]
test-text-field: Tone down the border
Use a low opacity for the text field border.
Emmanuele Bassi [Wed, 10 Feb 2010 15:37:26 +0000 (15:37 +0000)]
test-text-field: Use ActorBox methods for the border
Clamp to pixel and use get_size() when painting the border of the text
field.
Robert Bragg [Wed, 10 Feb 2010 11:57:58 +0000 (11:57 +0000)]
uprof: make the Redrawing timer a child of the Master Clock
Previously it was a child of the Mainloop, but it's more closely
a child of the Master Clock.
Robert Bragg [Wed, 10 Feb 2010 12:18:41 +0000 (12:18 +0000)]
backend-glx: Fix glXQueryVersion test
This fixes some backwards logic for asserting that we have a GLX major
version == 1 and a minor version >= 2. (NB: Although we technically
depend on GLX 1.3 features, we still have to support drivers that report
GLX 1.2 because there are a lot of mesa drivers out there incorrectly
report GLX 1.2 even though they export extensions that depend on GLX
1.3)
Neil Roberts [Wed, 10 Feb 2010 12:41:09 +0000 (12:41 +0000)]
cogl-material: Layers are not equal if the filters aren't equal
A material layer can not be considered equal if it is using different
texture filtering modes. This was causing problems where rectangles
with different filters would end up batched together and then rendered
with the wrong filter mode.
Emmanuele Bassi [Wed, 10 Feb 2010 10:58:14 +0000 (10:58 +0000)]
build: Tweak internal defines for building Clutter
When building Clutter we should:
• disable Cogl deprecated API;
• enable experimental API.
Robert Bragg [Wed, 20 Jan 2010 18:53:36 +0000 (18:53 +0000)]
debug: Adds CLUTTER_DEBUG=disable-swap-events option
This allows us to forcibly disable the use of the GLX_INTEL_swap_events
extension for testing or debugging purposes.
Robert Bragg [Thu, 12 Nov 2009 20:37:01 +0000 (20:37 +0000)]
glx backend: Adds support for GLX_INTEL_swap_event
If your OpenGL driver supports GLX_INTEL_swap_event that means when
glXSwapBuffers is called it returns immediatly and an XEvent is sent when
the actual swap has finished.
Clutter can use the events that notify swap completion as a means to
throttle rendering in the master clock without blocking the CPU and so it
should help improve the performance of CPU bound applications.
Robert Bragg [Thu, 14 Jan 2010 14:03:23 +0000 (14:03 +0000)]
glx backend: when running with GLX 1.3 then create GLXWindows for stages
Some extensions only support GLX versions > 1.3 and may not support
old style X Windows as GLXDrawables, so we now create GLXWindows for
stages when possible.
Neil Roberts [Tue, 9 Feb 2010 18:33:09 +0000 (18:33 +0000)]
clutter-backend: Fix the error check in _clutter_backend_create_stage
Commit
d2bdd3cb62 fixed some compiler warnings but also broke the
ability to create a stage. Although not having warnings from the
compiler is nice, it is also nice to be able to create a stage so lets
not invert the meaning of the error check.
Emmanuele Bassi [Tue, 9 Feb 2010 17:07:08 +0000 (17:07 +0000)]
cogl: Move material_copy() out of the deprecated section
We strongly suggest people should be using cogl_material_copy(), but it
was hidden behind the deprecation guards.