Commit Graph

194 Commits

Author SHA1 Message Date
Emmanuele Bassi
43d394ebae Remove unused TEXTURE_IN_CLONE_PAINT private flag
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.
2009-07-13 16:16:38 +01:00
Emmanuele Bassi
5a554bf063 Small code clean up
Make ClutterTexture slightly more similar to the rest of the code base.
2009-07-12 01:27:31 +01:00
pippin
8fb3a48ae2 serialize upload of asyncronously loaded textures
Rate limit the uploading of textures to stop if it uses more than 5ms
during one master clock iteration.
2009-07-10 11:38:59 +01:00
Øyvind Kolås
04bb789941 [texture] fix load-async and load-data-async properties.
Removed the G_PARAM_CONSTRUCT from the property registration of
"load-async" and "load-data-async". It made it impossible to use only
load-data-async, as the async loading state would be unset when
load-async got set it's default FALSE value.
2009-06-30 16:48:53 +01:00
Emmanuele Bassi
ba6c0c27f9 [texture] Revert to integer parameters in ::size-change
In the int-to-float switch for actor properties, the ::size-change signal
was moved to use floats instead of integers. Sub-pixel precision for image
size is meaningless, though, so we should revert it back to ints.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1659
2009-06-22 12:15:17 +01:00
Emmanuele Bassi
c6fba47a52 Hide clutter_context_get_default()
The clutter_context_get_default() function is private, but shared
across Clutter. For this reason, it should be prefixed by '_' so
that the symbol is hidden from the shared object.
2009-06-18 14:20:28 +01:00
Owen W. Taylor
5e18cee77a Avoid unnecesary unpremultiplication when saving to local data
Now that we typically have premultiplied data stored in Cogl
textures, when fetching a texture into local data for temporary
storage, use a premultiplied format to avoid an unpremultiply/
premultiply roundtrip.

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

Signed-off-by: Robert Bragg <robert@linux.intel.com>
2009-06-11 14:17:52 +01:00
Owen W. Taylor
c3448314d5 Default to a blend function that expects premultiplied colors
Many operations, like mixing two textures together or alpha-blending
onto a destination with alpha, are done most logically if texture data
is in premultiplied form. We also have many sources of premultiplied
texture data, like X pixmaps, FBOs, cairo surfaces. Rather than trying
to work with two different types of texture data, simplify things by
always premultiplying texture data before uploading to GL.

Because the default blend function is changed to accommodate this,
uses of pure-color CoglMaterial need to be adapted to add
premultiplication.

gl/cogl-texture.c gles/cogl-texture.c: Always premultiply
  non-premultiplied texture data before uploading to GL.

cogl-material.c cogl-material.h: Switch the default blend functions
  to ONE, ONE_MINUS_SRC_ALPHA so they work correctly with premultiplied
  data.

cogl.c: Make cogl_set_source_color() premultiply the color.

cogl.h.in color-material.h: Add some documentation about
  premultiplication and its interaction with color values.

cogl-pango-render.c clutter-texture.c tests/interactive/test-cogl-offscreen.c:
  Use premultiplied colors.

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

Signed-off-by: Robert Bragg <robert@linux.intel.com>
2009-06-11 14:17:52 +01:00
Owen W. Taylor
4dcd5f6134 Use correct texture format for pixmap textures and FBO's
RGBA data in X pixmaps and in FBOs is already premultiplied; use
the right format when creating cogl textures.

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

Signed-off-by: Robert Bragg <robert@linux.intel.com>
2009-06-11 14:17:51 +01:00
Emmanuele Bassi
9691827b5b [texture] Fix error reporting on ::load-finished
The load-finished signal has a GError* argument which is meant to
signify whether the loading was successful. However many of the
places in ClutterTexture that emit this signal directly pass their
'error' variable which is a GError** and will be NULL or not
completely independently of whether there was an error. If the
argument was dereferenced it would probably crash.

