DeformEffect is an abstract class that should be used to write effects
that change the geometry of an actor before submitting it to the GPU.
Just like the ShaderEffect class, DeformEffect renders the actor to
which it has been applied into an FBO; then it creates a mesh and stores
it inside a VBO. Sub-classes can control vertex attributes like
position, texel coordinates and the color.
As with a351ff2af earlier, distributing headers generated at configure
time conflicts with out of tree builds as the distributed headers will
be included first instead of including the generated ones.
clutter-jon.h is generated at configure time, we should not distribute it.
This caused a build issue when compiling from a tarballs and out of tree
builds as we ended up with two clutter-json.h one in $(top_srcdir)/json
and the other in $(top_builddir)/json and picked up the wrong one
($(top_srcdir)/json is included first in the include search path).
A simple, GLSL shader-based blur effect.
The blur shader is taken straight from the test-shader.c interactive
test case. It's a fairly clunky, inefficient and visually incorrect
implementation of a box blur, but it's all we have right now until I
figure out a way to do multi-pass shading with the current API.
The ShaderEffect class is an abstract base type for shader-based
effects. GLSL-based effects should be implemented by sub-classing
ShaderEffect and overriding ActorMeta::set_actor() to set the source
code of the shader, and Effect::pre_paint() to update the uniform
values, if any.
The ShaderEffect has a generic API for sub-classes to set the values
of the uniforms defined by their shaders, and it uses the shader
types we defined for ClutterShader, to avoid re-inventing the wheel
every time.
The OffscreenEffect class is meant to be used to implement Effect
sub-classes that create an offscreen framebuffer and redirect the
actor's paint sequence there. The OffscreenEffect is useful for
effects using fragment shaders.
Any shader-based effect being applied to an actor through an offscreen
buffer should be used before painting the resulting target material and
not for every actor. This means that doing:
pre_paint: cogl_program_use(program)
set up offscreen buffer
paint: [ actors ] → offscreen buffer → target material
post_paint: paint target material
cogl_program_use(null)
Is not correct. Unfortunately, we cannot really do:
post_paint: cogl_program_use(program)
paint target material
cogl_program_use(null)
Because the OffscreenEffect::post_paint() implementation also pops the
offscreen buffer and re-instates the previous framebuffer:
post_paint: cogl_program_use(program)
change frame buffer ← ouch!
paint target material
cogl_program_use(null)
One way to fix it is to allow using the shader right before painting
the target material - which means adding a new virtual inside the
OffscreenEffect class vtable in additions to the ones defined by the
parent Effect class.
The newly-added paint_target() virtual allows the correct sequence of
actions by adding an entry point for sub-classes to wrap the "paint
target material" operation with custom code, in order to implement the
case above correctly as:
post_paint: change frame buffer
cogl_program_use(program)
paint target material
cogl_program_use(null)
The added upside is that sub-classes of OffscreenEffect involving
shaders really just need to override the prepare() and paint_target()
virtuals, since the pre_paint() and post_paint() do all that's needed.
ClutterEffect is an abstract class that should be used to apply effects
on generic actors.
The ClutterEffect class just defines what an effect should implement; it
could be defined as an interface, but we might want to add some default
behavior dependent on the internal state at a later point.
The effect API applies to any actor, so we need to provide a way to
assign an effect to an actor, and let ClutterActor call the Effect
methods during the paint sequence.
Once an effect is attached to an actor we will perform the paint in this
order:
• Effect::pre_paint()
• Actor::paint signal emission
• Effect::post_paint()
Since an effect might collide with the Shader class, we either allow a
shader or an effect for the time being.
We need to tell the introspection scanner all the dependencies we
require, including the pkg-config name to use when compiling the
GIR file into a typelib object.
ClickAction adds "clickable" semantics to an actor. It provides all
the business logic to emit a high-level "clicked" signal from the
various low-level signals inside ClutterActor.
* wip/state-machine:
Do not use wildcards in test-state
script: Implement State deserialization
state: added a "target-state" property
state: documented data structures
Add State interactive tests to the ignore file
state: Documentation and introspection annotation fixes
state: Minor coding style fixes
state: Clean up the header's documentation
state: Constify StateKey accessors
Do not include clutter.h from a Clutter header file
state-machine: made clutter_state_change take a boolean animate argument
state-machine: use clutter_timeline_get_progress
state-machine: add completed signal
state machine: added state machine
Conflicts:
.gitignore
* wip/constraints: (24 commits)
Add the Cogl API reference to the fixxref extra directories
Document the internal MetaGroup class
Remove the construct-only flag from ActorMeta:name
doc: Remove gtk-doc annotations from the json-glib copy
doc: Fix parameter documentation
Add named modifiers for Action and Constraint
Remove a redundant animation
Set the stage resizable in test-constraints
Use a 9 grid for the constraints test
Miscellaneous documentation fixes
docs: Document animating action and constraint properties
docs: Document BindConstraint and AlignConstraint
constraint: Rename BindConstraint:bind-axis
constraints: Add AlignConstraint
tests: Add a constraints interactive test
constraint: Add BindConstraint
actor: Implement Animatable
animation: Use the new Animatable API for custom properties
animatable: Add custom properties to Animatable
constraint: Add ClutterConstraint base class
...
Conflicts:
configure.ac
AlignConstraint is a simple constraint that keeps an actor's position
aligned to the width or height of another actor, multiplied by an
alignment factor.
The Constraint base, abstract class should be used to implement Actor
modifiers that affect the way an actor is sized or positioned inside a
fixed layout manager.
DragAction is an Action sub-class that provides dragging capabilities to
any actor. DragAction has:
• drag-begin, drag-motion and drag-end signals, relaying the event
information like coordinates, button and modifiers to user code;
• drag-threshold property, for delaying the drag start by a given
amount of pixels;
• drag-handle property, to allow using other actors as the drag
handle.
• drag-axis property, to allow constraining the dragging to a specific
axis.
An interactive test demonstrating the various features is also provided.
ClutterAction is an abstract class that should be used as the ancestor
for objects that change how an actor behaves when dealing with events
coming from user input.
ClutterActorMeta is a base, abstract class that can be used to derive
classes that are attached to a ClutterActor instance in order to modify
the way an actor is painted, sized/positioned or responds to events.
A typed container for ActorMeta instances is also provided to the
sub-classes can be attached to an Actor.
ClutterAnimator is a class for managing the animation of multiple
properties of multiple actors over time with keyframing of values.
The Animator class is meant to be used to effectively describe
animations using the ClutterScript definition format, and to construct
complex implicit animations from the ground up.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
The SDL API is far too limited for the windowing system needs of
Clutter; the status of the SDL backend was always experimental, and
since the Windows platform is supported by a native backend there is
no point in having the SDL backend around any more.
The win32 backend now handles the WM_SETCURSOR message and sets a
fully transparent cursor if the cursor-visible property has been
cleared on the stage. The icon is stored in the library via a resource
file. The instance handle for the DLL is needed to load the resource
so there is now a DllMain function to grab the handle.
Some source files should not be passed through the introspection parser,
as they are fully private and do not expose any valuable API.
Also the clutter-profile.h header is private and should not be
installed.
UProf is a small library that aims to help applications/libraries provide
domain specific reports about performance. It currently provides high
precision timer primitives (rdtsc on x86) and simple counters, the ability
to link statistics between optional components at runtime and makes report
generation easy.
This adds initial accounting for:
- Total mainloop time
- Painting
- Picking
- Layouting
- Idle time
The timing done by uprof is of wall clock time. It's not based on stochastic
samples we simply sample a counter at the start and end. When dealing with
the complexities of GPU drivers and with various kinds of IO this form of
profiling can be quite enlightening as it will be able to represent where
your application is blocking unlike tools such as sysprof.
To enable uprof accounting you must configure Clutter with --enable-profile
and have uprof-0.2 installed from git://git.moblin.org/uprof
If you want to see a report of statistics when Clutter applications exit you
should export CLUTTER_PROFILE_OUTPUT_REPORT=1 before running them.
Just a final word of caution; this stuff is new and the manual nature of
adding uprof instrumentation means it is prone to some errors when modifying
code. This just means that when you question strange results don't rule out
a mistake in the instrumentation. Obviously though we hope the benfits out
weigh e.g. by focusing on very key stats and by having automatic reporting.
• The debug flags are pre-processor ones, so they should be listed
inside AM_CPPFLAGS.
• Clutter's publicly exported symbols match the following regular
expression:
^(clutter|cogl|json)_*
The old one also listed "pango" as a possible prefix, but the
Pango API is now under the Cogl namespace.
* layout-manager: (50 commits)
docs: Reword a link
layout, docs: Add more documentation to LayoutManager
layout, docs: Fix description of Bin properties
layout, bin: Use ceilf() instead of casting to int
layout, docs: Add long description for FlowLayout
layout, box: Clean up
layout, box: Write long description for Box
layout, docs: Remove unused functions
layout: Document BoxLayout
layout: Add BoxLayout, a single line layout manager
layout: Report the correct size of FlowLayout
layout: Resizing the stage resizes the FlowLayout box
layout: Use the get_request_mode() getter in BinLayout
layout: Change the request-mode along with the orientation
actor: Add set_request_mode() method
[layout] Remove FlowLayout:wrap
[layout] Rename BinLayout and FlowLayout interactive tests
[layout] Skip invisible children in FlowLayout
[layout] Clean up and document FlowLayout
[layout] Snap children of FlowLayout to column/row
...
The JSON conditional rules can be moved outside the introspection
conditional ones to avoid a nested check, as all the JSON rules do
is setting up variables that may or may not be used.
As part of an incremental process to have Cogl be a standalone project we
want to re-consider how we organise the Cogl source code.
Currently this is the structure I'm aiming for:
cogl/
cogl/
<put common source here>
winsys/
cogl-glx.c
cogl-wgl.c
driver/
gl/
gles/
os/ ?
utils/
cogl-fixed
cogl-matrix-stack?
cogl-journal?
cogl-primitives?
pango/
The new winsys component is a starting point for migrating window system
code (i.e. x11,glx,wgl,osx,egl etc) from Clutter to Cogl.
The utils/ and pango/ directories aren't added by this commit, but they are
noted because I plan to add them soon.
Overview of the planned structure:
* The winsys/ API is the API that binds OpenGL to a specific window system,
be that X11 or win32 etc. Example are glx, wgl and egl. Much of the logic
under clutter/{glx,osx,win32 etc} should migrate here.
* Note there is also the idea of a winsys-base that may represent a window
system for which there are multiple winsys APIs. An example of this is
x11, since glx and egl may both be used with x11. (currently only Clutter
has the idea of a winsys-base)
* The driver/ represents a specific varient of OpenGL. Currently we have "gl"
representing OpenGL 1.4-2.1 (mostly fixed function) and "gles" representing
GLES 1.1 (fixed funciton) and 2.0 (fully shader based)
* Everything under cogl/ should fundamentally be supporting access to the
GPU. Essentially Cogl's most basic requirement is to provide a nice GPU
Graphics API and drawing a line between this and the utility functionality
we add to support Clutter should help keep this lean and maintainable.
* Code under utils/ as suggested builds on cogl/ adding more convenient
APIs or mechanism to optimize special cases. Broadly speaking you can
compare cogl/ to OpenGL and utils/ to GLU.
* clutter/pango will be moved to clutter/cogl/pango
How some of the internal configure.ac/pkg-config terminology has changed:
backendextra -> CLUTTER_WINSYS_BASE # e.g. "x11"
backendextralib -> CLUTTER_WINSYS_BASE_LIB # e.g. "x11/libclutter-x11.la"
clutterbackend -> {CLUTTER,COGL}_WINSYS # e.g. "glx"
CLUTTER_FLAVOUR -> {CLUTTER,COGL}_WINSYS
clutterbackendlib -> CLUTTER_WINSYS_LIB
CLUTTER_COGL -> COGL_DRIVER # e.g. "gl"
Note: The CLUTTER_FLAVOUR and CLUTTER_COGL defines are kept for apps
As the first thing to take advantage of the new winsys component in Cogl;
cogl_get_proc_address() has been moved from cogl/{gl,gles}/cogl.c into
cogl/common/cogl.c and this common implementation first trys
_cogl_winsys_get_proc_address() but if that fails then it falls back to
gmodule.
for the marshal files $(srcdir) was getting prefixed twice since my last
commit (2cc88f1140) since it was already being prefixed including
Makefile.am. The problem with prefixing it in the includer file though is
that the Make variable substitutions like :.list=.h mean we end up
generating into the $(srcdir). This removes the prefix added in
clutter/Makefile.am
We were also missing a $(srcdir) prefix when setting EXTRA_DIST
FlowLayout is a layout manager that arranges its children in a
reflowing line; the orientation controls the major axis for the
layout: horizontal, for reflow on the Y axis, and vertical, for
reflow on the X axis.
Instead of overloading ClutterChildMeta with both container and layout
metadata and delegate to every LayoutManager implementation to keep a
backpointer to the layout manager instance, we can simply subclass
ChildMeta into LayoutMeta and presto! everything works out pretty well
for everyone.
A BinLayout is a simple layout manager that allocates a single cell,
providing alignment on both the horizontal and vertical axis.
If the container associated to the BinLayout has more than one child,
the preferred size returned by the layout manager will be as big as
the maximum of the children preferred sizes; the allocation will be
applied to all children - but it will still depend on each child
preferred size and the BinLayout horizontal and vertical alignment
properties.
The supported alignment properties are:
* center: align the child by centering it
* start: align the child at the top or left border of the layout
* end: align the child at the bottom or right border of the layout
* fill: expand the child to fill the size of the layout
* fixed: let the child position itself
The LayoutManager class is an abstract proxy for the size requesition
and size allocation process in ClutterActor.
A ClutterLayoutManager sub-class must implement get_preferred_width(),
get_preferred_height() and allocate(); a ClutterContainer using the
LayoutManager API will then proxy the corresponding Actor virtual
functions to the LayoutManager instance. This allows having a generic
"blank" ClutterActor sub-class, implementing the ClutterContainer
interface, which leaves only the layout management implementation to
the application developers.