* master:
[cogl-vertex-buffer] Ensure the clip state before rendering
[test-text-perf] Small fix-ups
Add a test for text performance
[build] Ensure that cogl-debug is disabled by default
[build] The cogl GE macro wasn't passing an int according to the format string
Use the right internal format for GL_ARB_texture_rectangle
[actor_paint] Ensure painting is a NOP for actors with opacity = 0
Make backface culling work with vertex buffers
Before any rendering is done by Cogl it needs to ensure the clip stack
is set up correctly by calling cogl_clip_ensure. This was not being
done for the Cogl vertex buffer so it would still use the clip from
the previous render.
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>
- Fix a typo in a for loop in create_label which left 'i'
uninitialised and caused a crash if you're unlucky.
- Set the CLUTTER_VBLANK=none environment variable.
- Don't quit on a keypress.
- Trailing whitespace tidy up.
GLES doesn't support GL_QUADS. This patch makes it use GL_TRIANGLES
instead in that case. Unfortunately this means submitting two extra
vertices per quad. It could be better to use indexed elements once
CoglVertexBuffers gains support for that.
When ClutterGLXTexturePixmap uses GL_ARB_texture_rectangle,
it needs to pass the right internal format (GL_RGB or GL_RGBA)
when it initializes the texture with glTexImage2D() or later
handling won't recognize the alpha channel.
http://bugzilla.openedhand.com/show_bug.cgi?id=1586
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Since it is convenient to use geometry with an opacity of 0 for input only
purposes it's a worthwhile optimization to avoid submitting anything
for such actors while painting.
Backface culling is enabled as part of cogl_enable so the different
rendering functions in Cogl need to explicitly opt-in to have backface
culling enabled. Cogl vertex buffers should allow backface culling so
they should check whether it is enabled and then set the appropriate
cogl_enable flag.
In order to cope with the situation where an application renders with
a PangoLayout, makes some changes and then renders again with the same
layout, CoglPangoRenderer needs to detect that the changes have
occured so that it can recreate the display list. This is acheived by
keeping a reference to the first line of the layout. When the layout
is changed Pango will clear the layout pointer in the first line and
create a new line. So if the layout pointer in the line becomes NULL
then we know the layout has changed. This trick was suggested by
Behdad Esfahbod in this email:
http://mail.gnome.org/archives/gtk-i18n-list/2009-May/msg00019.html
When a position is given to cogl_pango_render_layout_subpixel it
translates the GL matrix by the coordinates. However it was not
dividing by PANGO_SCALE so the coordinates were completely wrong.
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.
Currently, COGL depends on defining debug symbols by manually
modifying the source code. When it's done, it will forcefully
print stuff to the console.
Since COGL has also a pretty, runtime selectable debugging API
we might as well switch everything to it.
In order for this to happen, configure needs a new:
--enable-cogl-debug
command line switch; this will enable COGL debugging, the
CoglHandle debugging and will also turn on the error checking
for each GL operation.
The default setting for the COGL debug defines is off, since
it slows down the GL operations; enabling it for a particular
debug build is trivial, though.
COGL has a debug message system like Clutter's own. In parallel,
it also uses a coupld of #defines. Spread around there are also
calls to printf() instead to the more correct g_log* wrappers.
This commit tries to unify and clean up the macros and the
debug message handling inside COGL to be more consistent.
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.
The code for the conversion of the GL error enumeration code
into a string is not following the code style and conventions
we follow in Clutter and COGL.
The GE() macro is also using fprintf(stderr) directly instead
of using g_warning() -- which is redirectable to an alternative
logging system using the g_log* API.
We use math routines inside Cogl, so it's correct to have it in
the LIBADD line. In normal usage something else was pulling in
-lm, but the introspection is relying on linking against the
convenience library.
Based on a patch by: Colin Walters <walters@verbum.org>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
The timeline created when calling set_timeline(NULL) is referenced
even though we implicitly own it. When the Animation is destroyed,
the timeline is then leaked.
Thanks to: Richard Heatley <richard.heatley@starleaf.com>
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1548
Add a method for deleting the current selection inside a Text actor.
This is useful for subclasses.
See bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1521
Based on a patch by: Raymond Liu <raymond.liu@intel.com>
ClutterAnimation currently inherits the initial floating reference
semantics from GInitiallyUnowned. An Animation is, though, meant to
be used as a top-level object, like a Timeline or a Behaviour, and
not "owned" by another object. For this reason, the initial floating
reference does not make any sense.
Document that repeated calls to clutter_cairo_texture_create()
continue drawing on the same cairo_surface_t. Add
clutter_cairo_texture_clear() for when you don't want that behavior.
http://bugzilla.openedhand.com/show_bug.cgi?id=1599
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
The cursor x position is already translated, so we do not need to take the
actors allocation into account when calculating scrolling.
Additionally, we need to update the text_x value before running
clutter_text_ensure_cursor_position.
Add any scrolling offset to the x value when in single line mode.
Now that the offset is taken into account in the position_to_coords
function, we do not need to adjust the cursor x manually in
clutter_text_paint.
Print out the cursor and selection positions in order to verify
the behaviour of the Text actor.
This is a likely candidate for a conformance test unit as well.
If the cursor is already at the end of the Text contents then we
need to maintain its position when deleting the previous character
using the relative key binding.
The required "fake" libclutter-cogl.la upon with the main clutter
shared object depends is only built with introspection enabled
instead of being built unconditionally.
Passing:
--library=clutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@
to g-ir-scanner, when building Cogl was causing g-ir-scanner to
link the introspection program against the installed clutter library,
if it existed or fail otherwise. Instead copy the handling from
the json/ directory where we link against the convenience library
to scan, and do the generation of the typelib later in the
main clutter/directory.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1594
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
If text is set, ClutterText should never return less than the layout
height for minimum and preferred heights.
This holds unless ellipsize and wrap are enabled, in which case the
minimum height should be the height of the first line -- which is
the height needed to at the very least show the ellipsization.
Based on a patch by: Thomas Wood <thomas@openedhand.com>
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1598
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This is the another step into abstracting the backend operations
that are currently spread all across the board back into the
backend implementations where they belong.
The GL context creation, for instance, is demanded to the stage
realization which makes it a critical path for every operation
that is GL-context bound. This usually does not make any difference
since we realize the default stage, but at some point we might
start looking into avoiding the default stage realization in order
to make the Clutter startup faster.
It also makes the code maintainable because every part is self
contained and can be reworked with the minimum amount of pain.