In case we are skipping too many frames, we should force the animation
instance to apply the final state of the animated interval inside the
::completed signal handler.
The Stage:offscreen property hasn't been tested for ages, and it
should really just use a FBO, not indirect rendering on a X Pixmap
only on X11. There are better ways anyway to get the current
contents of ClutterStage as a buffer anyway.
We might remove it at any later date, or actually make it work
properly.
When requesting a GLX visual from the X server we should explicitly
set the GL_DEPTH_SIZE and the GL_ALPHA_SIZE bits, otherwise some
functionality might just not work, or work unreliably.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1723
The GValue wrappers for ClutterShader types should always store
values using GL types (GLfloat, GLint) internally, but give and
take generic C types (float, int) to the Clutter side.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1359
The HLS to RGB conversion in case the S value is zero is:
R = G = B = luminance
ClutterColor uses a byte (0 to 255) for the R, G and B channels
encoding, while luminance is expressed using a floating point value
in the closed interval [0, 1]; thus the case above becomes:
R = G = B = (luminance * 255)
The clutter_color_from_hls() code is missing the final step of
de-normalizing the luminance value, and so it breaks the roundtrip
colorspace conversion between RGB and HLS.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1695
If clutter_x11_texture_set_window() was called after
clutter_x11_texture_pixmap_set_automatic(), then the Damage object would
not be properly created so updates to the window were ignored.
Refactor creation of the damage object to a separate function, and
call it from clutter_x11_texture_set_window() and clutter_x11_texture_set_pixmap()
as appropriate. Addition and removal of the filter function is made
conditional on priv->damage to make free_damage_resources() cleanly
idempotent.
See: http://bugzilla.gnome.org/show_bug.cgi?id=587189 for the original
bug report.
http://bugzilla.openedhand.com/show_bug.cgi?id=1710
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
If you select all the text in a ClutterText, there is an invisible
cursor position either at the beginning or end. If it's at the beginning,
the bug is that left arrow won't clear the selection. If it's at the end,
the bug is that the right arrow won't.
Here are the ways to reproduce it:
a. Ctrl-A selects all and moves the hidden cursor position to the left.
b. For single line: End, Shift-Home does the same.
c. Or manually moving to the end and doing Shift-Left Arrow to the
beginning.
These all put it in the state where right arrow will properly clear
selection and move to cursor position 1, but left arrow fails to clear
the selection.
For b and c above, the opposite will give you the end case where right
arrow doesn't work.
Anyway, it turns out clear_selection is getting called, it just doesn't
show up because it's not doing a queue_redraw. So the attached patch
seems to fix things.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
It might be desirable for some applications and/or platforms to get
every motion event that was delivered to Clutter from the windowing
backend. By adding a per-stage flag we can bypass the throttling
done when processing the events.
http://bugzilla.openedhand.com/show_bug.cgi?id=1665
Keep the CoglContext in sync between GL and GLES backends. We ought
to find a way to have a generic context, though, and have backend
specific sections.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1698
We need to explicitly force order so that ClutterJson.gir and Cogl.gir
are present in the parent directory before we try to build Clutter.typelib.
http://bugzilla.openedhand.com/show_bug.cgi?id=1700
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
On some platforms (anything but Linux, and on obscure Linux
architectures) dolt isn't used, so $(top_builddir)/doltlibtool
won't exist. $(top_builddir)/libtool will always be generated
even if dolt is used, so just use that unconditionally. We don't
need the extra speed when linking the single program for
introspection.
http://bugzilla.openedhand.com/show_bug.cgi?id=1699
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
A lot of applications change the size of the stage from the default
before the stage is initially shown. The size change won't take affect
until the first allocation run. However we want the window to be at
the correct size when we first map it so we should force an allocation
run before showing the stage.
There was an explicit call to XResizeWindow in
clutter_stage_x11_show. This is not needed anymore because
XResizeWindow will already have been called by the allocate method.
By default NSWindow does not listen to mousemoved events and hence the
default behaviour for Actors using the "motion-event" signal differs
from backend to backend.
Using setAcceptsMouseMovedEvents seems to fix it; unfortunately, I
cannot verify it, but since nobody is currently working on the Quartz
backend I guess it cannot get more broken than how currently is.
Thanks to: Michael <michael@f3k.org>
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1687
It would be useful inside a custom actor's paint function to be able to
tell if this is a primary paint call, or if we are in fact painting on
behalf of a clone.
In Mutter we have an optimization not to paint occluded windows; this is
desirable for the windows per se, to conserve bandwith to the card, but
if something like an application switcher is using clones of these windows,
they will not get painted either; currently we have no way of
differentiating between the two.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1685
The CLUTTER_TEXTURE_IN_CLONE_PAINT was used with the old CloneTexture
actor; now that we have ClutterClone nothing sets the private flag
anymore, and the flag itself is not needed.
Updating the WM hints on the stage window shortcircuits if the stage
is in WITHDRAWN state, so we need to move the update_wm_hints() call
after the flag has been unset.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
If we manually wait for the VBLANK with:
- SGI_video_sync
- Direct usage of the DRM ioctl
Then we should call glFinish() first, or otherwise the swap-buffers
may be delayed by pending drawing and cause a tear.
http://bugzilla.openedhand.com/show_bug.cgi?id=1636
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
commit e2c4a2a9f8 fixed one thing but broke many others things :-/
hopfully this fixes that.
It turned out that the journal was mistakenly setting the OVERRIDE_LAYER0
flush option for all entries, but some other logic errors were also
uncovered in _cogl_material_equal.
Added an internal clutter function, _clutter_master_clock_ensure_next_iteration
that ensures another iteration of the master clock, can be called from repaint
functions as well as other threads.
To help us handle sliced textures; When flushing materials there is an
override option that can be given to replace the texture name for layer0
so we may iterate the slices without needing to modify the material
in use.
Since improving the journal's ability to batch state changes we added a
_cogl_material_equals function that is used by the journal to compare
materials and identify when a state change is required, but this wasn't
correctly considering the layer0 override resulting in false positives that
meant the journal wouldn't update the GL state and the first texture name
was used for all slices.
The cost of glGetFloatv with Mesa is still representing a majority of our
time in OpenGL for some applications, and the last thing left using this is
the current-matrix API when getting the projection matrix.
This adds a matrix stack for the projection matrix, so all getting, setting
and modification of the projection matrix is now managed by Cogl and it's only
when we come to draw that we flush changes to the matrix to OpenGL.
This also brings us closer to being able to drop internal use of the
deprecated OpenGL matrix functions, re: commit 54159f5a1d
The clutter_actor_get_allocation_coords() is not used, and since
the switch to floats in the Actor's API, it returns exactly what
the get_allocation_box() returns.
Currently, the transformation matrix for an actor is constructed
from scenegraph-related accessors. An actor, though, can call COGL
API to add new transformations inside the paint() implementation,
for instance:
static void
my_foo_paint (ClutterActor *a)
{
...
cogl_translate (-scroll_x, -scroll_y, 0);
...
}
Unfortunately these transformations will be completely ignored by
the scenegraph machinery; for instance, getting the actor-relative
coordinates from event coordinates is going to break badly because
of this.
In order to make the scenegraph aware of the potential of additional
transformations, we need a ::apply_transform() virtual function. This
vfunc will pass a CoglMatrix which can be used to apply additional
operations:
static void
my_foo_apply_transform (ClutterActor *a, CoglMatrix *m)
{
CLUTTER_ACTOR_CLASS (my_foo_parent_class)->apply_transform (a, m);
...
cogl_matrix_translate (m, -scroll_x, -scroll_y, 0);
...
}
The ::paint() implementation will be called with the actor already
using the newly applied transformation matrix, as expected:
static void
my_foo_paint (ClutterActor *a)
{
...
}
The ::apply_transform() implementations *must* chain up, so that the
various transformations of each class are preserved. The default
implementation inside ClutterActor applies all the transformations
defined by the scenegraph-related accessors.
Actors performing transformations inside the paint() function will
continue to work as previously.
Scanners like gtk-doc and g-ir-scanner get confused by:
typedef struct _Foo {
...
} Foo;
And expect instead:
typedef struct _Foo Foo;
struct _Foo {
...
};
CoglMatrix definition should be changed to avoid the former type.
The race we were experiencing in the X11 backends is apparently
back after the fix in commit 00a3c698.
This time, just delaying the setting of the SYNC_MATRICES flag
is not enough, so we can resume the use of a STAGE_IN_RESIZE
private flag.
This should also fix bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1668
In order to validate the sequence of:
XResizeWindow
ConfigureNotify
glViewport
that should happen on X11 we need to add debug annotations to the
calls to glViewport() done through COGL.