Description

Agile2D is a framework for experimenting with alternative Java2D
renderers.

Currently, Agile2D is bundled with one such renderer - the Agile2D OpenGL
Renderer. This provides a nearly complete implementation of Java2D built using
the industry standard OpenGL API.

OpenGL provides a number of interesting hardware acceleration capabilities,
including alpha blending, double buffering, antialiasing, and texturing, which
can be used to deliver impressive two-dimensional graphical applications. There are downsides. In particular, OpenGL does not perform well with very large
images, large quantities of text, or dynamic 2D polygons. Some applications perform better
under OpenGL acceleration. Others perform significantly worse.

The chart below show some representative performance
comparisons for Sun's Java2D and Agile2D OpenGL. The tests were both
run on a DELL Latitude M50, which has an nVidia Quadro4Go graphics
accelerator. The numbers indicate operations per second - i.e. how
many lines/rects/ovals etc. can be drawn per second, under various
conditions, using a logarithmic scale to allow the reading of small
values and large value. For example, the top-left values read "Java is
around 10^4.8 and Agile2D is around 10^5.5", the actual values being
77,425 and 413,494 lines per second (here is the linear scale):

Sun's Java2D in black, Agile2D OpenGL
in gray, scale is log 10.

As you can see, drawing simple lines and filling rectangles is significantly
faster under OpenGL. Most image operations are faster too. And as a general trend, notice
that operations involving alpha blending are much faster under OpenGL.

Importantly, drawing generic shapes and text is
sometimes slower under OpenGL. The issue with general shapes can be
somewhat mitigated by using immutable shapes - Agile2D caches
immutable shapes using OpenGL display lists and can render them
significantly faster (on the order of 50,000 shapes per second using
the same test conditions above).

See the Agile2D Porting Guide for information on how
to port your Java code to work with the Agile2D OpenGL Renderer - including using immutable shapes.

Agile2D is integrated with Swing. The OpenGL implementation is robust
enough to render the Swing Metal Look and Feel with reasonable fidelity and performance.
The left image below was painted using Sun's standard Java2D renderer. The image on the right was painted
using Agile2D's OpenGL renderer:

Sun's Java2D

Agile2D OpenGL

For more information on the capabilities of the Agile2D OpenGL
renderer, see the agile2d.opengl package description in the
API documentation.

Support

Agile2D is provided as-is by the Human-Computer
Interaction Lab, and is unsupported software. Feel free to use
it and to send us comments at: agile2d@cs.umd.edu. We will do our best to fix bugs and incorporate
improvements, as time becomes available.