J2D options

There are currently 4 ways of rendering with J2D on windows:

  1. default (no options)
  2. no hw acceleration at all (sun.java2d.noddraw=true)
  3. directdraw/direct3D (sun.java2d.ddforcevram=true, sun.java2d.translaccel=true, sun.java2d.ddscale=true)
  4. opengl (sun.java2d.opengl=True)

The current default is often the worst over-all on decent computers with either good graphics cards& drivers (use option 3 or 4) & good CPU’s (use noddraw).

Why doesn’t the VM detect what graphics card driver is present and enable the suitable options? Or maybe there should be an API that would tell us the driver’s state so that we can enable the right option. Eg: GraphicsCardDriver.isStable(“sun.java2d.opengl”). Or to find out whether hw-‘acceleration’ is actually faster - GraphicsCardDriver.isFaster(“sun.java2d.noddrawl”). Obviously these methods are a bit simplistsic, but you get my drift ;).

This improvement would make J2D a lot faster and less hit & miss. Also, what’s the point of all the J2D team’s improvements to the OGLpipeline & the D3D pipeline when its rarely unleashed due to the lowest-common denominator of crap computers?

This means going through GDI which does not mean its not hardwrae accalerated, it just uses another API - which makes accaleration harder :wink:

I don’t think that the default chioce is that bad. Mustang won’t use D3D for its default pipeline so some problems will go away.

And how should that be implemented :wink:
Keeping a database with known stable drivers is not an option, one release later of the driver (not in db) means no accaleration, if you assume backward-compatibility of drivers you have the problem that isStable could report true although exactly this driver release breaks OpenGL, but older drivers worked.

lg Clemens

I didn’t know that. How have you found this out? I’d love a pointer to a good ‘J2D on windows’ article. All the info I’ve been able to find is off Chet & Chris C.'s Blog, as well as the J2D API info docs.

Java update checker hooks up with the Sun site all the time, it wouldn’t take much to update a database or whatever with one or two driver details during the hook-up. Also its unlikely more recent versions of drivers will have broken features that worked OK before.

Don’t know, think I read about it some time ago. Well I hate windows, so java2d on windows is basically a no-brainer for me :wink:
I would love to see XRender useage, java2d still falls back to software on X11 when doing AA or not opaque stuff, all with could be accalerated through the RENDER api.

Do you really think this would work … I am very sceptical. Furthermore who will test? Sun?
I don’t think thats worth all the troubles in their eyes.
There’ve been tons of regressions, when I just think back how often NVidia broke some stuff, don’t know about ATI or others.

lg Clemens

You’re probably right, but I’ve got a feeling that Ken Russel & the J2D team know the ins & outs of all the drivers already with all the work they’ve put into testing OGL & J2D.