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):
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:
For more information on the capabilities of the Agile2D OpenGL renderer, see the agile2d.opengl package description in the API documentation.
To run Agile2D applications you need to install the Java 2 Runtime Environment (1.4), which can be downloaded from Sun's Java website.
Agile2D requires Java Swing, which is bundled with the Java 2 Runtime Environment.
The Agile2D OpenGL Renderer works with GL4Java, a freely available Java interface to the OpenGL library. GL4Java can be downloaded and installed from: http://www.jausoft.com/gl4java.html
Agile2D is open source software, and is available for download at:
The file NEWS describes the important changes in Agile2D releases.
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: firstname.lastname@example.org. We will do our best to fix bugs and incorporate improvements, as time becomes available.
Copyright © 2002 by University of Maryland, USA All rights reserved.