This makes a change to the original point_in_poly algorithm from:
http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
The aim was to tune the test so that tests against screen aligned
rectangles are more resilient to some in-precision in how we transformed
that rectangle into screen coordinates. In particular gnome-shell was
finding that for some stage sizes then row 0 of the stage would become a
dead zone when going through the software picking fast-path and this was
because the y position of screen aligned rectangles could end up as
something like 0.00024 and the way the algorithm works it doesn't have
any epsilon/fuz factor to consider that in-precision.
We've avoided introducing an epsilon factor to the comparisons since we
feel there's a risk of changing some semantics in ways that might not be
desirable. One of those is that if you transform two polygons which
share an edge and test a point close to that edge then this algorithm
will currently give a positive result for only one polygon.
Another concern is the way this algorithm resolves the corner case where
the horizontal ray being cast to count edge crossings may cross directly
through a vertex. The solution is based on the "idea of Simulation of
Simplicity" and "pretends to shift the ray infinitesimally down so that
it either clearly intersects, or clearly doesn't touch". I'm not
familiar with the idea myself so I expect a misplaced epsilon is likely
to break that aspect of the algorithm.
The simple solution this patch applies is to pixel align the polygon
vertices which should eradicate most noise due to in-precision.
https://bugzilla.gnome.org/show_bug.cgi?id=641197
Anything that is not CLUTTER_INIT_SUCCESS is to be considered an error.
This fixes the Clutter initialization sequence to actually error out
on pre-conditions and backend initialization failures.
clutter_offscreen_effect_pre_paint was using the unitialized value of
the ‘box’ variable whenever the actor doesn't have a paint
volume. This patch makes it just set the offset to 0,0 instead.
When removing the opacity override in the post_paint implementation,
ClutterOffscreenEffect would always set the override back to -1. This
ends up cancelling out the effect of any overrides from outer effects
which means that if any actor has multiple effects attached then it
would apply the opacity multiple times.
To fix this, the effect now preserves the old value of the opacity
override and restores that instead of setting -1.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2541
This is needed if an effect wants to temporarily override the paint
opacity. It needs to be able to restore the old opacity override in
the post_paint handler otherwise it would replace the effect of the
opacity override from any outer effects.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2541
The OffscreenEffect class needs to expose a way for sub-classes to
track the size of FBO it creates, in case it has to do some geometry
deformations like the DeformEffect sub-classes.
Let's move the private symbol we used internally in 1.6 to fix
DeformEffect to the list of public symbols of OffscreenEffect.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2570
The table we use for converting between keysyms and Unicode should be
static and constified, so that it can live in the .rodata section of
the ELF shared object, and be shared among processes.
This change moves the table to a source file, instead of an header; the
change also requires the clutter_keysym_to_unicode() function to be
moved from clutter-event.c into this new source file. The declaration is
still in clutter-event.h, so we don't need to do anything special.
Creating a synthetic event requires direct access to the ClutterEvent
union members; this access does not map in bindings to high-level
languages, especially run-time bindings using GObject-Introspection.
It's also midly annoying from C, as it unnecessarily exposes the guts of
ClutterEvent - something we might want to fix in the future.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2575
Many people expect clutter_init to work the same way as gtk_init which
exits the program on init failure. clutter_init however returns a
status code on failure which applications need to handle because if
the init fails then any further Clutter calls are likely to crash. In
Clutter 2.0 we may want to change this to be more like GTK+.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2574
When using a pipeline and the journal to blit images between
framebuffers, it should disable blending. Otherwise it will end up
blending the source texture with uninitialised garbage in the
destination texture.
Converting from Pango units to pixels by using the C conventions might
cause us to lose a pixel; since we're doing the same for the height, we
should use ceilf() to round up the width and the line height.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2573
The ClutterDeformEffect sub-classes are effectively deforming the
texture target of an FBO, not the actor itself. Thus, we need to
use the FBO's size, and not the actor's allocated size, given that
the actor might be transformed prior to applying an effect.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2571
Since the FBO target might have a different size than the mere paint box
of the actor, we need API to get it out of the ClutterOffscreenEffect
private data structure and on to sub-classes.
Since we cannot add new API in a stable cycle, we need a private
function; we'll leave it there even when opening 1.7, since it's useful
for internal purposes.
Once upon a time, the land of Clutter had a stage singleton. It was
created automatically at initialization time and stayed around even
after the main loop was terminated. The singleton was content in
being all there was. There also was a global API to handle the
configuration of the stage singleton that would affect the behaviour
on other classes, signals and properties.
Then, an evil wizard came along and locked the stage singleton in his
black tower, and twisted it until it was possible to create new stages.
These new stages were pesky, and didn't have the same semantics of the
singleton: they didn't stay around when closed, or terminate the main
loop on delete events.
The evil wizard also started moving all the stage-related API from the
global context into class-specific methods.
Finally, the evil wizard cast a spell, and the stage singleton was
demoted to creation on demand - and until somebody called the
clutter_stage_get_default() function, the singleton remained in a limbo
of NULL pointers and undefined memory areas.
There was a last bit - literally - of information still held by the
global API; a tiny, little flag that disabled per-actor motion events.
The evil wizard added private accessors for it, and stored it inside the
stage private structure, in preparation for a deprecation that would
come in a future development cycle.
The evil wizard looked down upon the land of Clutter from the height of
his black tower; the lay of the land had been reshaped into a crucible
of potential, and the last dregs of the original force of creation were
either molted into new, useful shapes, or blasted away by the sheer fury
of his will.
All was good.
The clutter-id-pool.h header is private and not installed; yet, all the
clutter_id_pool_* symbols are public. Let's correct this oversight we've
been stringing along since forever.
Only allow access to the ClutterMainContext through the private
_clutter_context_get_default() function, so we can easily grep
it and remove the unwanted usage of the global context.
The shader stack held by ClutterMainContext should only be accessed
using functions, and not directly.
Since it's a stack, we can use stack-like operations: push, pop and
peek.
The _clutter_do_redraw() function should really be moved inside
ClutterStage, since all it does is calling private stage and
backend functions. This also allows us to change a long-standing
issue with a global fps counter for all stages, instead of a\
per-stage one.
Let's try and start reducing the size of ClutterActorPrivate by moving
some optional, out-of-band data from it to GObject data.
The ShaderData structure is a prime candidate for this migration: it
does not need to be inspected by the actor, and its relationship with an
actor is transient and optional.
By attaching it to the actor's instance through g_object_set_data() we
neatly tie its lifetime to the instance, and we don't have to care
cleaning it up in the finalize()/dispose() implementation of
ClutterActor itself.
If an atlas texture's last reference is held by the journal or by the
last flushed pipeline then if an atlas migration is started it can
cause a crash. This is because the atlas migration will cause a
journal flush and can sometimes change the current pipeline which
means that the texture would be destroyed during migration.
This patch adds an extra 'post_reorganize' callback to the existing
'reorganize' callback (which is now renamed to 'pre_reorganize'). The
pre_reorganize callback is now called before the atlas grabs a list of
the current textures instead of after so that it doesn't matter if the
journal flush destroys some of those textures. The pre_reorganize
callback for CoglAtlasTexture grabs a reference to all of the textures
so that they can not be destroyed when the migration changes the
pipeline. In the post_reorganize callback the reference is removed
again.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2538
In _clutter_actor_queue_redraw_with_clip it has a local variable to
mark when a new paint volume for the clip is created so that it can be
freed when the function returns. However the actual code to free the
paint volume went missing in 3b789490d2 so the variable did
nothing. This patch just adds the free back in.
When Cogl debugging is disabled then the 'waste' variable is not used
so it throws a compiler warning. This patch removes the variable and
the value is calculated directly as the parameter to COGL_NOTE.
Some code was doing pointer arithmetic on the return value from
cogl_buffer_map which is void* pointer. This is a GCC extension so we
should try to avoid it. This patch adds casts to guint8* where
appropriate.
Based on a patch by Fan, Chun-wei.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2561