1
0
Fork 0
mutter-performance-source/doc/reference/clutter
Emmanuele Bassi 2f445682b1 cairo-texture: Use signal-based drawing
The current "create context/draw/destroy context" pattern presents
various problems. The first issue is that it defers memory management to
the caller of the create() or create_region() methods, which makes
bookkeeping of the cairo_t* harder for language bindings and third party
libraries. The second issue is that, while it's easier for
draw-and-forget texturs, this API is needlessly complicated for contents
that have to change programmatically - and it introduces constraints
like calling the drawing code explicitly after a surface resize (e.g.
inside an allocate() implementation).

By using a signal-based approach we can make the CairoTexture actor
behave like other actors, and like other libraries using Cairo as their
2D drawing API.

The semantics of the newly-introduced ::draw signal are the same as the
one used by GTK+:

  - the signal is emitted on invalidation;
  - the cairo_t* context is owned by the actor;
  - it is safe to have multiple callbacks attached to the same
    signal, to allow composition;
  - the cairo_t* is already clipped to the invalidated area, so
    that Cairo can discard geometry immediately before we upload
    the texture data.

There are possible future improvements, like coalescing multiple
invalidations inside regions, and performing clipped draws during
the paint cycle; we could even perform clipped redraws if we know the
extent of the invalidated area.
2011-07-26 12:40:52 +01:00
..
actor-box.png Merged clutter-ivan branch into trunk. 2008-04-25 13:37:36 +00:00
animator-key-frames.png docs: Add visual cue for Animator's key frames 2010-02-25 17:09:55 +00:00
animator-key-frames.svg docs: Add visual cue for Animator's key frames 2010-02-25 17:09:55 +00:00
bin-layout.png docs: Add images for layout managers 2009-10-23 17:32:18 +01:00
box-layout.png docs: Add images for layout managers 2009-10-23 17:32:18 +01:00
building-clutter.xml backend: remove untested fruity backend 2011-04-11 17:54:36 +01:00
clutter-animation-tutorial.xml doc: fix clutter_init() usage in examples 2011-02-28 14:10:05 +00:00
clutter-docs.xml.in docs: Fix the GLX section 2011-06-20 19:45:14 +01:00
clutter-overview.xml docs: Fix some wrong function/signal/property names 2010-11-18 15:21:16 +00:00
clutter-sections.txt cairo-texture: Use signal-based drawing 2011-07-26 12:40:52 +01:00
clutter.types docs: Document ClutterDropAction 2011-06-20 15:25:54 +01:00
constraints-example.png docs: Fix up labels in the constraint example image 2011-06-20 19:44:33 +01:00
creating-behaviours.xml [docs] Fix wrong XML elements 2009-07-21 16:35:50 +01:00
easing-modes.png [docs] Update the easing modes documentation 2009-01-20 18:13:36 +00:00
easing-modes.svg [docs] Update the easing modes documentation 2009-01-20 18:13:36 +00:00
event-flow.dia * clutter/event-flow.png: fixed typo. 2008-06-13 10:37:33 +00:00
event-flow.png * clutter/event-flow.png: fixed typo. 2008-06-13 10:37:33 +00:00
flow-layout-horizontal.png docs: Add images for layout managers 2009-10-23 17:32:18 +01:00
flow-layout-vertical.png docs: Add images for layout managers 2009-10-23 17:32:18 +01:00
glossary.xml [docs] Add more collateral documentation 2009-09-03 16:51:14 +01:00
Makefile.am docs: Remove the in-tree cogl fixxref option 2011-06-21 10:52:44 +01:00
migrating-ClutterBehaviour.xml timeline: Rename the reverse property to auto-reverse 2010-12-17 12:07:52 +00:00
migrating-ClutterEffect.xml [docs] Fix typo in the effects migration guide 2009-07-21 09:20:16 +01:00
migrating-ClutterPath.xml docs: Fix some wrong function/signal/property names 2010-11-18 15:21:16 +00:00
offscreen-redirect.png clutter-actor: Add an 'offscreen-redirect' property 2011-05-13 01:46:32 +01:00
path-alpha-func.png Merged clutter-ivan branch into trunk. 2008-04-25 13:37:36 +00:00
running-clutter.xml docs: Use "Cogl" not "COGL" in Cogl API reference 2010-09-23 15:53:29 +01:00
subclassing-ClutterActor.xml docs: Update documentation to reflect automatic map/unmap/etc. 2010-11-24 16:51:59 +00:00