mirror of
https://github.com/brl/mutter.git
synced 2024-11-27 02:20:43 -05:00
2f445682b1
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. |
||
---|---|---|
.. | ||
actor-box.png | ||
animator-key-frames.png | ||
animator-key-frames.svg | ||
bin-layout.png | ||
box-layout.png | ||
building-clutter.xml | ||
clutter-animation-tutorial.xml | ||
clutter-docs.xml.in | ||
clutter-overview.xml | ||
clutter-sections.txt | ||
clutter.types | ||
constraints-example.png | ||
creating-behaviours.xml | ||
easing-modes.png | ||
easing-modes.svg | ||
event-flow.dia | ||
event-flow.png | ||
flow-layout-horizontal.png | ||
flow-layout-vertical.png | ||
glossary.xml | ||
Makefile.am | ||
migrating-ClutterBehaviour.xml | ||
migrating-ClutterEffect.xml | ||
migrating-ClutterPath.xml | ||
offscreen-redirect.png | ||
path-alpha-func.png | ||
running-clutter.xml | ||
subclassing-ClutterActor.xml |