The asynchronous loading code could do with some modernization.
First of all, we should drop the internal GMutex held when manipulating
the boolean flags: it's far too expensive for its role, and modern GLib
provides us with bitlocks that are quite a lot faster.
Then we should consolidate most of the implementation into something
smaller and more manageable.
The ClutterGeometry type is a poor substitute of cairo_rectangle_int_t,
with unsigned integers for width and height to complicate matters.
Let's remove the internal usage of ClutterGeometry and switch to the
rectangle type from Cairo.
https://bugzilla.gnome.org/show_bug.cgi?id=656663
When testing the performance of an application, it's often useful to
force it to continuously redraw instead of going idle to help measure
the frame rate. This just adds a CLUTTER_PAINT=continuous-redraw which
causes the master clock to queue a redraw on all of the stages
just before it prepares its source.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
When the viewport gets expanded because the actor extends off the edge
of the screen, instead of applying the transformation to the root of
the modelview transformation it is now applied to the end of the
projection transformation. This should end up with the same
transformation. This fixes a problem when the offscreen effects are
nested and the inner effect would try to pick up the current modelview
transformation to rescale it to fit the new viewport size. In this
case the modelview would have already been scaled for the size of the
outer viewport so it would end up wrong.
https://bugzilla.gnome.org/show_bug.cgi?id=659601
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Reviewed-by: Robert Bragg <robert@linux.intel.com>
A ClutterText in password mode should have the ability to show the last
input character. This feature allows easier password entry on platforms
with unreliable keyboards, such as touchscreens or small devices.
https://bugzilla.gnome.org/show_bug.cgi?id=652588
Add a setting that controls whether ClutterText actors in password mode
should display the last input character for a defined time. This helps
on touch-based interfaces.
https://bugzilla.gnome.org/show_bug.cgi?id=652588
In _clutter_actor_set_default_paint_volume we were returning FALSE if an
actor has an empty allocation because we were claiming it doesn't have a
paint-volume. Actually an empty/degenerate pv is valid and has different
semantics to returning FALSE because FALSE means the pv is unknown and
so Clutter will have to assume the worst - that the pv is basically
un-bounded.
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
This implicitly intersects any clip for redrawing with the stage window
bounds. Without this we were sometimes trying to set huge off screen
scissors leading to undefined clipping results.
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Out-of-band transforms are considered to be all actor transforms done
directly with the Cogl API instead of via ClutterActor::apply_transform.
By running with CLUTTER_DEBUG=oob-transform then Clutter will explicitly
try to detect when un-expected transforms have been applied to the
modelview matrix stack.
Out-of-band transforms can lead to awkward bugs in Clutter applications
because Clutter itself doesn't know about them and this can disrupt
Clutter's input handling and calculations of actor paint-volumes
which can lead to visual artifacts.
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
For god-knows-what reason, at-spi is trying various formats
of strings when registering listeners, triggering an ugly
(gnome-shell:4411): Clutter-WARNING **: invalid object type create
warning in .xsession-errors. Stop doing that.
Also don't leak temporary string arrays that are a side-effect
of passing parameters around as formatted strings.
https://bugzilla.gnome.org/show_bug.cgi?id=658721
A bunch of private functions we use when parsing got exposed accidentaly
to the list of public symbols by virtue of not having the leading '_'
that we use to filter them out of the shared object — all the while the
header that declares them is a private, non installed one.
Let's rectify this situation with a bit of minor surgery on the code.
The priv->text field cannot ever be NULL, so we don't need to check for
that in a series of places. We also need to assert() that pre-condition
in the couple of places where we set the contents of the ClutterText
actor, namely in set_text_internal() and set_markup_internal().
Based on a patch by: Dan Winship <danw@gnome.org>
http://bugzilla.clutter-project.org/show_bug.cgi?id=2629
Setting :use-markup and :text is currently not idempotent, and it
depends on the ordering, e.g.:
g_object_set (actor, "use-markup", TRUE, "text", value, NULL);
does not yield the same results as:
g_object_set (actor, "text", value, "use-markup", TRUE, NULL);
This is particularly jarring when using ClutterText from ClutterScript,
but in general GObject properties should not rely on the order when used
from g_object_set().
The fix is to store the contents of the ClutterText as a separate string
from the displayed text, and use the contents, instead of the displayed
text, when toggling the :use-markup property.
Let's also add a unit test for good measure, to try and catch
regressions.
https://bugzilla.gnome.org/show_bug.cgi?id=651940
The easing test is a nice example of what ClutterAnimation and
clutter_actor_animate() can do. The "tween ball to the pointer
event coordinates" is a bit of a staple in animation libraries
and their documentation.
When we paint a ClutterText we ask the actor for a PangoLayout that fits
inside the actor's allocation - both width and height.
Sadly, whenever a height is set on a PangoLayout, Pango will wrap its
contents - regardless of whether the layout should actually wrap or not.
This means that in certain easy to exploit cases, Clutter will paint a
Text actor with its contents wrapping even if the :wrap property is set
to FALSE.
In order to fix this we need to encode some more cases inside the
::paint implementation of ClutterText, and ask the cache for a layout
that is sized as the allocation's width, but not as its height; we also
need to perform a clip if we detect that the PangoLayout's logical size
is going to overflow the allocated size. This clip might cause some
performance issue, given that clipping breaks batching in the Cogl
journal; hopefully all clips for text are going to be screen-aligned, so
at the end of the batch it'll just scissor them out.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2339
Like commit d0439cfb586ca14282c89035119a4acbc0295df7 for
AlignConstraint, let's check that the BindConstraint source is not
a child or a grandchild of the actor attached to the Constraint.
AlignConstraint won't work if the source is a child or a grandchild of
the ClutterActorMeta:actor to which it has been attached to: the
allocation flows from the parent to its children, not the other way
around; in order to avoid weirdness, we better document and check
that when we set the actor and when we set the source.
The repaint functions list can (and should) be manipulated from
different threads, but it currently doesn't prevent multiple threads
from accessing it concurrently. We should have a simple lock and take it
when adding and removing elements from the list; the invocation is still
performed under the Big Clutter Lock™, so it doesn't require special
handling.
Because we have had several reports about significant performance
regressions since we enabled offscreen redirection by default for
handling correct opacity we are now turning this feature off by default.
We feel that clutter should prioritize performance over correctness in
this case. Correct opacity is still possible if required but the
overhead of the numerous offscreen allocations as well as the cost of
many render target switches per-frame seems too high relative the
improvement in quality for many cases.
On reviewing the offscreen_redirect property so we have a way to
disable redirection by default we realized that it makes more sense for
it to take a set of flags instead of an enum so we can potentially
extend the number of things that might result in offscreen redirection.
We removed the ability to say REDIRECT_ALWAYS_FOR_OPACITY, since it
seems that implies you don't trust the implementation of an actor's
has_overlaps() vfunc which doesn't seem right.
The default value if actor::redirect_offscreen is now 0 which
effectively means don't ever redirect the actor offscreen.