Roman Kennke wrote:

The last evenings I put on my pink eyeglasses and started an
implementation of Graphics2D in pure Java. I slapped together an
AbstractGraphics2D class which is intented to be used as a starting
point for Graphics2D implementation. It implements as much functionality
as possible in Java, only relying on a backend beeing able to set and
get pixel data from the surface. I know that this is stupid and slow and
all and will probably only serve as study object, but who knows. There
are lots of systems out there that simply cannot have something like
cairo in the back to support java2d, and a staggering slow
implementation is probably better than nothing. And, studying the Java2D
API, I don't see how we could unleash the whole power and flexibility of
Java2D with Cairo or something. Last but not least, I noticed that the
development time is much smaller when no native code is involved (see my
XAWT impl), thanks to the great tool support available for Java (Eclipse
anyone?).

This implementation has of course no optimization at all. I think are
lots of pieces to optimize, like when there's no rotation, no special
stroke, a Paint that is a solid color, no composite etc et al. Also
there might be the possibility to fall back to native graphics
primitives for the all-to-common things like plain lines and rectangles
with no special settings for drawing Swing. But first I want to get
something working in the first place.

The next thing I will hack on is the BasicStroke so that this provides
real stroked shapes for the different settings. This will be a bigger
bulk to implement I suppose. When this is done, we should be able to
plug things together and make it do something.

Cheers, Roman

2006-04-21  Roman Kennke  <[EMAIL PROTECTED]>

       * gnu/java/awt/java2d/AbstractGraphics2D.java: New file.

/Roman

Hi Roman,

Interesting! I've been thinking about the same thing in the last couple of weeks, and I'm currently studying a Computer Graphics textbook to learn some more about the algorithms for line drawing, scanline conversion, anti-aliasing, color composition, etc. So I'd be interested to help out on this.

Do you have any technical information about creating stroked shapes? I couldn't find anything yet...

On fonts (which you didn't mention) I remember there was also some prior work, which I think could be useful here:

http://www.brawer.ch/software/fonts/

This could be fun...

Regards,

Dave

Reply via email to