profile/ivi/clutter.git
14 years agoWhitespace fix for cogl-color.h
Emmanuele Bassi [Thu, 19 Nov 2009 13:33:08 +0000 (13:33 +0000)]
Whitespace fix for cogl-color.h

14 years agodocs: Documentation fixes for CoglMaterial
Emmanuele Bassi [Thu, 19 Nov 2009 13:31:38 +0000 (13:31 +0000)]
docs: Documentation fixes for CoglMaterial

Clean up the references, the docbook tags, and the style to fit in
with the rest of the API references for Cogl and Clutter.

14 years agodocs: Documentation fixes for CoglBitmap
Emmanuele Bassi [Thu, 19 Nov 2009 13:29:02 +0000 (13:29 +0000)]
docs: Documentation fixes for CoglBitmap

• Use the same style for the Cogl API reference as the one used for
  the Clutter API reference.

• Fix the introspection annotations for cogl_bitmap_get_size_from_file()

14 years agodocs: Fix Cogl API reference build
Emmanuele Bassi [Thu, 19 Nov 2009 12:34:06 +0000 (12:34 +0000)]
docs: Fix Cogl API reference build

• Ignore all the private header files

• Add all missing/unused symbols

• Remove deprecated symbols from 0.*

14 years agodocs: Remove non-gtk-doc annotations
Emmanuele Bassi [Thu, 19 Nov 2009 12:32:59 +0000 (12:32 +0000)]
docs: Remove non-gtk-doc annotations

The imported Mesa matrix code has some documentation annotations
that make gtk-doc very angry. Since it's all private anyway we
can safely make gtk-doc ignore the offending stuff.

14 years agodocs: Fix the 'Since' annotation for some functions
Neil Roberts [Thu, 19 Nov 2009 11:51:21 +0000 (11:51 +0000)]
docs: Fix the 'Since' annotation for some functions

The 'Since' annotation needs to have a colon after it or gtk-doc won't
pick it up.

14 years agocogl: Use APIENTRY for GL function pointer declarations
Neil Roberts [Wed, 18 Nov 2009 19:09:10 +0000 (19:09 +0000)]
cogl: Use APIENTRY for GL function pointer declarations

This matters for platforms such as Windows that use a different
calling covention from the default for GL functions.

14 years agobuild: Fix out-of-tree builds for cogl-defines.h
Neil Roberts [Wed, 18 Nov 2009 19:23:57 +0000 (19:23 +0000)]
build: Fix out-of-tree builds for cogl-defines.h

$(COGL_DRIVER)/cogl-defines.h is generated in the configure script so
it ends up in the build directory. Therefore the build rule for
cogl/cogl-defines.h should depend on the file in $(builddir) not
$(srcdir).

14 years agodocs: Clean up deprecation notices
Emmanuele Bassi [Wed, 18 Nov 2009 18:04:13 +0000 (18:04 +0000)]
docs: Clean up deprecation notices

The deprecation notices in gtk-doc should also refer to the
release that added the deprecation, and if the deprecated
symbol has been replaced by something else then the new symbol
should be correctly referenced.

14 years agobuild: Make cogl.h not conditional on driver defines
Emmanuele Bassi [Wed, 18 Nov 2009 17:35:07 +0000 (17:35 +0000)]
build: Make cogl.h not conditional on driver defines

The main COGL header cogl.h is currently created at configure time
because it conditionally includes the driver-dependent defines. This
sometimes leads to a stale cogl.h with old definitions which can
break the build until you clean out the whole tree and start from
scratch.

We can generate a stable cogl-defines.h at build time from the
equivalent driver-dependent header and let cogl.h include that
file instead.

14 years agotest-npot-texture: Add some verbose notes
Neil Roberts [Wed, 18 Nov 2009 17:16:38 +0000 (17:16 +0000)]
test-npot-texture: Add some verbose notes

This just adds some verbose output stating whether Cogl thinks that
NPOT textures are supported.

14 years agodisable-npots: Don't allow the GL version to be 2.0
Neil Roberts [Wed, 18 Nov 2009 14:21:22 +0000 (14:21 +0000)]
disable-npots: Don't allow the GL version to be 2.0

Cogl now assumes non-power-of-two textures are supported if the GL
version is >= 2.0 so the disable-npots utility should also change the
GL version.

14 years agobuild: Fix EXTRA_DIST and MAINTAINERCLEANFILES rules
Emmanuele Bassi [Wed, 18 Nov 2009 15:21:09 +0000 (15:21 +0000)]
build: Fix EXTRA_DIST and MAINTAINERCLEANFILES rules

14 years agoUpdate README file
Emmanuele Bassi [Wed, 18 Nov 2009 15:11:56 +0000 (15:11 +0000)]
Update README file

14 years agodocs: Update the "writing a backend" documentation
Emmanuele Bassi [Wed, 18 Nov 2009 15:06:37 +0000 (15:06 +0000)]
docs: Update the "writing a backend" documentation

The documentation on how a ClutterBackend and stage are implemented
is a wee bit out of date.

14 years agoRemove clutter.symbols
Emmanuele Bassi [Wed, 18 Nov 2009 14:56:59 +0000 (14:56 +0000)]
Remove clutter.symbols

The symbols file is unused since Clutter 0.6, and the win32 backend
does not depend on it anymore.

14 years agoRename ChangeLog.SVN
Emmanuele Bassi [Wed, 18 Nov 2009 14:56:25 +0000 (14:56 +0000)]
Rename ChangeLog.SVN