The test-texture-async interactive test case should also verify
that the ::load-finished signal is correctly emitted.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1622
2009-06-06 16:13:41 +01:00
Emmanuele Bassi
c3dc03997c Fixes for some compiler warnings 2009-06-06 14:37:41 +01:00
Neil Roberts
54d8aadf1d [cogl] Move the texture filters to be a property of the material layer
The texture filters are now a property of the material layer rather
than the texture object. Whenever a texture is painted with a material
it sets the filters on all of the GL textures in the Cogl texture. The
filter is cached so that it won't be changed unnecessarily.

The automatic mipmap generation has changed so that the mipmaps are
only generated when the texture is painted instead of every time the
data changes. Changing the texture sets a flag to mark that the
mipmaps are dirty. This works better if the FBO extension is available
because we can use glGenerateMipmap. If the extension is not available
it will temporarily enable automatic mipmap generation and reupload
the first pixel of each slice. This requires tracking the data for the
first pixel.

The COGL_TEXTURE_AUTO_MIPMAP flag has been replaced with
COGL_TEXTURE_NO_AUTO_MIPMAP so that it will default to
auto-mipmapping. The mipmap generation is now effectively free if you
are not using a mipmap filter mode so you would only want to disable
it if you had some special reason to generate your own mipmaps.

ClutterTexture no longer has to store its own copy of the filter
mode. Instead it stores it in the material and the property is
directly set and read from that. This fixes problems with the filters
getting out of sync when a cogl handle is set on the texture
directly. It also avoids the mess of having to rerealize the texture
if the filter quality changes to HIGH because Cogl will take of
generating the mipmaps if needed.
2009-06-04 19:03:40 +01:00
Emmanuele Bassi
0187bb3965 [actor] Use flags to control allocations
Instead of passing a boolean value, the ::allocate virtual function
should use a bitmask and flags. This gives us room for expansion
without breaking API/ABI, and allows to encode more information to
the allocation process instead of just changes of absolute origin.
2009-06-04 16:30:31 +01:00
Emmanuele Bassi
bafa448666 [texture] Increase verbosity of error messages
The GError messages in set_from_rgb_data() and set_from_yuv_data()
are a little bit too thin on details.
2009-06-01 14:57:18 +01:00
Emmanuele Bassi
8b71fa1acb [docs] Remove misleading text
The documentation for ClutterTexture's set_from_rgb_data() and
set_from_yuv_data() says:

  Note: This function is likely to change in future versions.

This is not true, since they'll remain for the whole 1.x API cycle.
2009-06-01 14:57:18 +01:00
Emmanuele Bassi
7b75f93db1 [docs] Fixes for the API reference
* Add unused symbols

* Document and sync argument names with their gtk-doc counterpart

* Add missing descriptions
2009-05-28 17:18:13 +01:00
Emmanuele Bassi
7252c14197 [cogl] Make cogl_setup_viewport() a private function
The setup_viewport() function should only be used by Clutter and
not by application code.

