Does the java2d-code already have an tesselator?

Hi there,

1.) because Java2d also will be soon free (at least I really hope so) we Linux guys can start to make Java2d and X11 working better together.
I am crying a lot for a Java2d/XRender backend which does non-solid stuff (and scaling) in hardware if there is accaleration for it implemented in drivers.
Because I haven’t looked at the source till now (are they available under a special Sun license for now?) I wonder wether some platform alread has an tesselator - which is needed to split the complex polygons java2d gets as input into trapezoids understood by the C server.

2.) Furthermore is it possible to integrate LGPL-code into the java2d stuff, e.g. porting Cairo’s tesselator to java and integrate it?

3.) Do you think Sommer of Code 2007 will have Java on its list?

Thank you in advance, lg Clemens

  1. You can already look at complete Java2D code (if you agree to the Java Research License):
    https://jdk.dev.java.net/

You can take a look at the OpenGL pipeline (j2se/src/share/classes/sun/java2d/opengl,
j2se/src/share/native/sun/java2d) for the ideas about creating a new XRender pipelines.

  1. Have no idea. IANAL.

  2. Don’t know, but that’s not a bad idea.

Dmitri

Our non-antialiasing rasterizer (see the new ProcessPath and FillPath code in JDK 6, also the platform specific hooks in the OGL and X11 pipeline code) produces scanlines, which are basically 1-pixel tall quads that can be easily consumed by all of our low-level pipelines, esp. the software pipeline. This approach is good for quality, but for larger shapes, it’s a bit of a drag to send down lots of scanlines to OGL, for example. We’ve considered (but not done much work) on alternate rasterizers (essentially tesselators) which would produce triangles (good for OGL and D3D) or perhaps even trapezoids (for XRender). There are lots of triangle-generating implementations out there you can learn from. It would be a fun project if you’re feeling ambitious.

Thanks,
Chris

Thanks a lot for the helpful answers and explanations. I’ll have a look at the source when my holidays start in about a month.

The scanline stuff isn’t that bad as a starting point, basically a scanlinie is even a trapezoid, howevera quite an unoptimized one. I guess to change the behaviour to a more felxible implementatzion a lot of stuff would have to be moved inside the backends or the higher layers would have to know which input the underlaying backend would accept. Seems way too komplex for me :wink:

I guess rendering a polygon with scanlines through XRender is still faster than the readbacks we normally see.

I’ll be here again as soon as qestions pop up … I am quite sure this’ll happen :wink:

Thanks for you patience, lg Clemens