14 years agobuild: Add cogl-matrix-private.h to the dist
Emmanuele Bassi [Wed, 18 Nov 2009 14:37:43 +0000 (14:37 +0000)]
build: Add cogl-matrix-private.h to the dist

14 years agobuild: Add cogl-feature-functions.h to the dist
Emmanuele Bassi [Wed, 18 Nov 2009 14:34:33 +0000 (14:34 +0000)]
build: Add cogl-feature-functions.h to the dist

14 years agobuild: Generate per-cycle ChangeLog files
Emmanuele Bassi [Wed, 18 Nov 2009 14:21:08 +0000 (14:21 +0000)]
build: Generate per-cycle ChangeLog files

We should generate a ChangeLog for each minor version cycle, starting
from the Git import date (since before that we used ChangeLog-style
commit messages that don't really look good with the Git ones).

For this reason we can take Cairo's Makefile.am.changelog file and,
after tweaking it to fit our use case, let it generate the correct
ChangeLogs on dist.

14 years agobuild: Move ChangeLog rules in a separate file
Emmanuele Bassi [Wed, 18 Nov 2009 12:20:53 +0000 (12:20 +0000)]
build: Move ChangeLog rules in a separate file

The ChangeLog creation rules should be moved to their own file, to
make it easier to fix or change them in the future.

14 years agocogl: Add the missing terminators for the arrays of feature functions
Neil Roberts [Wed, 18 Nov 2009 13:23:10 +0000 (13:23 +0000)]
cogl: Add the missing terminators for the arrays of feature functions

_cogl_feature_check expects the array of function names to be
terminated with a NULL pointer but I forgot to add this. This was
causing crashes depending on what happened to be in memory after the
array.

14 years agoPass the interned string value to the binding callback
Christian Persch [Tue, 17 Nov 2009 19:43:39 +0000 (20:43 +0100)]
Pass the interned string value to the binding callback

http://bugzilla.openedhand.com/show_bug.cgi?id=1891

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agocogl: Use the GL_EXT_blend_{func,equation}_separate extensions
Neil Roberts [Tue, 17 Nov 2009 18:06:31 +0000 (18:06 +0000)]
cogl: Use the GL_EXT_blend_{func,equation}_separate extensions

We should use these extensions to check for glBlendFuncSeparate and
glBlendEquationSeparate as well as checking the GL version number.

14 years agocogl: Don't bother checking for NPOTs or VBOs on later GLs
Neil Roberts [Tue, 17 Nov 2009 17:22:22 +0000 (17:22 +0000)]
cogl: Don't bother checking for NPOTs or VBOs on later GLs

For VBOs, we don't need to check for the extension if the GL version
is greater than 1.5. Non-power-of-two textures are given in 2.0.

We could also assume shader support in GL 2.0 except that the function
names are different from those in the extension so it wouldn't work
well with the current mechanism.

14 years agobuild: Clean up the configure summary
Emmanuele Bassi [Tue, 17 Nov 2009 15:32:00 +0000 (15:32 +0000)]
build: Clean up the configure summary

Split out into section the configuration report, and clean
up the reported settings - including when experimental features
have been enabled.

14 years agocogl: Make it easier to add checks for GL extensions
Neil Roberts [Tue, 17 Nov 2009 13:52:40 +0000 (13:52 +0000)]
cogl: Make it easier to add checks for GL extensions

Previously if you need to depend on a new GL feature you had to:

- Add typedefs for all of the functions in cogl-defines.h.in

- Add function pointers for each of the functions in
  cogl-context-driver.h

- Add an initializer for the function pointers in
  cogl-context-driver.c

- Add a check for the extension and all of the functions in
  cogl_features_init. If the extension is available under multiple
  names then you have to duplicate the checks.

This is quite tedious and error prone. This patch moves all of the
features and their functions into a list of macro invocations in
cogl-feature-functions.h. The macros can be redefined to implement all
of the above tasks from the same header.

The features are described in a struct with a pointer to a table of
functions. A new function takes the feature description from this
struct and checks for its availability. The feature can take a list of
extension names with a list of alternate namespaces (such as "EXT" or
"ARB"). It can also detect the feature from a particular version of
GL.

The typedefs are now gone and instead the function pointer in the Cogl
context just directly contains the type.

Some of the functions in the context were previously declared with the
'ARB' extension. This has been removed so that now all the functions
have no suffix. This makes more sense when the extension could
potentially be merged into GL core as well.

14 years agodocs: Detail the Clutter debugging flags
Emmanuele Bassi [Sat, 14 Nov 2009 13:03:59 +0000 (13:03 +0000)]
docs: Detail the Clutter debugging flags

14 years agowin32: Remove the check for GL 1.2
Neil Roberts [Fri, 13 Nov 2009 17:23:13 +0000 (17:23 +0000)]
win32: Remove the check for GL 1.2

Since 568c29ba4 the GL version is now validated further up in
ClutterStage via Cogl so there is no need for the Win32 backend to do
it.

14 years agoUse the GL_ARB_multitexture extension on GL 1.2
Neil Roberts [Wed, 11 Nov 2009 16:42:53 +0000 (16:42 +0000)]
Use the GL_ARB_multitexture extension on GL 1.2

Cogl requires multi-texturing support. This is only available as an
extension in GL 1.2 so we should check for it before accepting the
driver.

http://bugzilla.openedhand.com/show_bug.cgi?id=1875

14 years agocogl-material: Fallback to BlendFunc if BlendFuncSeparate is unavailable
Neil Roberts [Wed, 11 Nov 2009 13:38:52 +0000 (13:38 +0000)]
cogl-material: Fallback to BlendFunc if BlendFuncSeparate is unavailable

glBlendFuncSeparate is only available in OpenGL 1.4. If we
conditionally check for this then Clutter will work with OpenGL 1.2.

http://bugzilla.openedhand.com/show_bug.cgi?id=1875

14 years agoValidate that the GL version is >= 1.2
Neil Roberts [Wed, 11 Nov 2009 13:26:54 +0000 (13:26 +0000)]
Validate that the GL version is >= 1.2

There is a new internal Cogl function called _cogl_check_driver_valid
which looks at the value of the GL_VERSION string to determine whether
the driver is supported. Clutter now calls this after the stage is
realized. If it fails then the stage is marked as unrealized and a
warning is shown.

_cogl_features_init now also checks the version number before getting
the function pointers for glBlendFuncSeparate and
glBlendEquationSeparate. It is not safe to just check for the presence
of the functions because some drivers may define the function without
fully implementing the spec.

The GLES version of _cogl_check_driver_valid just always returns TRUE
because there are no version requirements yet.

Eventually the function could also check for mandatory extensions if
there were any.

http://bugzilla.openedhand.com/show_bug.cgi?id=1875

14 years agoCan no more include clutter-stage.h inside clutter-win32.h
Samuel Degrande [Tue, 27 Oct 2009 10:18:49 +0000 (11:18 +0100)]
Can no more include clutter-stage.h inside clutter-win32.h

http://bugzilla.openedhand.com/show_bug.cgi?id=1847

Signed-off-by: Neil Roberts <neil@linux.intel.com>
14 years agoAdapt win32 backend to the semantic change of StageWindow
Samuel Degrande [Mon, 26 Oct 2009 15:28:36 +0000 (16:28 +0100)]
Adapt win32 backend to the semantic change of StageWindow

http://bugzilla.openedhand.com/show_bug.cgi?id=1847

Signed-off-by: Neil Roberts <neil@linux.intel.com>
14 years agotests: Add instructions to test-box-layout
Emmanuele Bassi [Fri, 13 Nov 2009 15:27:18 +0000 (15:27 +0000)]
tests: Add instructions to test-box-layout

14 years agoClear pending events for a stage when it is destroyed
Neil Roberts [Fri, 13 Nov 2009 13:39:24 +0000 (13:39 +0000)]
Clear pending events for a stage when it is destroyed

We can not process events for a stage that has been destroyed so we
should make sure that the events for the stage are removed from the
global event queue during dispose.

http://bugzilla.openedhand.com/show_bug.cgi?id=1882

14 years agodocs: Document the AnimationMode definition
Emmanuele Bassi [Fri, 13 Nov 2009 14:43:57 +0000 (14:43 +0000)]
docs: Document the AnimationMode definition

Both ClutterAlpha:mode and ClutterAnimation:mode can be defined using:

  • an integer id
  • the "nick" field of the AnimationMode GEnumValue
  • a custom, tweener-like string

All these methods should be documented.

14 years agotests: Add unit for Animation definitions
Emmanuele Bassi [Fri, 13 Nov 2009 14:10:29 +0000 (14:10 +0000)]
tests: Add unit for Animation definitions

Verify that an Animation can be defined using ClutterScript.

No initial/final state of the animation, yet.

14 years agoWhitespace fixes
Emmanuele Bassi [Fri, 13 Nov 2009 14:08:49 +0000 (14:08 +0000)]
Whitespace fixes

14 years agotests: Print out parser errors if present
Emmanuele Bassi [Fri, 13 Nov 2009 14:07:25 +0000 (14:07 +0000)]
tests: Print out parser errors if present

If the conformance test for the Script parser throws an error
and we've enabled verbosity then we should print out the error
message before aborting.

14 years agoanimation: Override parsing :mode
Emmanuele Bassi [Fri, 13 Nov 2009 13:21:47 +0000 (13:21 +0000)]
animation: Override parsing :mode

Like in ClutterAlpha, ClutterAnimation:mode must be overridden when
parsing a Script definition, as we accept both a numeric id and the
string id for easing modes.

14 years ago[cogl-primitives] Don't clear the whole stencil buffer
Neil Roberts [Mon, 5 Oct 2009 12:37:11 +0000 (13:37 +0100)]
[cogl-primitives] Don't clear the whole stencil buffer

When _cogl_add_path_to_stencil_buffer is used to draw a path we don't
need to clear the entire stencil buffer. Instead it can clear just the
bounding box of the path. This adds an extra parameter called
'need_clear' which is only set if the stencil buffer is being used for
clipping.

http://bugzilla.openedhand.com/show_bug.cgi?id=1829

14 years agoRemove _cogl_flush_matrix_stacks from cogl-internal.h
Neil Roberts [Thu, 12 Nov 2009 17:00:15 +0000 (17:00 +0000)]
Remove _cogl_flush_matrix_stacks from cogl-internal.h

The definition for this function was removed in f7d64e5abvoid so it
should be removed from the header too.

14 years agocogl: Declare cogl_is_bitmap()
Emmanuele Bassi [Wed, 11 Nov 2009 10:32:39 +0000 (10:32 +0000)]
cogl: Declare cogl_is_bitmap()

The function is automatically defined by the CoglHandle type
definition macro, but it still requires to be declared in the
header file to be used.

14 years agoRevert changes to test-cogl-primitives.c from 272e227109
Neil Roberts [Mon, 9 Nov 2009 12:12:27 +0000 (12:12 +0000)]
Revert changes to test-cogl-primitives.c from 272e227109

These changes caused the test to try to load redhand.png but this no
longer works since the TESTS_DATADIR changes in 0b4899ef23. The only
use of the hand is commented out anyway so it looks like the changes
were intended for temporary debugging.

14 years agobuild: Make the glib-mkenums generated files depend on their templates
Damien Lespiau [Mon, 9 Nov 2009 13:05:40 +0000 (13:05 +0000)]
build: Make the glib-mkenums generated files depend on their templates

With this, if one changes the underlying template files, we run
glib-mkenums again to generate updated glib_enum_[ch] files.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agobuild: Fix --with-imagebackend configure switch
Emmanuele Bassi [Mon, 9 Nov 2009 16:44:34 +0000 (16:44 +0000)]
build: Fix --with-imagebackend configure switch

An overeager search and replace broke the image backend command
line switch for the configure script.

14 years agocogl: Add an initialiser for enable_flags in cogl_begin_gl
Neil Roberts [Mon, 9 Nov 2009 11:50:16 +0000 (11:50 +0000)]
cogl: Add an initialiser for enable_flags in cogl_begin_gl

This fixes a warning about an uninitialised value. It could also
potentially fix some crashes for example if the enable_flags value
happened to include a bit for enabling a vertex array if no vertex
buffer pointer was set.

14 years agotext: Add a NULL preedit string check
Emmanuele Bassi [Mon, 9 Nov 2009 11:07:27 +0000 (11:07 +0000)]
text: Add a NULL preedit string check

This commit avoids a critical warning introduced by commit
bc51b8ca47ac90e52ab6a27ff791ea97d53f4648

14 years agoFix cursor position in preedit status
Raymond Liu [Mon, 9 Nov 2009 08:42:15 +0000 (16:42 +0800)]
Fix cursor position in preedit status

http://bugzilla.openedhand.com/show_bug.cgi?id=1871

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoClean up cogl.h template
Emmanuele Bassi [Fri, 6 Nov 2009 15:06:39 +0000 (15:06 +0000)]
Clean up cogl.h template

The inclusion order is mostly random, and it should really be
in alphabetic order, just like clutter.h.

Also, cogl-vertex-buffer.h is included twice.

14 years agoosx: CGBitmapContextCreate can't make 24bpp, alphaless offscreen pixmaps
Tim Horton [Fri, 6 Nov 2009 11:57:43 +0000 (11:57 +0000)]
osx: CGBitmapContextCreate can't make 24bpp, alphaless offscreen pixmaps

While loading a JPEG from disk (with clutter_texture_new_from_file),
I got the following:

<Error>: CGBitmapContextCreate: unsupported parameter combination: 8
integer bits/component; 24 bits/pixel; 3-component colorspace;
kCGImageAlphaNone; 3072 bytes/row.
<Error>: CGContextDrawImage: invalid context

Looking around, I found that CGBitmapContextCreate can't make 24bpp
offscreen pixmaps without an alpha channel...

This fixes the bug, and seems to not break other things...

http://bugzilla.openedhand.com/show_bug.cgi?id=1159

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoscript: Coding style clean-ups
Emmanuele Bassi [Fri, 6 Nov 2009 14:07:46 +0000 (14:07 +0000)]
script: Coding style clean-ups

14 years agoscript: Document private functions
Emmanuele Bassi [Fri, 6 Nov 2009 14:07:26 +0000 (14:07 +0000)]
script: Document private functions

14 years agoDo not pass flags to g_module_open(NULL)
Emmanuele Bassi [Fri, 6 Nov 2009 14:04:36 +0000 (14:04 +0000)]
Do not pass flags to g_module_open(NULL)

The flags are ignored when opening the main module, so we
should pass 0 to avoid confusion when reading the source.

14 years agoMerge branch 'josh-osx-fixes'
Emmanuele Bassi [Fri, 6 Nov 2009 11:50:22 +0000 (11:50 +0000)]
Merge branch 'josh-osx-fixes'

* josh-osx-fixes:
  osx: Fix a warning on Snow Leopard
  docs: Fix OS X docs to install Ports in correct order
  osx: Implement the updated ClutterStageWindow interface

14 years agotests: Remove a spurious #include
Joshua Lock [Thu, 5 Nov 2009 15:50:21 +0000 (15:50 +0000)]
tests: Remove a spurious #include

The test-backface-culling has what looks like a stray #include in which
stops the test compiling for backends without GdkPixbuf. Remove it.

http://bugzilla.openedhand.com/show_bug.cgi?id=1867

14 years agoosx: Fix a warning on Snow Leopard
Joshua Lock [Thu, 5 Nov 2009 15:48:25 +0000 (15:48 +0000)]
osx: Fix a warning on Snow Leopard

Apple where nice and changed API between releases. This patch checks the
version of the compilation environment and tries to use the right parameter
type.

http://bugzilla.openedhand.com/show_bug.cgi?id=1866

14 years agodocs: Fix OS X docs to install Ports in correct order
Joshua Lock [Thu, 5 Nov 2009 15:31:56 +0000 (15:31 +0000)]
docs: Fix OS X docs to install Ports in correct order

The order in which the MacPorts are installed is important otherwise we open
the user up to a world of pain.
This patch also tweaks the OS X docs to follow the formatting of the rest of
the docs and to discuss the option of GtkDoc.

http://bugzilla.openedhand.com/show_bug.cgi?id=1865

14 years agoosx: Implement the updated ClutterStageWindow interface
Joshua Lock [Thu, 5 Nov 2009 15:44:32 +0000 (15:44 +0000)]
osx: Implement the updated ClutterStageWindow interface

In the new Clutter world backend stage implementations should be lightweight
objects implementing the ClutterStageWindow interface and not ClutterActor
subclasses.

This patch performs various cut-n-pastes to acheive that for the OSX backend

http://bugzilla.openedhand.com/show_bug.cgi?id=1864

14 years agobehaviour: Implement the implicit alpha parsing
Emmanuele Bassi [Fri, 6 Nov 2009 11:33:32 +0000 (11:33 +0000)]
behaviour: Implement the implicit alpha parsing

ClutterBehaviour should implement the Scriptable interface
and parse ClutterAlpha when implicitly defined, instead of
having this ad hoc code inside ClutterScriptParser itself.

After all, only ClutterBehaviour supports Alpha defined
implicitly.

14 years agoconform: Add unit for properties holding objects
Emmanuele Bassi [Fri, 6 Nov 2009 11:32:28 +0000 (11:32 +0000)]
conform: Add unit for properties holding objects

Exercise the definition of GObjects for properties defined using
GParamSpecObject.

14 years agoscript: Generic assignment of properties requiring objects
Emmanuele Bassi [Fri, 6 Nov 2009 11:17:42 +0000 (11:17 +0000)]
script: Generic assignment of properties requiring objects

The ClutterScriptParser should do most of the heavy-lifting for
parsing a JSON object member defining another JSON object into
a GObject property defined using a GParamSpecObject.

14 years agoconformance: Add unit on the implicit alpha definition
Emmanuele Bassi [Fri, 6 Nov 2009 10:53:43 +0000 (10:53 +0000)]
conformance: Add unit on the implicit alpha definition

Exercise the implicit alpha and timeline definition to catch
regressions in the ClutterScript parser code.

14 years agoscript: Apply properties when constructing implicit timelines
Emmanuele Bassi [Fri, 6 Nov 2009 10:17:30 +0000 (10:17 +0000)]
script: Apply properties when constructing implicit timelines

The object construction is done in two passes, now, so we must do both
passes when parsing implicit timelines from a fake ObjectInfo.

14 years agoRemove all internal use of deprecated cogl_clip_* API
Robert Bragg [Thu, 5 Nov 2009 16:50:24 +0000 (16:50 +0000)]
Remove all internal use of deprecated cogl_clip_* API

cogl_clip_push, and cogl_clip_push_window_rect which are now deprecated were
used in various places internally so this just switches to using the
replacement functions.

14 years ago[clip-stack] stop using deprecated cogl_clip_push_window_rect API
Robert Bragg [Thu, 5 Nov 2009 10:56:24 +0000 (10:56 +0000)]
[clip-stack] stop using deprecated cogl_clip_push_window_rect API

try_pushing_rect_as_window_rect now uses the new
cogl_clip_push_window_rectangle API.

14 years ago[cogl-clip] deprecate parts and cleanup the API
Robert Bragg [Wed, 4 Nov 2009 19:31:43 +0000 (19:31 +0000)]
[cogl-clip] deprecate parts and cleanup the API

cogl_clip_push() which accepts a rectangle in model space shouldn't have
been defined to take x,y,width,height arguments because this isn't consistant
with other Cogl API dealing with model space rectangles.  If you are using a
coordinate system with the origin at the center and the y+ extending up,
then x,y,width,height isn't as natural as (x0,y0)(x1,y1). This API has
now been replace with cogl_clip_push_rectangle()

(As a general note: the Cogl API should only use the x,y,width,height style
when the appropriate coordinate space is defined by Cogl to have a top left
origin.  E.g.  window coordinates, or potentially texture coordinates)

cogl_clip_push_window_rect() shouldn't have been defined to take float
arguments since we only clip with integral pixel precision. We also
shouldn't have abbreviated "rectangle". This API has been replaced with
cogl_clip_push_window_rectangle()

cogl_clip_ensure() wasn't documented at all in Clutter 1.0 and probably
no one even knew it existed. This API isn't useful, and so it's now
deprecated. If no one complains we may remove the API altogether for
Clutter 1.2.

cogl_clip_stack_save() and cogl_clip_stack_restore() were originally added
to allow us to save/restore the clip when switching to/from offscreen
rendering.  Now that offscreen draw buffers are defined to own their clip
state and the state will be automatically saved and restored this API is now
redundant and so deprecated.

14 years ago[clip-stack] Internally track model space clip rects as (x0,y0)(x1,y1) pairs
Robert Bragg [Wed, 4 Nov 2009 20:17:56 +0000 (20:17 +0000)]
[clip-stack] Internally track model space clip rects as (x0,y0)(x1,y1) pairs

Don't track the rectangles as x0,y0,width,height. This is in preparation
for some API tidy up.

14 years ago[clip-stack] move lots of supporting code from cogl.c to cogl-clip-stack.c
Robert Bragg [Wed, 4 Nov 2009 19:42:17 +0000 (19:42 +0000)]
[clip-stack] move lots of supporting code from cogl.c to cogl-clip-stack.c

There was quite a bit of code in cogl.c that was only used to support
cogl-clip-stack.c, so this has now been moved to cogl-clip-stack.c

14 years ago[debug] Adds a COGL_DEBUG=force-scanline-paths
Robert Bragg [Wed, 4 Nov 2009 16:55:18 +0000 (16:55 +0000)]
[debug] Adds a COGL_DEBUG=force-scanline-paths

For a long time now the GLES driver for Cogl has supported a fallback
scanline rasterizer for filling paths when no stencil buffer is available,
but now that we build the same cogl-primitives code for GL and GLES I
thought it may sometimes be useful for debugging to force Cogl to use the
scanline rasterizer instead of the current stencil buffer approach.

14 years agotests: Clean up interactive test build
Emmanuele Bassi [Thu, 5 Nov 2009 17:30:33 +0000 (17:30 +0000)]
tests: Clean up interactive test build

The build for interactive tests creates symbolic links for the data
under tests/data; it also uses symbolic links for creating "binaries"
for each interactive test. This is less than ideal, though.

Instead, the tests should build a path to the data files by using
a pre-processor define like TESTS_DATADIR; both g_build_filename() and
pre-processor string concatenation can be used to generate a valid
file name with the full path to the files.

The build system should also create wrapper scripts, just like we
do inside the conformance test suite, to be able to launch single
tests.

14 years agolayout: Add layout properties introspection
Emmanuele Bassi [Thu, 5 Nov 2009 12:24:37 +0000 (12:24 +0000)]
layout: Add layout properties introspection

In order to know if a layout property exists and retrieve its
description in form of a GParamSpec, we need a wrapper API inside
ClutterLayoutManager. This allows introspecting a LayoutManager
sub-class and eventually serialize and deserialize it.

14 years agobox-layout: Add get_child_meta_type() override
Emmanuele Bassi [Thu, 5 Nov 2009 12:23:49 +0000 (12:23 +0000)]
box-layout: Add get_child_meta_type() override

Return the GType of ClutterBoxChild.

14 years agobin-layout: Add get_child_meta_type() override
Emmanuele Bassi [Thu, 5 Nov 2009 12:23:22 +0000 (12:23 +0000)]
bin-layout: Add get_child_meta_type() override

Return the GType of ClutterBinLayer.

14 years agolayout: Add LayoutManager::get_child_meta_type()
Emmanuele Bassi [Thu, 5 Nov 2009 11:57:06 +0000 (11:57 +0000)]
layout: Add LayoutManager::get_child_meta_type()

In order to inspect a LayoutManager using LayoutMeta we need a
virtual function that returns the GType of the LayoutMeta used.

14 years agoscript: Allow parsing child properties
Emmanuele Bassi [Wed, 4 Nov 2009 16:45:44 +0000 (16:45 +0000)]
script: Allow parsing child properties

The ClutterScript parser needs to be extended to parse child properties
and apply them after an actor has been added to a container. In order to
distinguish child properties from regular GObject properties we can use
the "child::" prefix, e.g.:

  {
    "type" : "ClutterRectangle",
    "id" : "child-01",
    "child::has-focus" : true,
    ...
  }

Parsing child properties can be deferred to the ClutterScriptable
interface, just like regular properties.

14 years ago[cogl-primitives] Get rid of driver specific cogl-primitives code
Robert Bragg [Sat, 17 Oct 2009 03:06:56 +0000 (04:06 +0100)]
[cogl-primitives] Get rid of driver specific cogl-primitives code

These files were practically identical, except the gles code had additional
support for filling paths without a stencil buffer.  All the driver code has
now been moved into cogl/cogl-primitives.c

14 years agoscript: Clean up Color parsing rules
Emmanuele Bassi [Wed, 4 Nov 2009 15:21:03 +0000 (15:21 +0000)]
script: Clean up Color parsing rules

All the ClutterColor parsing rules should be coalesced inside
clutter_script_parse_color(): object, array and string notations
are the canonical ways of defining a ClutterColor inside a
ClutterScript definition. Having a single function in charge of
the parsing cleans up the code.

14 years agoscript: Simplify boxed types parsing
Emmanuele Bassi [Wed, 4 Nov 2009 15:20:12 +0000 (15:20 +0000)]
script: Simplify boxed types parsing

We should use the typed accessors for complex JSON types, and
be more liberal in what we accept.

14 years agoscript: Separate construction from properties application
Emmanuele Bassi [Wed, 4 Nov 2009 14:05:13 +0000 (14:05 +0000)]
script: Separate construction from properties application

Currently, ClutterScriptParser will construct the object (using the
construct-only and construct parameters), apply the properties from
the ClutterScript definition, and eventuall will add children and
behaviours.

The construction phase should be more compartimentalized: the objects
should be constructed first and eventual children and behaviours
added. Then, once an object is requested or when the parsing process
has terminated, all the properties should be applied.

This change allows us to set up the actors before setting their
non-construct properties.

14 years agoscript: Move all parser code inside ClutterScriptParser
Emmanuele Bassi [Wed, 4 Nov 2009 13:32:26 +0000 (13:32 +0000)]
script: Move all parser code inside ClutterScriptParser

ClutterScript is currently a mix of parser-related code and
the ClutterScript object. All the parser-related code should
be moved inside a private class, ClutterScriptParser, inheriting
from JsonParser.

14 years agoconform: Add the beginnings of a ClutterScript test suite
Emmanuele Bassi [Wed, 4 Nov 2009 11:50:45 +0000 (11:50 +0000)]
conform: Add the beginnings of a ClutterScript test suite

ClutterScript is a very complicated piece of machinery, with a
parser that has custom variations on top of the basic JSON
format; it could also be extended in the future, so if we don't
want to introduce regressions or break existing ClutterScript
definitions, we'd better have a conformance test suite.

14 years agotests: Allow getting data files from the tests/data directory
Emmanuele Bassi [Wed, 4 Nov 2009 11:47:09 +0000 (11:47 +0000)]
tests: Allow getting data files from the tests/data directory

The units under the conformance test suite should be able to use
external files. Linking the files in tests/conform like the
interactive tests do seems like a hack piled on top of a hack, so
instead we should provide a programmatic way for a conformance
test unit to get the full path of a file, regardless of where the
tests/data directory is.

We can use a define to get the full path of tests/data and then
a function using g_build_filename() to construct the path to the
file we want.

14 years agoAdd new conformance tests to the ignore list
Emmanuele Bassi [Wed, 4 Nov 2009 11:05:25 +0000 (11:05 +0000)]
Add new conformance tests to the ignore list

14 years agoscript: Take a copy of property nodes
Emmanuele Bassi [Tue, 3 Nov 2009 18:30:28 +0000 (18:30 +0000)]
script: Take a copy of property nodes

Instead of counting on a JsonNode pointer to survive we should take
a copy. This allows keeping unresolved properties across different
ClutterScript passes.

14 years agoscript: Use JsonObject direct accessors
Emmanuele Bassi [Tue, 3 Nov 2009 18:29:52 +0000 (18:29 +0000)]
script: Use JsonObject direct accessors

Instead of getting the JsonNode for a member of which we mandate
the type we can use the typed accessors of JsonObject.

14 years agoMerge commit 'cogl-reorg-draw-buffers'
Robert Bragg [Wed, 4 Nov 2009 03:46:45 +0000 (03:46 +0000)]
Merge commit 'cogl-reorg-draw-buffers'

* cogl-reorg-draw-buffers: (38 commits)
  [test-fbo] greatly simplify the test
  [tests] test-backface-culling: test culling with offscreen rendering
  [tests] Adds test-cogl-readpixels.c for very basic cogl_read_pixels testing
  [tests] Adds test-cogl-offscreen to validate offscreen draw buffer
  [tests] test-cogl-viewport tests semantics of over/under size viewports
  [test-texture-fbo] comment the colors defined in corner_colors
  Add a conformance test for clutter_texture_new_from_actor
  [cogl-texture-2d-sliced] allow COGL_FORMAT_ANY with _new_with_size()
  [texture] fix rounding when calculating update_fbo viewport offset
  [texture] switch to a new design for handling offscreen rendering
  [texture] split out fbo update code from cluter_texture_paint
  [texture] push/pop draw buffer when painting actors to a texture
  [texture] Avoid redundant use of cogl_clip_stack_save when drawing offscreen
  [cogl-draw-buffer] fix Cogl -> GL viewport coord conversion
  [cogl_clip_push_window_rect] fix Cogl -> GL coordinate conversion
  [matrix] Adds cogl_matrix_get_inverse API
  [debug] Adds a COGL_DEBUG=matrices debug option
  [cogl-matrix] Import Mesa's matrix manipulation code
  [cogl] avoid any state changes when cogl_set_backface_culling_enable is a nop
  [cogl] Use clockwise face winding for offscreen buffers with culling enabled
  ...

14 years ago[test-fbo] greatly simplify the test
Robert Bragg [Wed, 7 Oct 2009 09:40:15 +0000 (10:40 +0100)]
[test-fbo] greatly simplify the test

This test tried to do too much, and I can't remember the last time I saw this
test work.

It no longer tries to create a texture from an offscreen actor and it no
longer tries to use shaders.

It does though show that chaining of clutter_texture_new_from_actor now
works, and that animating the source actor is reflected in textures created
from it.

When run you should see three actors:
- on the left is the pristine source actor rotating around the y-axis
- in the middle is the first texture created from the source actor
- and on the right a texture created from the middle actor

Note: the somewhat strange bobbing of the middle and right textures is
actually correct given how it was decided long ago to map the transformed
(to screen space) allocation of the source actor to the texture.  When the
hand spins around the perspective projection of the top of the hand results
in the origin of the texture bobbing up to a higher stage position, but the
position of the textures is fixed.  This design also means we end up
reallocating our offscreen draw buffer every frame that the actors
transformed size changes, which isn't ideal.

14 years ago[tests] test-backface-culling: test culling with offscreen rendering
Robert Bragg [Thu, 22 Oct 2009 18:01:27 +0000 (19:01 +0100)]
[tests] test-backface-culling: test culling with offscreen rendering

Since offscreen rendering is internally forced to be upside down Cogl
needs to reverse the glFrontFace winding order so as not to interfere
with the use of cogl_set_backface_culling_enabled()

This ensures we test that mechanism.

14 years ago[tests] Adds test-cogl-readpixels.c for very basic cogl_read_pixels testing
Robert Bragg [Thu, 22 Oct 2009 15:56:01 +0000 (16:56 +0100)]
[tests] Adds test-cogl-readpixels.c for very basic cogl_read_pixels testing

Mostly this was written to verify that we don't flip the data read back from
an offscreen draw buffer.  (since all offscreen rendering is done upside
down)

14 years ago[tests] Adds test-cogl-offscreen to validate offscreen draw buffer
Robert Bragg [Thu, 22 Oct 2009 11:36:17 +0000 (12:36 +0100)]
[tests] Adds test-cogl-offscreen to validate offscreen draw buffer

This adds a basic test to check that rendering a few colored rectangles
offscreen works and that the modelview gets restored when switching back to
the previous buffer.

14 years ago[tests] test-cogl-viewport tests semantics of over/under size viewports
Robert Bragg [Wed, 21 Oct 2009 15:06:43 +0000 (16:06 +0100)]
[tests] test-cogl-viewport tests semantics of over/under size viewports

Unlike OpenGL Cogl puts the origin of windows/viewports at the top left
instead of bottom left.  This test verifies that we correctly translate Cogl
viewports to OpenGL viewports for the awkward cases where the given viewport
has an offset and/or the viewport has a different size to the current draw
buffer.

14 years ago[test-texture-fbo] comment the colors defined in corner_colors
Robert Bragg [Mon, 2 Nov 2009 01:23:25 +0000 (01:23 +0000)]
[test-texture-fbo] comment the colors defined in corner_colors

It helps to be able to quickly glance at the definition to see which
quadrant of the test actor should be which color, so when debugging a
problem and looking at the visual output you can easily verify if it's being
flipped upside down/left to right.

14 years agoAdd a conformance test for clutter_texture_new_from_actor
Neil Roberts [Thu, 17 Sep 2009 13:25:29 +0000 (14:25 +0100)]
Add a conformance test for clutter_texture_new_from_actor

This contains four tests :-

 - A regular onscreen source with a clone next to it

 - An offscreen source with a clone. This is currently commented out
   because it no longer works.

 - An onscreen source with a rectangular clip and a clone.

 - An onscreen source with a clip from a path and a clone.

The sources are all a 2x2 grid of colors. Each clone is tested that it
either contains the color that should be at that grid position or that
the stage color is showing through if the source is clipped.

14 years ago[cogl-texture-2d-sliced] allow COGL_FORMAT_ANY with _new_with_size()
Robert Bragg [Sat, 31 Oct 2009 00:01:44 +0000 (00:01 +0000)]
[cogl-texture-2d-sliced] allow COGL_FORMAT_ANY with _new_with_size()

It's useful when initialzing offscreen draw buffers to be able to ask
Cogl to create a texture of a given size and with the default internal
pixel format.

14 years ago[texture] fix rounding when calculating update_fbo viewport offset
Robert Bragg [Sun, 1 Nov 2009 23:56:03 +0000 (23:56 +0000)]
[texture] fix rounding when calculating update_fbo viewport offset

When rendering to an fbo for supporting clutter_texture_new_from_actor we
render to an fbo with the same size as the source actor, but with a viewport
the same size as the stage.  We offset the viewport so when we render the
source actor in its normal transformed stage position it lands on the fbo.
Previously we were rounding the transformed position given as a float by
truncating the fraction (just using a C cast) but that resulted in an
incorrect pixel offset when rendering offscreen depending on the source
position.

We now simply + 0.5 before casting (or -0.5 for negative numbers)

14 years ago[texture] switch to a new design for handling offscreen rendering
Robert Bragg [Mon, 2 Nov 2009 01:14:50 +0000 (01:14 +0000)]
[texture] switch to a new design for handling offscreen rendering

For supporting clutter_texture_new_from_actor(): when updating a
ClutterTexture's fbo we previously set up an offset frustum in the
perspective matrix before rendering source actors to an offscreen draw
buffer so as to give a perspective as if it were being drawn at its
original stage location.

Now that Cogl supports offset viewports there is a simpler way...

When we come to render the source actor to our offscreen draw buffer we
now copy the projection matrix from the stage; we create a viewport
that's also the same size as the stage (though larger than the offscreen
draw buffer) and as before we apply the modelview transformations of
the source actors ancestry before painting it.