It can be emulated by changing the Stage size and perspective and
requeueing a redraw after calling clutter_stage_ensure_viewport().
2009-05-28 14:14:50 +01:00
Emmanuele Bassi
71498a6376 [cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.

Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.

Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.

Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.

Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 19:35:19 +01:00
Damien Lespiau
309f680d32 [texture] size-change closure is now VOID:FLOAT,FLOAT
Now that everything is float, the marsharlling function of the
size-change signal should reflect that fact.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-05-22 09:09:31 +01:00
Emmanuele Bassi
1985fa75b1 [texture] Use a box instead of int coordinates
Most of the operations involving the texture's allocated area require
floats -- either for computations or for setting the geometry into
COGL. So it doesn't make any sense to use get_allocation_coords() and
cast everything to floats.
2009-05-20 17:38:58 +01:00
Emmanuele Bassi
f8f54989be Merge commit 'origin/master' into 1.0-integration
Conflicts:
	clutter/clutter-texture.c
	clutter/cogl/gl/cogl-fbo.c
2009-05-20 16:49:22 +01:00
Emmanuele Bassi
407ac5075f [texture] Add missing accessors
ClutterTexture has many properties that can only be accessed using
the GObject API. This is fairly inefficient and makes binding the
class overly complicated.

The Texture class should have accessor methods for all its properties,
properly documented.
2009-05-19 13:24:56 +01:00
Neil Roberts
e9b863eba2 Don't clear the stencil buffer before painting and picking
The stencil buffer is always cleared the first time a clip is used
that needs it and the stencil test is disabled otherwise so there is
no need to clear before a paint.
2009-05-12 15:36:16 +01:00
Robert Bragg
36cfb60307 [cogl] Remove the COGL{enum,int,uint} typedefs
COGLenum, COGLint and COGLuint which were simply typedefs for GL{enum,int,uint}
have been removed from the API and replaced with specialised enum typedefs, int
and unsigned int. These were causing problems for generating bindings and also
considered poor style.

The cogl texture filter defines CGL_NEAREST and CGL_LINEAR etc are now replaced
by a namespaced typedef 'CoglTextureFilter' so they should be replaced with
COGL_TEXTURE_FILTER_NEAREST and COGL_TEXTURE_FILTER_LINEAR etc.

The shader type defines CGL_VERTEX_SHADER and CGL_FRAGMENT_SHADER are handled by
a CoglShaderType typedef and should be replaced with COGL_SHADER_TYPE_VERTEX and
COGL_SHADER_TYPE_FRAGMENT.

cogl_shader_get_parameteriv has been replaced by cogl_shader_get_type and
cogl_shader_is_compiled. More getters can be added later if desired.
2009-05-12 14:53:44 +01:00
Robert Bragg
cea711cc7e [ClutterTexture] Remove a spurious line I accidentally committed in 741c4bb5
I accidentally changed clutter_texture_set_cogl_texture to always set the
filter quality for the new Cogl texture to medium.
2009-05-12 14:53:43 +01:00
Emmanuele Bassi
d6d208da7d Remove Units from the public API
With the recent change to internal floating point values, ClutterUnit
has become a redundant type, defined to be a float. All integer entry
points are being internally converted to floating point values to be
passed to the GL pipeline with the least amount of conversion.

ClutterUnit is thus exposed as just a "pixel with fractionary bits",
and not -- as users might think -- as generic, resolution and device
independent units. not that it was the case, but a definitive amount
of people was convinced it did provide this "feature", and was flummoxed
about the mere existence of this type.

So, having ClutterUnit exposed in the public API doubles the entry
points and has the following disadvantages:

  - we have to maintain twice the amount of entry points in ClutterActor
  - we still do an integer-to-float implicit conversion
  - we introduce a weird impedance between pixels and "pixels with
    fractionary bits"
  - language bindings will have to choose what to bind, and resort
    to manually overriding the API
    + *except* for language bindings based on GObject-Introspection, as
      they cannot do manual overrides, thus will replicate the entire
      set of entry points

For these reason, we should coalesces every Actor entry point for
pixels and for ClutterUnit into a single entry point taking a float,
like:

  void clutter_actor_set_x (ClutterActor *self,
                            gfloat        x);
  void clutter_actor_get_size (ClutterActor *self,
                               gfloat       *width,
                               gfloat       *height);
  gfloat clutter_actor_get_height (ClutterActor *self);

etc.

The issues I have identified are:

  - we'll have a two cases of compiler warnings:
    - printf() format of the return values from %d to %f
    - clutter_actor_get_size() taking floats instead of unsigned ints
  - we'll have a problem with varargs when passing an integer instead
    of a floating point value, except on 64bit platforms where the
    size of a float is the same as the size of an int

To be clear: the *intent* of the API should not change -- we still use
pixels everywhere -- but:

  - we remove ambiguity in the API with regard to pixels and units
  - we remove entry points we get to maintain for the whole 1.0
    version of the API
  - we make things simpler to bind for both manual language bindings
    and automatic (gobject-introspection based) ones
  - we have the simplest API possible while still exposing the
    capabilities of the underlying GL implementation
2009-05-06 16:44:47 +01:00
Robert Bragg
a5cdfdfd87 [cogl-offscreen] Cleans up the cogl offscreen API and adds documentation
There were several functions I believe no one is currently using that were
only implemented in the GL backend (cogl_offscreen_blit_region and
cogl_offscreen_blit) that have simply been removed so we have a chance to
think about design later with a real use case.

There was one nonsense function (cogl_offscreen_new_multisample) that
sounded exciting but in all cases it just returned COGL_INVALID_HANDLE
(though at least for GL it checked for multisampling support first!?)
it has also been removed.

The MASK draw buffer type has been removed. If we want to expose color
masking later then I think it at least would be nicer to have the mask be a
property that can be set on any draw buffer.

The cogl_draw_buffer and cogl_{push,pop}_draw_buffer function prototypes
have been moved up into cogl.h since they are for managing global Cogl state
and not for modifying or creating the actual offscreen buffers.

This also documents the API so for example desiphering the semantics of
cogl_offscreen_new_to_texture() should be a bit easier now.
2009-05-02 04:12:26 +01:00
Robert Bragg
d5fc61102f [cogl] Only expose CoglBitmap as a CoglHandle
It was inconsistent that we exposed the CoglBitmap struct instead of an
opaque CoglHandle.
2009-05-02 04:12:26 +01:00
Robert Bragg
741c4bb5e9 [cogl] Adds a bitfield argument to cogl_clear for specifying which buffers to clear
Redundant clearing of depth and stencil buffers every render can be very
expensive, so cogl now gives control over which auxiliary buffers are
cleared.

Note: For now clutter continues to clear the color, depth and stencil buffer
each paint.
2009-05-02 04:12:12 +01:00
Neil Roberts
20cd885c3d [ClutterTexture] Check before unrefing the fbo_handle
When replacing the fbo_handle with a new handle it first unrefs the
old handle. This was previously a call to cogl_offscreen_unref which
silently ignored attempts to unref COGL_INVALID_HANDLE. However the
new cogl_handle_unref does check for this so we should make sure the
handle is valid to avoid the warning.
2009-04-30 15:09:04 +01:00
Neil Roberts
4f692cc3ee [ClutterTexture] Attach the FBO texture to a layer in the material
Bug 1565 - test-fbo case failed in many platform

clutter_texture_new_from_actor was broken because it created the FBO
texture but then never attached it to the material so it was never
used for rendering. The old behaviour in Clutter 0.8 was to assign the
texture directly to priv->tex. In 0.9 priv->tex is replaced with
priv->material which has a reference to the tex in layer 0. So putting
the FBO texture directly in layer 0 more closely matches the original
behaviour.
2009-04-30 15:09:04 +01:00
Havoc Pennington
125bded814 Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state

* Add a VISIBLE flag tracking application programmer's
  expected showing-state for the actor, allowing us to
  always ensure we keep what the app wants while tracking
  internal implementation state separately.

* Make MAPPED reflect whether the actor will be painted;
  add notification on a ClutterActor::mapped property.
  Keep MAPPED state updated as the actor is shown,
  ancestors are shown, actor is reparented, etc.

* Require a stage and realized parents to realize; this means
  at realization time the correct window system and GL resources
  are known. But unparented actors can no longer be realized.

* Allow children to be unrealized even if parent is realized.
  Otherwise in effect either all actors or no actors are realized,
  i.e. it becomes a stage-global flag.

* Allow clutter_actor_realize() to "fail" if not inside a toplevel

* Rework clutter_actor_unrealize() so internally we have
  a flavor that does not mess with visibility flag

* Add _clutter_actor_rerealize() to encapsulate a somewhat
  tricky operation we were doing in a couple of places

* Do not realize/unrealize children in ClutterGroup,
  ClutterActor already does it

* Do not realize impl by hand in clutter_stage_show(),
  since showing impl already does that

* Do not unrealize in various dispose() methods, since
  ClutterActor dispose implementation already does it
  and chaining up is mandatory

* ClutterTexture uses COGL while unrealizable (before it's
  added to a stage). Previously this breakage was affecting
  ClutterActor because we had to allow realize outside
  a stage. Move the breakage to ClutterTexture, by making
  ClutterTexture just use COGL while not realized.

* Unrealize before we set parent to NULL in clutter_actor_unparent().
  This means unrealize() implementations can get to the stage.
  Because actors need the stage in order to detach from stage.

* Update clutter-actor-invariants.txt to reflect latest changes

* Remove explicit hide/unrealize from ClutterActor::dispose since
  unparent already forces those
  Instead just assert that unparent() occurred and did the right thing.

* Check whether parent implements unrealize before chaining up
  Needed because ClutterGroup no longer has to implement unrealize.

* Perform unrealize in the default handler for the signal.
  This allows non-containers that have children to work properly,
  and allows containers to override how it's done.

* Add map/unmap virtual methods and set MAPPED flag on self and
  children in there. This allows subclasses to hook map/unmap.
  These are not signals, because notify::mapped is better for
  anything it's legitimate for a non-subclass to do.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-24 15:27:19 +01:00
Robert Bragg
c3d9f0bed4 [cogl-handle] Optimize how we define cogl handles
The cogl_is_* functions were showing up quite high on profiles due to
iterating through arrays of cogl handles.

This does away with all the handle arrays and implements a simple struct
inheritance scheme. All cogl objects now add a CoglHandleObject _parent;
member to their main structures. The base object includes 2 members a.t.m; a
ref_count, and a klass pointer. The klass in turn gives you a type and
virtual function for freeing objects of that type.

Each handle type has a _cogl_##handle_type##_get_type () function
automatically defined which returns a GQuark of the handle type, so now
implementing the cogl_is_* funcs is just a case of comparing with
obj->klass->type.

Another outcome of the re-work is that cogl_handle_{ref,unref} are also much
more efficient, and no longer need extending for each handle type added to
cogl. The cogl_##handle_type##_{ref,unref} functions are now deprecated and
are no longer used internally to Clutter or Cogl. Potentially we can remove
them completely before 1.0.
2009-04-02 11:58:43 +01:00
Havoc Pennington
077e3192fd [texture] Queue a relayout when changing :keep-aspect-ratio
Bug 1528 - queue relayout when setting ClutterTexture:keep-aspect-ratio

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-03-30 17:32:54 +01:00
Emmanuele Bassi
ccca24ab76 Remove usage of the grave accent as quotation mark
See:

  http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html

This should make Thomas happy.
2009-03-17 14:13:31 +00:00
Øyvind Kolås
56568db3b0 [clutter-texture] fixed gtk-doc formatting, and init threads in test.
Fixed markup to actually work with gtk-doc, also do a g_thread_init
in the test.
2009-03-16 00:40:02 +00:00
Øyvind Kolås
5895048f65 [clutter-texture] updated documentation.
Rewrote documentation, with the smallest amount of documentation for
load-data-async which is considered a special case of load-async.
2009-03-12 11:48:44 +00:00
Øyvind Kolås
25d54a650d Merge commit 'origin/async-texture-thread-pool' into async-size 2009-03-12 11:18:11 +00:00
Øyvind Kolås
93d8f62f6b [clutter-texture] remove load-size-async property
Only have load-data-async and load-async properties, both are construct
only and the latter adds the former load-size-async behavior on top of
load-data-async.
2009-03-12 10:38:39 +00:00
Øyvind Kolås
d3b68298ac [clutter-texture] add option to not block on size for loaded images
Added a construct time property to indicate that we do not want
to block on loading images.
2009-03-12 10:30:09 +00:00
Øyvind Kolås
5d3d971389 [tests] Added test-texture-async 2009-03-12 10:17:08 +00:00
Øyvind Kolås
e744066e7d Change the default size of thread pool from 3 to 1
Concurrently decoding three image files can stall animations even on a
dual core system, reducing to 1 concurrent image decoding thread.
2009-03-10 13:00:57 +00:00
Emmanuele Bassi
97d0a4845a [texture] Fix ClutterFixed usage
Do not use ClutterFixed and its macros inside the Texture.
2009-03-10 12:38:04 +00:00
Emmanuele Bassi
52811b240f [stage] Coalesce fog and perspective API
The fog and perspective API is currently split in two parts:

  - the floating point version, using values

  - the fixed point version, using structures

The relative properties are using the structure types, since they
are meant to set multiple values at the same time. Instead of
using bare values, the whole API should be coalesced into two
simple calls using structures to match the GObject properties.

Thus:

  clutter_stage_set_fog (ClutterStage*, const ClutterFog*)
  clutter_stage_get_fog (ClutterStage*, ClutterFog*)

  clutter_stage_set_perspective (ClutterStage*, const ClutterPerspective*)
  clutter_stage_get_perspective (ClutterStage*, ClutterPerspective*)

Which supercedes the fixed point and floating point variants.

More importantly, both ClutterFog and ClutterPerspective should
using floating point values, since that's what get passed to
COGL anyway.

ClutterFog should also drop the "density" member, since ClutterStage
only allows linear fog; non-linear fog distribution can be achieved
using a signal handler and calling cogl_set_fog() directly; this keeps
the API compact yet extensible.

Finally, there is no ClutterStage:fog so it should be added.
2009-03-10 12:38:03 +00:00
Neil Roberts
1626d6132e [clutter-texture] Use a GThreadPool for loading async textures
Instead of creating a separate thread for each texture load, the loads
are now queued in a thread pool which will use at most 3 textures at a
time. This avoids the potentially large overhead of creating and
destroying a thread for every image while still avoiding throttling
the CPU if a large number of textures are loaded at the same time.

If the load is cancelled the old code needed to join the thread which
effectively meant it had to wait for the load to finish. With this
model the threads are owned by the thread pool so there is no need to
wait for them to finish. Instead, each thread is given its own thread
data which we can use to mark the thread as aborted. Once the load is
finished the thread will check whether it is aborted before setting
the texture data. That way the ClutterTexture can just disown threads
that it needs to cancel.
2009-02-25 17:52:14 +00:00
Øyvind Kolås
84ecb5081f Bail early in clutter_texture_paint if opacity == 0
This causes clutter to skip all the GL work of state changes and
texturing if the opacity was 0. This is done in ClutterTexture and not
ClutterActor to ensure that pre and post paint signals work correctly.
Other expensive actors should be doing the same thing.
2009-02-19 15:44:16 +00:00
Emmanuele Bassi
c18e756267 [docs] Clarify the set_cogl_texture() documentation
When setting the COGL texture handle for a ClutterTexture the
texture will be set as the first layer of the material used
by the ClutterTexture. The documentation should clarify this
point.
2009-02-19 13:44:29 +00:00
Emmanuele Bassi
a0800b44ad [texture] Use COGL_TYPE_HANDLE for the handle properties
The :texture and :material properties of ClutterTexture use a
Clutter-provided GType shielding from CoglHandle. Since CoglHandle
now has a GType we can use COGL_TYPE_HANDLE instead.

This commit also removes the conditional compilation of the
:material property, as it makes little sense now that the
Materials API has landed.
2009-02-19 12:05:20 +00:00
Robert Bragg
03018f0c2a [Cogl] Renames cogl_paint_init to cogl_clear and adds a cogl_disable_fog function
cogl_paint_init was a bit too miscellaneous; it mainly cleared the color, depth
and stencil buffers but arbitrarily it also disabled fogging and lighting.

It no longer disables lighting, since we know Cogl never enables lighting and
disabling of fog is now handled with a seperate function.

Since I noticed cogl_set_fog was taking a density argument documented as
"Ignored" I've also added a mode argument to cogl_set_fog which exposes the
exponential fog modes which can make use of the density.
2009-02-18 16:00:52 +00:00
Øyvind Kolås
57ffcdf014 Added a mutex for clutter asynchronous textures threads.
Bug #1453 - Asynchronous texture loading can starve cpu.

Add a mutex that is held in the loader threads during the image
decoding. We were spawning and starting a thread for each asynchronously
loaded texture. This can cause cpu / memory starvation when many pixbuf
loaders allocate their temporary memory at the same time.

Also added -fno-strict-aliasing to MAINTAINER_CFLAGS in configure.ac
to avoid incorrect warnings caused by the static mutex code.
2009-02-18 10:35:45 +00:00