The CommonGraphics2D class splits all shapes into a set of rectangles to unify the drawing process for different operating systems and architectures. For this purpose Java 2D* uses the JavaShapeRasterizer and the JavaLineRasterizer classes from the org.apache.harmony.awt.gl.render package. The JavaShapeRasterizer class splits an object implementing a Shape interface into a set of rectangles and produces a MultiRectArea object. The JavaLineRasterizer class makes line drawing more accurate and processes lines with strokes, which are instances of the BasicStroke class.
To port the shape drawing to another platform you just need to override rectangle-drawing methods. However, if your operating system has functions to draw particular shapes, you can optimize your subclass of the CommonGraphics2D class by using this functionality in overridden methods.
Blitter classes draw images on the display or buffered images. All blitters inherit the org.apache.harmony.awt.gl.render.Blitter interface.
Blitters are divided into:
DRL Java 2D* also uses blitters to fill the shapes and the user-defined subclasses of the java.awt.Paint class with paints, which the system does not support.
Text renderers draw strings and glyph vectors. All text renderers are subclasses of the org.apache.harmony.awt.gl.TextRenderer class.
|
|
|
|
|
|
|
|
|
|
|
|