Hi Francis,

> The attached patch starts implementing support for custom Composite
> classes, starting with VolatileImageGraphics.
> 
> I've also attached the simple test I've been using, MyComposite.java
> which wraps the AlphaComposite class (thus preventing Cairo from
> handling alpha composite internally), and CustomComposite.java (which
> draws two arcs and an optional image, all with custom composite.. check
> the source code for a couple of options).
> "ecj CustomComposite.java MyComposite.java ; cacao CustomComposite" to
> run.
> 
> As this is, or at least feels like, a large change, I'd appreciate some
> feedback before committing it.  If this approach looks good, I'll
> continue with it for the other CairoGraphics2D subclasses.

I'd say the approach is ok, generally (at least wrt the overall approach
in the Cairo peers). However, you seem to be creating quite a couple of
temporary buffers in between and let them be GC'ed immediately.
- Try to limit the number of buffers needed and cache them.
- Limit the number of CompositeContext instances (probably update this
only in setComposite(), setRenderingHints(),..) and make sure you call
dispose() on them before they get freed, as they might contain native
resources.


Reply via email to