The only trick we need now is to offset the viewport according to the
transformed (to screen space) allocation of the source actor (something we
required previously too).  We negatively offset the stage sized viewport
such that the smaller offscreen draw buffer is positioned to sit underneath
the source actor in stage coordinates.

14 years ago[texture] split out fbo update code from cluter_texture_paint
Robert Bragg [Thu, 24 Sep 2009 13:34:09 +0000 (14:34 +0100)]
[texture] split out fbo update code from cluter_texture_paint

To help keep clutter_texture_paint maintainable this splits out a big
chunk of standalone code that's responsible for updating the fbo when
clutter_texture_new_from_actor has been used.

14 years ago[texture] push/pop draw buffer when painting actors to a texture
Robert Bragg [Tue, 13 Oct 2009 21:22:39 +0000 (22:22 +0100)]
[texture] push/pop draw buffer when painting actors to a texture

When updating the FBO for a source actor (to support
clutter_texture_new_from_actor()) we used to simply set an offscreen draw
buffer to be current, paint the source actor and then explicitly set the
window to be current again.  This precluded chaining texture_new_from_actor
though because updating another FBO associated with a source actor would end
up restoring the window as the current buffer instead of the previous
offscreen buffer.  Now that we use Cogl's draw buffer stack; chaining
clutter_texture_new_from_actor() should be possible.