mutter/doc
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
..
common cookbook: Remove bold on emphasis inside programlisting 2010-12-09 13:39:48 +00:00
cookbook Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
reference cairo-texture: Use signal-based drawing 2011-07-26 12:40:52 +01:00
actor-invariants.txt docs: Rename the invariants documentation 2011-07-19 14:02:59 +01:00
AUTHORS.old Move some old doc files under doc/ 2011-06-09 15:53:29 +01:00
CODING_STYLE Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
HACKING docs: Use "Cogl" not "COGL" in Cogl API reference 2010-09-23 15:53:29 +01:00
HACKING.backends docs: Update the HACKING.backends documentation 2011-02-09 13:29:30 +00:00
Makefile.am docs: Remove manual/ 2011-07-20 11:32:15 +01:00
RELEASING doc/RELEASING: Fix the check for diffs from origin/master 2011-06-29 16:16:25 +01:00
size-negotiation.txt docs: Add fixed size and constraints to the size negotiation docs 2011-07-19 14:11:11 +01:00